Removed
Link Here
|
1 |
From 23c7e6e13bbe2c6b736e817f501dc0dd5b242787 Mon Sep 17 00:00:00 2001 |
2 |
From: Ronan Pigott <rpigott@berkeley.edu> |
3 |
Date: Mon, 13 Sep 2021 17:14:14 -0700 |
4 |
Subject: [PATCH] Check if size changed before hiding a surface |
5 |
|
6 |
Commit 68188fc948 introduces a workaround for clients that try to |
7 |
change the size of a popup after it is created, but inadvertently |
8 |
introduces an infinite loop of surface creation when the popup enters |
9 |
two or more wl_outputs with different scales on creation. |
10 |
|
11 |
This commit checks if the size actually changed before applying the |
12 |
workaround and avoids the loop. |
13 |
--- |
14 |
gdk/wayland/gdkwindow-wayland.c | 8 +++++--- |
15 |
1 file changed, 5 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c |
18 |
index 1e82dcae3e..5d300a94ce 100644 |
19 |
--- a/gdk/wayland/gdkwindow-wayland.c |
20 |
+++ b/gdk/wayland/gdkwindow-wayland.c |
21 |
@@ -1199,6 +1199,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window, |
22 |
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); |
23 |
gboolean is_xdg_popup; |
24 |
gboolean is_visible; |
25 |
+ gboolean size_changed; |
26 |
|
27 |
impl->unconfigured_width = calculate_width_without_margin (window, width); |
28 |
impl->unconfigured_height = calculate_height_without_margin (window, height); |
29 |
@@ -1206,9 +1207,8 @@ gdk_wayland_window_maybe_configure (GdkWindow *window, |
30 |
if (should_inhibit_resize (window)) |
31 |
return; |
32 |
|
33 |
- if (window->width == width && |
34 |
- window->height == height && |
35 |
- impl->scale == scale) |
36 |
+ size_changed = (window->width != width || window->height != height); |
37 |
+ if (!size_changed && impl->scale == scale) |
38 |
return; |
39 |
|
40 |
/* For xdg_popup using an xdg_positioner, there is a race condition if |
41 |
@@ -1222,6 +1222,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window, |
42 |
|
43 |
if (is_xdg_popup && |
44 |
is_visible && |
45 |
+ size_changed && |
46 |
!impl->initial_configure_received && |
47 |
!impl->configuring_popup) |
48 |
gdk_window_hide (window); |
49 |
@@ -1230,6 +1231,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window, |
50 |
|
51 |
if (is_xdg_popup && |
52 |
is_visible && |
53 |
+ size_changed && |
54 |
!impl->initial_configure_received && |
55 |
!impl->configuring_popup) |
56 |
gdk_window_show (window); |
57 |
-- |
58 |
2.33.1 |
59 |
|