diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-12-05 00:07:21 +0100 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-12-07 20:37:29 +0100 |
commit | ff23a2a58238b1b69142754254c6159b08f7fa4b (patch) | |
tree | 0c4cb5224ca6a59eb0c9b69de0d69751294fe33a | |
parent | 8396bdb759543442c6bbb9e5b0f4ebd7c26a0fce (diff) | |
download | gtk+-ff23a2a58238b1b69142754254c6159b08f7fa4b.tar.gz |
x11: Use resize counting for freezing updates too
It's already keep strack of when we're waiting for configure events, so
lets reuse it. This fixes an issue where reshown dialogs wouldn't
reappear.
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 10 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 25 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.h | 2 |
3 files changed, 17 insertions, 20 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 692f85230c..73529906c5 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -920,16 +920,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, int ty = 0; Window child_window = 0; - if (surface_impl->pending_configure_events == 1) - { - surface_impl->pending_configure_events = 0; - gdk_surface_thaw_updates (surface); - } - else if (surface_impl->pending_configure_events > 1) - { - surface_impl->pending_configure_events--; - } - x = y = 0; gdk_x11_display_error_trap_push (display); if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface), diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 15c296ae45..a4b6e5f6ce 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -1626,8 +1626,13 @@ x11_surface_resize (GdkSurface *surface, } else { - if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height) - surface->resize_count += 1; + if (width * impl->surface_scale != impl->unscaled_width || + height * impl->surface_scale != impl->unscaled_height) + { + surface->resize_count++; + if (surface->resize_count == 1) + gdk_surface_freeze_updates (surface); + } } } @@ -1678,8 +1683,13 @@ x11_surface_move_resize (GdkSurface *surface, } else { - if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height) - surface->resize_count += 1; + if (width * impl->surface_scale != impl->unscaled_width || + height * impl->surface_scale != impl->unscaled_height) + { + surface->resize_count++; + if (surface->resize_count == 1) + gdk_surface_freeze_updates (surface); + } } } @@ -4244,6 +4254,9 @@ _gdk_x11_moveresize_configure_done (GdkDisplay *display, XEvent *tmp_event; MoveResizeData *mv_resize = get_move_resize_data (display, FALSE); + gdk_surface_thaw_updates (surface); + gdk_surface_request_layout (surface); + if (!mv_resize || surface != mv_resize->moveresize_surface) return FALSE; @@ -5068,10 +5081,6 @@ gdk_x11_toplevel_present (GdkToplevel *toplevel, size.shadow.bottom); } - impl->pending_configure_events++; - if (impl->pending_configure_events == 1) - gdk_surface_freeze_updates (surface); - if (gdk_toplevel_layout_get_maximized (layout)) gdk_x11_surface_maximize (surface); else diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h index 1e47827971..6fd7122ba0 100644 --- a/gdk/x11/gdksurface-x11.h +++ b/gdk/x11/gdksurface-x11.h @@ -72,8 +72,6 @@ struct _GdkX11Surface int unscaled_width; int unscaled_height; - int pending_configure_events; - struct { int configured_width; int configured_height; |