[gimp/gtk3-port: 367/440] Get rid of gdk_flush() globally, use gdk_display_flush()



commit 47e28c1290909b9846baec08227567803e53a8f8
Author: Michael Natterer <mitch gimp org>
Date:   Tue May 8 00:54:02 2018 +0200

    Get rid of gdk_flush() globally, use gdk_display_flush()

 app/display/gimpnavigationeditor.c   |    2 +-
 app/gui/gui-vtable.c                 |    4 ++--
 app/tools/gimpeditselectiontool.c    |   15 ++++++++-------
 app/widgets/gimpwidgets-utils.c      |    2 +-
 libgimpwidgets/gimppreview.c         |    2 +-
 libgimpwidgets/test-preview-area.c   |   10 +++++-----
 plug-ins/common/animation-play.c     |    2 +-
 plug-ins/common/curve-bend.c         |    4 ++--
 plug-ins/file-jpeg/jpeg-save.c       |    2 +-
 plug-ins/ifs-compose/ifs-compose.c   |    2 +-
 plug-ins/lighting/lighting-preview.c |    2 +-
 plug-ins/screenshot/screenshot-x11.c |    2 +-
 plug-ins/screenshot/screenshot.c     |    3 ++-
 13 files changed, 27 insertions(+), 25 deletions(-)
---
diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c
index 76d6989..7834e26 100644
--- a/app/display/gimpnavigationeditor.c
+++ b/app/display/gimpnavigationeditor.c
@@ -340,7 +340,7 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
   }
 
   gtk_widget_show (shell->nav_popup);
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (shell->nav_popup));
 
   /* fill in then grab pointer */
   gimp_navigation_view_set_motion_offset (view, 0, 0);
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index 3dfeec7..53f976b 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -230,7 +230,7 @@ gui_set_busy (Gimp *gimp)
   gimp_displays_set_busy (gimp);
   gimp_dialog_factory_set_busy (gimp_dialog_factory_get_singleton ());
 
-  gdk_flush ();
+  gdk_display_flush (gdk_display_get_default ());
 }
 
 static void
@@ -239,7 +239,7 @@ gui_unset_busy (Gimp *gimp)
   gimp_displays_unset_busy (gimp);
   gimp_dialog_factory_unset_busy (gimp_dialog_factory_get_singleton ());
 
-  gdk_flush ();
+  gdk_display_flush (gdk_display_get_default ());
 }
 
 static void
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 3d1c0ad..4785753 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -516,13 +516,14 @@ gimp_edit_selection_tool_update_motion (GimpEditSelectionTool *edit_select,
                                         gdouble                new_y,
                                         GimpDisplay           *display)
 {
-  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (edit_select);
-  GimpTool     *tool      = GIMP_TOOL (edit_select);
-  GimpImage    *image     = gimp_display_get_image (display);
-  gint          dx;
-  gint          dy;
-
-  gdk_flush ();
+  GimpDrawTool     *draw_tool = GIMP_DRAW_TOOL (edit_select);
+  GimpTool         *tool      = GIMP_TOOL (edit_select);
+  GimpDisplayShell *shell     = gimp_display_get_shell (display);
+  GimpImage        *image     = gimp_display_get_image (display);
+  gint              dx;
+  gint              dy;
+
+  gdk_display_flush (gtk_widget_get_display (GTK_WIDGET (shell)));
 
   gimp_draw_tool_pause (draw_tool);
 
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index d3c016f..1ad2edc 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1411,7 +1411,7 @@ gimp_widget_flush_expose (GtkWidget *widget)
     return;
 
   gdk_window_process_updates (gtk_widget_get_window (widget), FALSE);
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (widget));
 }
 
 gboolean
diff --git a/libgimpwidgets/gimppreview.c b/libgimpwidgets/gimppreview.c
index a1aeb90..881edcf 100644
--- a/libgimpwidgets/gimppreview.c
+++ b/libgimpwidgets/gimppreview.c
@@ -523,7 +523,7 @@ gimp_preview_invalidate_now (GimpPreview *preview)
       gdk_window_set_cursor (gtk_widget_get_window (priv->area),
                              priv->cursor_busy);
 
-      gdk_flush ();
+      gdk_display_flush (gtk_widget_get_display (toplevel));
 
       g_signal_emit (preview, preview_signals[INVALIDATED], 0);
 
diff --git a/libgimpwidgets/test-preview-area.c b/libgimpwidgets/test-preview-area.c
index 18f0d1a..681c2ed 100644
--- a/libgimpwidgets/test-preview-area.c
+++ b/libgimpwidgets/test-preview-area.c
@@ -84,7 +84,7 @@ test_run (GtkWidget *area,
     }
 
   gdk_window_process_all_updates ();
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (area));
 
   timer = g_timer_new ();
 
@@ -108,7 +108,7 @@ test_run (GtkWidget *area,
           gdk_window_process_updates (area->window, FALSE);
         }
 
