[gimp] app: gdk_threads_(enter|leave)() deprecated since GDK 3.6.



commit 5d2dbfe2e88f5eacce5dd94c33b0e61e54e946d0
Author: Jehan <jehan girinstud io>
Date:   Mon Jul 22 11:17:49 2019 +0200

    app: gdk_threads_(enter|leave)() deprecated since GDK 3.6.
    
    There are no replacements. Just we must make sure that all GTK+/GDK
    calls are run from the main thread, which is already what we were doing.
    
    Actually I don't even think these were doing anything as we were not
    calling gdk_threads_init() so the default lock functions were not set
    anyway. These were just bogus calls.

 app/app.c                            |  6 +-----
 app/core/gimp-gui.c                  | 20 --------------------
 app/core/gimp-gui.h                  |  6 ------
 app/gimpcore.def                     |  2 --
 app/gui/gui-vtable.c                 | 17 -----------------
 app/plug-in/gimpplugin.c             |  2 --
 app/plug-in/gimppluginmanager-call.c |  4 ----
 7 files changed, 1 insertion(+), 56 deletions(-)
---
diff --git a/app/app.c b/app/app.c
index 8d1a52d8cd..747a12e8d9 100644
--- a/app/app.c
+++ b/app/app.c
@@ -431,11 +431,7 @@ app_run (const gchar         *full_prog_name,
     gimp_batch_run (gimp, batch_interpreter, batch_commands);
 
   if (run_loop)
-    {
-      gimp_threads_leave (gimp);
-      g_main_loop_run (loop);
-      gimp_threads_enter (gimp);
-    }
+    g_main_loop_run (loop);
 
   if (gimp->be_verbose)
     g_print ("EXIT: %s\n", G_STRFUNC);
diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c
index baf73016e2..a148efb6da 100644
--- a/app/core/gimp-gui.c
+++ b/app/core/gimp-gui.c
@@ -43,8 +43,6 @@ gimp_gui_init (Gimp *gimp)
   g_return_if_fail (GIMP_IS_GIMP (gimp));
 
   gimp->gui.ungrab                 = NULL;
-  gimp->gui.threads_enter          = NULL;
-  gimp->gui.threads_leave          = NULL;
   gimp->gui.set_busy               = NULL;
   gimp->gui.unset_busy             = NULL;
   gimp->gui.show_message           = NULL;
@@ -79,24 +77,6 @@ gimp_gui_ungrab (Gimp *gimp)
     gimp->gui.ungrab (gimp);
 }
 
-void
-gimp_threads_enter (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-
-  if (gimp->gui.threads_enter)
-    gimp->gui.threads_enter (gimp);
-}
-
-void
-gimp_threads_leave (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-
-  if (gimp->gui.threads_leave)
-    gimp->gui.threads_leave (gimp);
-}
-
 void
 gimp_set_busy (Gimp *gimp)
 {
diff --git a/app/core/gimp-gui.h b/app/core/gimp-gui.h
index 89a5970826..dc4552fe98 100644
--- a/app/core/gimp-gui.h
+++ b/app/core/gimp-gui.h
@@ -25,9 +25,6 @@ struct _GimpGui
 {
   void           (* ungrab)                 (Gimp                *gimp);
 
-  void           (* threads_enter)          (Gimp                *gimp);
-  void           (* threads_leave)          (Gimp                *gimp);
-
   void           (* set_busy)               (Gimp                *gimp);
   void           (* unset_busy)             (Gimp                *gimp);
 
@@ -116,9 +113,6 @@ void           gimp_gui_init               (Gimp                *gimp);
 
 void           gimp_gui_ungrab             (Gimp                *gimp);
 
-void           gimp_threads_enter          (Gimp                *gimp);
-void           gimp_threads_leave          (Gimp                *gimp);
-
 GimpObject   * gimp_get_window_strategy    (Gimp                *gimp);
 GimpObject   * gimp_get_empty_display      (Gimp                *gimp);
 GimpObject   * gimp_get_display_by_ID      (Gimp                *gimp,
diff --git a/app/gimpcore.def b/app/gimpcore.def
index 4459c83d76..1ef571bf72 100644
--- a/app/gimpcore.def
+++ b/app/gimpcore.def
@@ -560,8 +560,6 @@ EXPORTS
        gimp_text_layer_set
        gimp_text_undo_get_type
        gimp_text_vectors_new
-       gimp_threads_enter
-       gimp_threads_leave
        gimp_tool_info_get_standard
        gimp_tool_info_get_type
        gimp_tool_info_new
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index f7e0a7adf3..f8a3374632 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -112,9 +112,6 @@
 
 static void           gui_ungrab                 (Gimp                *gimp);
 
-static void           gui_threads_enter          (Gimp                *gimp);
-static void           gui_threads_leave          (Gimp                *gimp);
-
 static void           gui_set_busy               (Gimp                *gimp);
 static void           gui_unset_busy             (Gimp                *gimp);
 
@@ -195,8 +192,6 @@ gui_vtable_init (Gimp *gimp)
   g_return_if_fail (GIMP_IS_GIMP (gimp));
 
   gimp->gui.ungrab                 = gui_ungrab;
-  gimp->gui.threads_enter          = gui_threads_enter;
-  gimp->gui.threads_leave          = gui_threads_leave;
   gimp->gui.set_busy               = gui_set_busy;
   gimp->gui.unset_busy             = gui_unset_busy;
   gimp->gui.show_message           = gui_message;
@@ -238,18 +233,6 @@ gui_ungrab (Gimp *gimp)
     gdk_seat_ungrab (gdk_display_get_default_seat (display));
 }
 
-static void
-gui_threads_enter (Gimp *gimp)
-{
-  GDK_THREADS_ENTER ();
-}
-
-static void
-gui_threads_leave (Gimp *gimp)
-{
-  GDK_THREADS_LEAVE ();
-}
-
 static void
 gui_set_busy (Gimp *gimp)
 {
diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c
index 55fee9fd0f..46b2e66bcf 100644
--- a/app/plug-in/gimpplugin.c
+++ b/app/plug-in/gimpplugin.c
@@ -839,9 +839,7 @@ gimp_plug_in_main_loop (GimpPlugIn *plug_in)
 
   proc_frame->main_loop = g_main_loop_new (NULL, FALSE);
 
-  gimp_threads_leave (plug_in->manager->gimp);
   g_main_loop_run (proc_frame->main_loop);
-  gimp_threads_enter (plug_in->manager->gimp);
 
   g_clear_pointer (&proc_frame->main_loop, g_main_loop_unref);
 }
diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c
index f76e269f1a..c3716521fb 100644
--- a/app/plug-in/gimppluginmanager-call.c
+++ b/app/plug-in/gimppluginmanager-call.c
@@ -264,9 +264,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
         {
           plug_in->ext_main_loop = g_main_loop_new (NULL, FALSE);
 
-          gimp_threads_leave (manager->gimp);
           g_main_loop_run (plug_in->ext_main_loop);
-          gimp_threads_enter (manager->gimp);
 
           /*  main_loop is quit in gimp_plug_in_handle_extension_ack()  */
 
@@ -282,9 +280,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
 
           proc_frame->main_loop = g_main_loop_new (NULL, FALSE);
 
-          gimp_threads_leave (manager->gimp);
           g_main_loop_run (proc_frame->main_loop);
-          gimp_threads_enter (manager->gimp);
 
           /*  main_loop is quit in gimp_plug_in_handle_proc_return()  */
 


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