[gtk+/gtk-3-22] gdkwindow: different displays, different classes



commit efbe40214b5d670c3a3bbd2d674fe27285d2f346
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Tue Mar 28 11:10:05 2017 +0200

    gdkwindow: different displays, different classes
    
    GdkWindow's before_process_all_updates() and after_process_all_updates()
    wrongly assume that all displays are from the same class, which is not
    the case if for example a client open different displays with different
    backends such as X11 and Wayland.
    
    Use the actual class for each display in the display list to avoid a
    crash when mixing displays from different classes.
    
    Fix suggested by Christian Persch <chpe gnome org> in bug #776472.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776472

 gdk/gdkwindow.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ac3229f..689d666 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -4024,12 +4024,10 @@ static void
 before_process_all_updates (void)
 {
   GSList *displays, *l;
-  GdkDisplayClass *display_class;
 
   displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
-  display_class = GDK_DISPLAY_GET_CLASS (displays->data);
   for (l = displays; l; l = l->next)
-    display_class->before_process_all_updates (l->data);
+    GDK_DISPLAY_GET_CLASS (l->data)->before_process_all_updates (l->data);
 
   g_slist_free (displays);
 }
@@ -4038,12 +4036,10 @@ static void
 after_process_all_updates (void)
 {
   GSList *displays, *l;
-  GdkDisplayClass *display_class;
 
   displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
-  display_class = GDK_DISPLAY_GET_CLASS (displays->data);
   for (l = displays; l; l = l->next)
-    display_class->after_process_all_updates (l->data);
+    GDK_DISPLAY_GET_CLASS (l->data)->after_process_all_updates (l->data);
 
   g_slist_free (displays);
 }


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