1 Star 0 Fork 44

丈青山/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0020-xwayland-Also-hook-screen-s-MoveWindow-method.patch 3.02 KB
一键复制 编辑 原始数据 按行查看 历史
chengguipeng 提交于 2020-07-28 15:25 . xorg-x11-server: Update to 1.20.8
From 309e6e549adc5a164541d16822745c022cd8574b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 9 Jan 2020 11:00:36 +0100
Subject: [PATCH xserver 20/24] xwayland: Also hook screen's MoveWindow method
Not only hook the ResizeWindow method of the screen (which really is
MoveAndResize) but also hook the MoveWindow method for checking if we
need to setup a viewport for resolution change emulation.
Our resolution change emulation check if the windows origin matches
the monitors origin and the windows origin can also be changed by just
a move without being resized.
Also checking on a move becomes esp. important when we move to checking
on changes to the top-level non-window-manager client (X11)Window instead
of on changes to the xwl_window later on in this patch series.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 10df0437a2b142e61c4d84ffffa9592ac6846ef1)
---
hw/xwayland/xwayland.c | 25 +++++++++++++++++++++++++
hw/xwayland/xwayland.h | 1 +
2 files changed, 26 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 298ef3ac8..1294ff1d8 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1008,6 +1008,28 @@ xwl_resize_window(WindowPtr window,
xwl_window_check_resolution_change_emulation(xwl_window);
}
+static void
+xwl_move_window(WindowPtr window,
+ int x, int y,
+ WindowPtr next_sib,
+ VTKind kind)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ struct xwl_screen *xwl_screen;
+ struct xwl_window *xwl_window;
+
+ xwl_screen = xwl_screen_get(screen);
+ xwl_window = xwl_window_from_window(window);
+
+ screen->MoveWindow = xwl_screen->MoveWindow;
+ (*screen->MoveWindow) (window, x, y, next_sib, kind);
+ xwl_screen->MoveWindow = screen->MoveWindow;
+ screen->MoveWindow = xwl_move_window;
+
+ if (xwl_window && (xwl_window_get(window) || xwl_window_is_toplevel(window)))
+ xwl_window_check_resolution_change_emulation(xwl_window);
+}
+
static void
frame_callback(void *data,
struct wl_callback *callback,
@@ -1564,6 +1586,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->ResizeWindow = pScreen->ResizeWindow;
pScreen->ResizeWindow = xwl_resize_window;
+ xwl_screen->MoveWindow = pScreen->MoveWindow;
+ pScreen->MoveWindow = xwl_move_window;
+
if (xwl_screen->rootless) {
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 01aef27d2..72225374b 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -138,6 +138,7 @@ struct xwl_screen {
SetWindowPixmapProcPtr SetWindowPixmap;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
ResizeWindowProcPtr ResizeWindow;
+ MoveWindowProcPtr MoveWindow;
struct xorg_list output_list;
struct xorg_list seat_list;
--
2.25.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhang__3125/xorg-x11-server.git
git@gitee.com:zhang__3125/xorg-x11-server.git
zhang__3125
xorg-x11-server
xorg-x11-server
master

搜索帮助