[gtk+] gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
- Date: Mon, 30 Jul 2012 16:01:47 +0000 (UTC)
commit 144a5687c9c5eae603ce7a105812daffed862fc1
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 28 14:40:04 2012 +0200
gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step.
gdk/broadway/gdkeventsource.c | 12 ++++++------
gdk/gdk.c | 6 ++++--
gdk/quartz/gdkeventloop-quartz.c | 12 ++++++------
gdk/quartz/gdkevents-quartz.c | 4 ++--
gdk/wayland/gdkeventsource.c | 4 ++--
gdk/win32/gdkevents-win32.c | 12 ++++++------
gdk/x11/gdkdisplay-x11.c | 4 ++--
gdk/x11/gdkeventsource.c | 12 ++++++------
8 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c
index 49a8882..14fa479 100644
--- a/gdk/broadway/gdkeventsource.c
+++ b/gdk/broadway/gdkeventsource.c
@@ -58,12 +58,12 @@ gdk_event_source_prepare (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -74,14 +74,14 @@ gdk_event_source_check (GSource *source)
GdkEventSource *event_source = (GdkEventSource*) source;
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL);
else
retval = FALSE;
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -353,7 +353,7 @@ gdk_event_source_dispatch (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
GdkEvent *event;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
event = gdk_display_get_event (display);
@@ -364,7 +364,7 @@ gdk_event_source_dispatch (GSource *source,
gdk_event_free (event);
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
diff --git a/gdk/gdk.c b/gdk/gdk.c
index d1688a8..3c8c711 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -24,6 +24,8 @@
#include "config.h"
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
+
#include "gdkmain.h"
#include "gdkinternals.h"
@@ -757,12 +759,12 @@ gdk_threads_dispatch (gpointer data)
GdkThreadsDispatch *dispatch = data;
gboolean ret = FALSE;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
if (!g_source_is_destroyed (g_main_current_source ()))
ret = dispatch->func (dispatch->data);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return ret;
}
diff --git a/gdk/quartz/gdkeventloop-quartz.c b/gdk/quartz/gdkeventloop-quartz.c
index 4181a5d..4045234 100644
--- a/gdk/quartz/gdkeventloop-quartz.c
+++ b/gdk/quartz/gdkeventloop-quartz.c
@@ -616,14 +616,14 @@ gdk_event_prepare (GSource *source,
{
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -633,7 +633,7 @@ gdk_event_check (GSource *source)
{
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
/* Refresh the autorelease pool if we're at the base CFRunLoop level
* (indicated by current_loop_level) and the base g_main_loop level
@@ -653,7 +653,7 @@ gdk_event_check (GSource *source)
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -665,7 +665,7 @@ gdk_event_dispatch (GSource *source,
{
GdkEvent *event;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
_gdk_quartz_display_queue_events (_gdk_display);
@@ -678,7 +678,7 @@ gdk_event_dispatch (GSource *source,
gdk_event_free (event);
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index ac60e33..4921fcd 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -1478,9 +1478,9 @@ _gdk_quartz_display_queue_events (GdkDisplay *display)
g_list_free_1 (node);
gdk_event_free (event);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
[NSApp sendEvent:nsevent];
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
}
_gdk_quartz_event_loop_release_event (nsevent);
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index badbaaa..f86a580 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -68,7 +68,7 @@ gdk_event_source_dispatch(GSource *base,
GdkDisplay *display = source->display;
GdkEvent *event;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
event = gdk_display_get_event (display);
@@ -79,7 +79,7 @@ gdk_event_source_dispatch(GSource *base,
gdk_event_free (event);
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 2bc7c12..962daf2 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -3326,7 +3326,7 @@ gdk_event_prepare (GSource *source,
{
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
*timeout = -1;
@@ -3334,7 +3334,7 @@ gdk_event_prepare (GSource *source,
(modal_win32_dialog == NULL &&
GetQueueStatus (QS_ALLINPUT) != 0));
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -3344,7 +3344,7 @@ gdk_event_check (GSource *source)
{
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
if (event_poll_fd.revents & G_IO_IN)
{
@@ -3357,7 +3357,7 @@ gdk_event_check (GSource *source)
retval = FALSE;
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -3369,7 +3369,7 @@ gdk_event_dispatch (GSource *source,
{
GdkEvent *event;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
_gdk_win32_display_queue_events (_gdk_display);
event = _gdk_event_unqueue (_gdk_display);
@@ -3389,7 +3389,7 @@ gdk_event_dispatch (GSource *source,
}
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 3ef8fa0..0f8b35f 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1483,11 +1483,11 @@ process_internal_connection (GIOChannel *gioc,
{
GdkInternalConnection *connection = (GdkInternalConnection *)data;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
XProcessInternalConnection ((Display*)connection->display, connection->fd);
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 615ff9a..6b82611 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -273,13 +273,13 @@ gdk_event_source_prepare (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL ||
gdk_check_xpending (display));
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -290,7 +290,7 @@ gdk_event_source_check (GSource *source)
GdkEventSource *event_source = (GdkEventSource*) source;
gboolean retval;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL ||
@@ -298,7 +298,7 @@ gdk_event_source_check (GSource *source)
else
retval = FALSE;
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return retval;
}
@@ -349,7 +349,7 @@ gdk_event_source_dispatch (GSource *source,
GdkDisplay *display = ((GdkEventSource*) source)->display;
GdkEvent *event;
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
event = gdk_display_get_event (display);
@@ -360,7 +360,7 @@ gdk_event_source_dispatch (GSource *source,
gdk_event_free (event);
}
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]