0 Star 0 Fork 42

t.feng/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0016-xwayland-Fix-setting-of-_XWAYLAND_RANDR_EMU_MONITOR_.patch 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
t.feng 提交于 2020-03-16 22:51 . patch init
From 2db2fcb97bd148476817634486cb384a1f623fa9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 4 Nov 2019 14:32:29 +0100
Subject: [PATCH xserver 16/17] xwayland: Fix setting of
_XWAYLAND_RANDR_EMU_MONITOR_RECTS prop on new windows
For window-manager managed windows, xwl_realize_window is only called for
the window-manager's decoration window and not for the actual client window
on which we should set the _XWAYLAND_RANDR_EMU_MONITOR_RECTS prop.
Usualy this is not a problem since we walk all client windows to update
the property when the resolution is changed through a randr call.
But for apps which first do the randr change and only then create their
window this does not work, and our xwl_output_set_window_randr_emu_props
call in xwl_realize_window is a no-op as that is only called for the wm
decoration window and not for the actual client's window.
This commit fixes this by making ensure_surface_for_window() call
xwl_output_set_window_randr_emu_props on the first and only child of
window-manager managed windows.
Note this also removes the non-functional xwl_output_set_window_randr_emu_props
call from xwl_realize_window, which was intended to do this, but does not
work.
This fixes apps using the ogre3d library always running at the
monitors native resolution.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/xwayland/xwayland.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index ed1d671ff..1ce29c51c 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -815,7 +815,13 @@ ensure_surface_for_window(WindowPtr window)
xwl_window_init_allow_commits(xwl_window);
- if (!xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) {
+ /* When a new windom-manager decoration window is realized, then the randr
+ * emulation props have not been set on the managed client window yet.
+ */
+ if (xwl_screen_client_is_window_manager(xwl_screen, wClient(window))) {
+ if (window->firstChild && window->firstChild == window->lastChild)
+ xwl_output_set_window_randr_emu_props(xwl_screen, window->firstChild);
+ } else {
/* CSD or O-R toplevel window, check viewport on creation */
xwl_window_check_resolution_change_emulation(xwl_window);
}
@@ -864,8 +870,6 @@ xwl_realize_window(WindowPtr window)
return FALSE;
}
- xwl_output_set_window_randr_emu_props(xwl_screen, window);
-
return ensure_surface_for_window(window);
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/t_feng/xorg-x11-server.git
git@gitee.com:t_feng/xorg-x11-server.git
t_feng
xorg-x11-server
xorg-x11-server
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385