[gnome-panel] avoid deprecated gdk_flush



commit 0aac21c5145e7a6be75ba6408d0f2d164afc8bdd
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 13 16:56:28 2018 +0300

    avoid deprecated gdk_flush

 gnome-panel/panel-force-quit.c | 17 ++++++++++-------
 gnome-panel/panel-util.c       | 10 +++++++---
 gnome-panel/panel-widget.c     | 16 ++++++++--------
 3 files changed, 25 insertions(+), 18 deletions(-)
---
diff --git a/gnome-panel/panel-force-quit.c b/gnome-panel/panel-force-quit.c
index e5312c3b8..762145e65 100644
--- a/gnome-panel/panel-force-quit.c
+++ b/gnome-panel/panel-force-quit.c
@@ -194,15 +194,18 @@ kill_window_response (GtkDialog *dialog,
                      gpointer   user_data)
 {
        if (response_id == GTK_RESPONSE_ACCEPT) {
-               Display *display;
+               GdkDisplay *display;
+               Display *xdisplay;
                Window window = (Window) user_data;
 
-               display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (dialog)));
+               display = gtk_widget_get_display (GTK_WIDGET (dialog));
+               xdisplay = gdk_x11_display_get_xdisplay (display);
 
-               gdk_error_trap_push ();
-               XKillClient (display, window);
-               gdk_flush ();
-               gdk_error_trap_pop_ignored ();
+               gdk_x11_display_error_trap_push (display);
+               XKillClient (xdisplay, window);
+               gdk_x11_display_error_trap_pop_ignored (display);
+
+               gdk_display_flush (display);
        }
 
        gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -356,5 +359,5 @@ panel_force_quit (GdkScreen *screen,
                return;
        }
 
-       gdk_flush ();
+       gdk_display_flush (display);
 }
diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c
index 70b1e6b6d..7090ba1b4 100644
--- a/gnome-panel/panel-util.c
+++ b/gnome-panel/panel-util.c
@@ -104,11 +104,15 @@ panel_push_window_busy (GtkWidget *window)
 
                win = gtk_widget_get_window (window);
                if (win != NULL) {
-                       GdkCursor *cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
-                                                                       GDK_WATCH);
+                       GdkDisplay *display;
+                       GdkCursor *cursor;
+
+                       display = gdk_display_get_default ();
+                       cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+
                        gdk_window_set_cursor (win, cursor);
                        g_object_unref (cursor);
-                       gdk_flush ();
+                       gdk_display_flush (display);
                }
        }
 
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 5451881a2..0ef0f68c0 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -1691,21 +1691,19 @@ panel_widget_applet_drag_start (PanelWidget *panel,
        window = gtk_widget_get_window (applet);
        if (window) {
                GdkGrabStatus  status;
-               GdkCursor     *fleur_cursor;
                GdkDisplay    *display;
+               GdkCursor     *fleur_cursor;
                GdkSeat       *seat;
 
-               fleur_cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
-                                                          GDK_FLEUR);
-
-               display = gdk_window_get_display (window);
+               display = gdk_display_get_default ();
+               fleur_cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
                seat = gdk_display_get_default_seat (display);
 
                status = gdk_seat_grab (seat, window, GDK_SEAT_CAPABILITY_POINTER,
                                        FALSE, fleur_cursor, NULL, NULL, NULL);
 
                g_object_unref (fleur_cursor);
-               gdk_flush ();
+               gdk_display_flush (display);
 
                if (status != GDK_GRAB_SUCCESS) {
                        g_warning (G_STRLOC ": failed to grab pointer (errorcode: %d)",
@@ -1733,7 +1731,7 @@ panel_widget_applet_drag_end (PanelWidget *panel)
        gtk_grab_remove (panel->currently_dragged_applet->applet);
        panel_widget_applet_drag_end_no_grab (panel);
        panel_toplevel_pop_autohide_disabler (panel->toplevel);
-       gdk_flush ();
+       gdk_display_flush (display);
 }
 
 /*get pos of the cursor location in panel coordinates*/
@@ -2314,6 +2312,7 @@ panel_widget_reparent (PanelWidget         *old_panel,
        AppletData *ad;
        GtkWidget *focus_widget = NULL;
        AppletInfo* info;
+       GdkDisplay *display;
 
        g_return_val_if_fail(PANEL_IS_WIDGET(old_panel), FALSE);
        g_return_val_if_fail(PANEL_IS_WIDGET(new_panel), FALSE);
@@ -2364,7 +2363,8 @@ panel_widget_reparent (PanelWidget         *old_panel,
        }
        gtk_window_present (GTK_WINDOW (new_panel->toplevel));
 
-       gdk_flush();
+       display = gdk_display_get_default ();
+       gdk_display_flush (display);
 
        emit_applet_moved (new_panel, ad);
 


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