[gtk+] Freeze the update counter for unmapped windows



commit 355e305c1686968467269e8dafbda9b896315d12
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Oct 3 20:13:42 2012 -0400

    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(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 5afb11c..4e28f74 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 99d2f7f..f6af492 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]