[gtk/gtk-3-24: 2/3] wayland: Don't inhibit premature resize for popups
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 2/3] wayland: Don't inhibit premature resize for popups
- Date: Mon, 6 Apr 2020 20:35:08 +0000 (UTC)
commit f06ee688fe86ec8e1db1c515a7bf2ccc8decc310
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Apr 6 21:53:00 2020 +0200
wayland: Don't inhibit premature resize for popups
So now we essentially only inhibit the premature resize for toplevel
windows, where it is most crucial. For popups, this didn't work for two
reasons: we relied on the owner of the popup (application) to resize
according to the configured size. For custom popup operators like
Epiphany and LibreOffice, this didn't work out well, since they simply
didn't.
Making gdk do it for them in case they didn't themself did make the
popups show up properly, but there were still some weirdness in
LibreOffice where tooltips didn't still didn't get the right size. So,
even though the size set by application may be different from the one
later configured by the display server, let the applications have their
way and see their resize result immediately. It's fairly likely to be
what they eventually get anyway.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2583
gdk/wayland/gdkwindow-wayland.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index cbd9412570..f6acc74366 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -273,6 +273,7 @@ static void gdk_wayland_window_unexport (GdkWindow *window);
static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
static gboolean should_map_as_subsurface (GdkWindow *window);
+static gboolean should_map_as_popup (GdkWindow *window);
GType _gdk_window_impl_wayland_get_type (void);
@@ -1122,7 +1123,7 @@ is_realized_popup (GdkWindow *window)
}
static gboolean
-needs_initial_configure (GdkWindow *window)
+should_inhibit_resize (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
@@ -1132,12 +1133,17 @@ needs_initial_configure (GdkWindow *window)
return FALSE;
else if (impl->hint == GDK_WINDOW_TYPE_HINT_DND)
return FALSE;
- else if (is_realized_toplevel (window))
- return TRUE;
else if (is_realized_popup (window))
- return TRUE;
- else
- return !should_map_as_subsurface (window);
+ return FALSE;
+ else if (should_map_as_popup (window))
+ return FALSE;
+ else if (should_map_as_subsurface (window))
+ return FALSE;
+
+ /* This should now either be, or eventually be, a toplevel window,
+ * and we should wait for the initial configure to really configure it.
+ */
+ return !impl->initial_configure_received;
}
static void
@@ -1151,15 +1157,8 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
gboolean is_visible;
- if (needs_initial_configure (window) &&
- !impl->initial_configure_received)
- {
- impl->unconfigured_width = calculate_width_without_margin (window,
- width);
- impl->unconfigured_height = calculate_height_without_margin (window,
- height);
- return;
- }
+ if (should_inhibit_resize (window))
+ return;
if (window->width == width &&
window->height == height &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]