-      gdk_flush ();
+      gdk_display_flush (gtk_widget_get_display (area));
       total_time = g_timer_elapsed (timer, NULL) - start_time;
 
       g_print ("%-20s "
@@ -138,7 +138,7 @@ test_run (GtkWidget *area,
           gdk_window_process_updates (area->window, FALSE);
         }
 
-      gdk_flush ();
+      gdk_display_flush (gtk_widget_get_display (area));
       total_time = g_timer_elapsed (timer, NULL) - start_time;
 
       g_print ("%-20s "
@@ -170,7 +170,7 @@ test_run (GtkWidget *area,
           gdk_window_process_updates (area->window, FALSE);
         }
 
-      gdk_flush ();
+      gdk_display_flush (gtk_widget_get_display (area));
       total_time = g_timer_elapsed (timer, NULL) - start_time;
 
       g_print ("%-20s "
@@ -197,7 +197,7 @@ test_run (GtkWidget *area,
       gdk_window_process_updates (area->window, FALSE);
     }
 
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (area));
   total_time = g_timer_elapsed (timer, NULL) - start_time;
   g_print ("%-20s "
            "fill  :  %5.2fs, %8.1f fps, %8.2f megapixels/s\n",
diff --git a/plug-ins/common/animation-play.c b/plug-ins/common/animation-play.c
index 602258f..ad1d7a6 100644
--- a/plug-ins/common/animation-play.c
+++ b/plug-ins/common/animation-play.c
@@ -450,7 +450,7 @@ shape_released (GtkWidget *widget)
 {
   gtk_grab_remove (widget);
   gdk_display_pointer_ungrab (gtk_widget_get_display (widget), 0);
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (widget));
 
   return FALSE;
 }
diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c
index 02038d7..da686bb 100644
--- a/plug-ins/common/curve-bend.c
+++ b/plug-ins/common/curve-bend.c
@@ -1145,7 +1145,7 @@ do_dialog (GimpDrawable *drawable)
   bender_update (cd, UP_GRAPH | UP_DRAW | UP_PREVIEW_EXPOSE);
 
   gtk_main ();
-  gdk_flush ();
+  gdk_display_flush (gtk_widget_get_display (cd->shell));
 
   gimp_image_delete(cd->preview_image_id);
   cd->preview_image_id = -1;
@@ -1525,7 +1525,7 @@ bender_update (BenderDialog *cd,
     {
       gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (cd->shell)),
                              cd->cursor_busy);
-      gdk_flush ();
+      gdk_display_flush (gtk_widget_get_display (cd->shell));
 
       if (cd->preview_layer_id2 >= 0)
          gimp_image_remove_layer(cd->preview_image_id, cd->preview_layer_id2);
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index 0fa8142..48d3a55 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -228,7 +228,7 @@ background_jpeg_save (PreviewPersistent *pp)
       prev_p = NULL;
 
       gimp_displays_flush ();
-      gdk_flush ();
+      gdk_display_flush (gdk_display_get_default ());
 
       return FALSE;
     }
diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c
index d979073..0ca597f 100644
--- a/plug-ins/ifs-compose/ifs-compose.c
+++ b/plug-ins/ifs-compose/ifs-compose.c
@@ -965,7 +965,7 @@ ifs_compose_dialog (gint32 drawable_id)
   if (ifsOptD)
     gtk_widget_destroy (ifsOptD->dialog);
 
-  gdk_flush ();
+  gdk_display_flush (gdk_display_get_default ());
 
   g_free (ifsD);
 
diff --git a/plug-ins/lighting/lighting-preview.c b/plug-ins/lighting/lighting-preview.c
index 32a82bb..294df27 100644
--- a/plug-ins/lighting/lighting-preview.c
+++ b/plug-ins/lighting/lighting-preview.c
@@ -394,7 +394,7 @@ preview_compute (void)
   cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
   gdk_window_set_cursor (gtk_widget_get_window (previewarea), cursor);
   g_object_unref (cursor);
-  gdk_flush ();
+  gdk_display_flush (display);
 }
 
 
diff --git a/plug-ins/screenshot/screenshot-x11.c b/plug-ins/screenshot/screenshot-x11.c
index 9fd1050..46ec079 100644
--- a/plug-ins/screenshot/screenshot-x11.c
+++ b/plug-ins/screenshot/screenshot-x11.c
@@ -148,7 +148,7 @@ select_window (ScreenshotValues *shootvals,
 
 #undef X_GRAB_KEY
 
-      gdk_flush ();
+      gdk_display_flush (gdk_monitor_get_display (monitor));
 
       if (gdk_error_trap_pop ())
         {
diff --git a/plug-ins/screenshot/screenshot.c b/plug-ins/screenshot/screenshot.c
index 2a3984e..86c38c8 100644
--- a/plug-ins/screenshot/screenshot.c
+++ b/plug-ins/screenshot/screenshot.c
@@ -343,7 +343,8 @@ run (const gchar      *name,
           if (shootvals.select_delay > 0)
             {
               gdk_display_beep (gdk_monitor_get_display (monitor));
-              gdk_flush (); /* flush so the beep makes it to the server */
+              /* flush so the beep makes it to the server */
+              gdk_display_flush (gdk_monitor_get_display (monitor));
             }
         }
 


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