Skip to content

Commit f60116e

Browse files
aleastoMarge Bot
authored andcommitted
wayland: Always send configure event after xdg_popup::reposition
Commit 6c7565e changes meta_window_wayland_move_resize_internal so that it doesn't send a configure event if there were no changes since the last sent configure event. However the Wayland spec mandates that xdg_popup::repositioned and xdg_popup.configure be sent after a xdg_popup::reposition request, even if there were no changes in the placement. Add a new META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE flag to indicate that we require sending a configure event no matter what. This fixes a bug where entering a submenu within Gtk.PopoverMenu hangs GTK waiting for a configure event that never comes. Bug-Ubuntu: https://launchpad.net/bugs/2125770 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4691>
1 parent 0e7ac42 commit f60116e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/core/window-private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ typedef enum
7474
META_MOVE_RESIZE_WAYLAND_CLIENT_RESIZE = 1 << 12,
7575
META_MOVE_RESIZE_CONSTRAIN = 1 << 13,
7676
META_MOVE_RESIZE_RECT_INVALID = 1 << 14,
77+
META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE = 1 << 15,
7778
} MetaMoveResizeFlags;
7879

7980
typedef enum _MetaPlaceFlag

src/wayland/meta-window-wayland.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ should_configure (MetaWindow *window,
340340

341341
/* The state was changed, or the change was explicitly marked as a configure
342342
* request. */
343-
if (flags & META_MOVE_RESIZE_STATE_CHANGED)
343+
if (flags & META_MOVE_RESIZE_STATE_CHANGED ||
344+
flags & META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE)
344345
return TRUE;
345346

346347
return FALSE;
@@ -489,6 +490,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
489490
case META_PLACEMENT_STATE_CONSTRAINED_PENDING:
490491
{
491492
if (flags & META_MOVE_RESIZE_PLACEMENT_CHANGED ||
493+
flags & META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE ||
492494
!last_sent_configuration ||
493495
rel_x != last_sent_configuration->rel_x ||
494496
rel_y != last_sent_configuration->rel_y ||
@@ -504,7 +506,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
504506
configured_rect.width,
505507
configured_rect.height,
506508
geometry_scale);
507-
if (!meta_wayland_window_configuration_is_equivalent (
509+
if (flags & META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE ||
510+
!meta_wayland_window_configuration_is_equivalent (
508511
configuration,
509512
wl_window->last_sent_configuration))
510513
{
@@ -552,7 +555,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
552555
geometry_scale,
553556
flags,
554557
gravity);
555-
if (!meta_wayland_window_configuration_is_equivalent (
558+
if (flags & META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE ||
559+
!meta_wayland_window_configuration_is_equivalent (
556560
configuration,
557561
wl_window->last_sent_configuration))
558562
{
@@ -1676,7 +1680,8 @@ meta_window_place_with_placement_rule (MetaWindow *window,
16761680
place_flags |= META_PLACE_FLAG_CALCULATE;
16771681

16781682
meta_window_move_resize_internal (window,
1679-
(META_MOVE_RESIZE_MOVE_ACTION |
1683+
(META_MOVE_RESIZE_WAYLAND_FORCE_CONFIGURE |
1684+
META_MOVE_RESIZE_MOVE_ACTION |
16801685
META_MOVE_RESIZE_RESIZE_ACTION |
16811686
META_MOVE_RESIZE_PLACEMENT_CHANGED |
16821687
META_MOVE_RESIZE_CONSTRAIN),

0 commit comments

Comments
 (0)