]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdk.c
Add GDK_DEBUG=frames
[~andy/gtk] / gdk / gdk.c
index 3c8c71153b485a12f3bf755effc1f66d9ff8722b..babe08028d6b3a108105546642349d3bb65073a9 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -138,7 +138,8 @@ static const GDebugKey gdk_debug_keys[] = {
   {"multihead",     GDK_DEBUG_MULTIHEAD},
   {"xinerama",      GDK_DEBUG_XINERAMA},
   {"draw",          GDK_DEBUG_DRAW},
-  {"eventloop",     GDK_DEBUG_EVENTLOOP}
+  {"eventloop",     GDK_DEBUG_EVENTLOOP},
+  {"frames",        GDK_DEBUG_FRAMES}
 };
 
 static gboolean
@@ -274,8 +275,6 @@ gdk_pre_parse_libgtk_only (void)
         _gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
     }
 
-  g_type_init ();
-
   /* Do any setup particular to the windowing system */
   gdk_display_manager_get ();
 }
@@ -448,10 +447,6 @@ gdk_init (int *argc, char ***argv)
  * which protects all use of GTK+. That is, only one thread can use GTK+
  * at any given time.
  *
- * Unfortunately the above holds with the X11 backend only. With the
- * Win32 backend, GDK calls should not be attempted from multiple threads
- * at all.
- *
  * You must call gdk_threads_init() before executing any other GTK+ or
  * GDK functions in a threaded GTK+ program.
  *
@@ -653,6 +648,21 @@ gdk_init (int *argc, char ***argv)
  * }
  * </programlisting>
  * </informalexample>
+ *
+ * Unfortunately, all of the above documentation holds with the X11
+ * backend only. With the Win32 backend, GDK and GTK+ calls should not
+ * be attempted from multiple threads at all. Combining the GDK lock
+ * with other locks such as the Python global interpreter lock can be
+ * complicated.
+ *
+ * For these reason, the threading support has been deprecated in
+ * GTK+ 3.6. Instead of calling GTK+ directly from multiple threads,
+ * it is recommended to use g_idle_add(), g_main_context_invoke()
+ * and similar functions to make these calls from the main thread
+ * instead. The main thread is the thread which has called gtk_init()
+ * and is running the GTK+ mainloop. GTK+ itself will continue to
+ * use the GDK lock internally as long as the deprecated functionality
+ * is still available, and other libraries should probably do the same.
  */
 
 
@@ -663,6 +673,9 @@ gdk_init (int *argc, char ***argv)
  * GDK and GTK+ functions can be called safely and without causing race
  * conditions. Only one thread at a time can be in such a critial
  * section.
+ *
+ * Deprecated:3.6: All GDK and GTK+ calls should be made from the main
+ *     thread
  */
 void
 gdk_threads_enter (void)
@@ -675,6 +688,9 @@ gdk_threads_enter (void)
  * gdk_threads_leave:
  *
  * Leaves a critical region begun with gdk_threads_enter().
+ *
+ * Deprecated:3.6: All GDK and GTK+ calls should be made from the main
+ *     thread
  */
 void
 gdk_threads_leave (void)
@@ -703,6 +719,9 @@ gdk_threads_impl_unlock (void)
  *
  * This call must be made before any use of the main loop from
  * GTK+; to be safe, call it before gtk_init().
+ *
+ * Deprecated:3.6: All GDK and GTK+ calls should be made from the main
+ *     thread
  */
 void
 gdk_threads_init (void)
@@ -740,6 +759,9 @@ gdk_threads_init (void)
  * This method must be called before gdk_threads_init(), and cannot
  * be called multiple times.
  *
+ * Deprecated:3.6: All GDK and GTK+ calls should be made from the main
+ *     thread
+ *
  * Since: 2.4
  **/
 void