From 355e305c1686968467269e8dafbda9b896315d12 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 3 Oct 2012 20:13:42 -0400 Subject: [PATCH] Freeze the update counter for unmapped windows When a window is unmapped, freeze its frame clock. This avoids doing unnecessary work, but also means that we won't block waiting for _NET_WM_FRAME_DRAWN messages that will never be received since the frame ended while the window was withdrawn. https://bugzilla.gnome.org/show_bug.cgi?id=685460 --- gdk/x11/gdkdisplay-x11.c | 6 ++++++ gdk/x11/gdkwindow-x11.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 5afb11c417..4e28f74ec0 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -688,6 +688,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, gdk_frame_clock_thaw (gdk_window_get_frame_clock (event->any.window)); } + if (toplevel) + gdk_window_freeze_toplevel_updates_libgtk_only (window); + _gdk_x11_window_grab_check_unmap (window, xevent->xany.serial); } @@ -708,6 +711,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, gdk_synthesize_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0); + + if (toplevel) + gdk_window_thaw_toplevel_updates_libgtk_only (window); } break; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 99d2f7f659..f6af492277 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -940,6 +940,9 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, G_CALLBACK (on_frame_clock_before_paint), window); g_signal_connect (clock, "after-paint", G_CALLBACK (on_frame_clock_after_paint), window); + + if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) + gdk_window_freeze_toplevel_updates_libgtk_only (window); } static GdkEventMask