summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-11-04 00:56:12 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-11-04 00:56:12 +0000
commite0a4c2a1df6e4c8cba389ac77caf65180f54a01a (patch)
treea796fa5018ab907deb7598d2316408b7a9aab4ee /src
parent9feebc05c799190fa5ff699dd3f358b2d6c95eee (diff)
downloadmetacity-e0a4c2a1df6e4c8cba389ac77caf65180f54a01a.tar.gz
metacity-e0a4c2a1df6e4c8cba389ac77caf65180f54a01a.tar.bz2
remove XSync calls from here (meta_display_ungrab): remove XSync from
2002-11-03 Havoc Pennington <hp@pobox.com> * src/display.c (meta_display_grab): remove XSync calls from here (meta_display_ungrab): remove XSync from here, but put in an XFlush to be sure we get the ungrab sent. * src/util.c (meta_topic): track sync count here * src/errors.c: move sync count out of here Throughout: error spew on all XSync() calls * src/run-metacity.sh: don't set METACITY_DEBUG
Diffstat (limited to 'src')
-rw-r--r--src/display.c6
-rw-r--r--src/errors.c16
-rwxr-xr-xsrc/run-metacity.sh2
-rw-r--r--src/util.c11
-rw-r--r--src/xprops.c2
5 files changed, 21 insertions, 16 deletions
diff --git a/src/display.c b/src/display.c
index 9e3b9ed..dd4a37b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -757,10 +757,8 @@ meta_display_grab (MetaDisplay *display)
{
if (display->server_grab_count == 0)
{
- XSync (display->xdisplay, False);
XGrabServer (display->xdisplay);
}
- XSync (display->xdisplay, False);
display->server_grab_count += 1;
meta_verbose ("Grabbing display, grab count now %d\n",
display->server_grab_count);
@@ -778,10 +776,9 @@ meta_display_ungrab (MetaDisplay *display)
/* FIXME we want to purge all pending "queued" stuff
* at this point, such as window hide/show
*/
- XSync (display->xdisplay, False);
XUngrabServer (display->xdisplay);
+ XFlush (display->xdisplay);
}
- XSync (display->xdisplay, False);
meta_verbose ("Ungrabbing display, grab count now %d\n",
display->server_grab_count);
@@ -3314,6 +3311,7 @@ convert_property (MetaDisplay *display,
* can send SelectionNotify
*/
/* FIXME the error trap pop synced anyway, right? */
+ meta_topic (META_DEBUG_SYNC, "Syncing on %s\n", __FUNCTION__);
XSync (display->xdisplay, False);
return TRUE;
diff --git a/src/errors.c b/src/errors.c
index d558de0..10ee156 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -26,8 +26,6 @@
#include <stdlib.h>
#include <gdk/gdk.h>
-static int sync_count = 0;
-
static int x_error_handler (Display *display,
XErrorEvent *error);
static int x_io_error_handler (Display *display);
@@ -50,7 +48,6 @@ meta_error_trap_push_internal (MetaDisplay *display,
if (need_sync)
{
XSync (display->xdisplay, False);
- ++sync_count;
}
gdk_error_trap_push ();
@@ -84,7 +81,6 @@ meta_error_trap_pop_internal (MetaDisplay *display,
if (need_sync)
{
XSync (display->xdisplay, False);
- ++sync_count;
}
result = gdk_error_trap_pop ();
@@ -128,8 +124,8 @@ meta_error_trap_pop (MetaDisplay *display,
need_sync = (display->error_traps == 1 && !last_request_was_roundtrip);
if (need_sync)
- meta_topic (META_DEBUG_SYNC, "%d: Syncing on error_trap_pop, traps = %d, roundtrip = %d\n",
- sync_count, display->error_traps, last_request_was_roundtrip);
+ meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_pop, traps = %d, roundtrip = %d\n",
+ display->error_traps, last_request_was_roundtrip);
display->error_trap_synced_at_last_pop = need_sync || last_request_was_roundtrip;
@@ -156,8 +152,8 @@ meta_error_trap_push_with_return (MetaDisplay *display)
need_sync = FALSE;
if (need_sync)
- meta_topic (META_DEBUG_SYNC, "%d: Syncing on error_trap_push_with_return, traps = %d\n",
- sync_count, display->error_traps);
+ meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_push_with_return, traps = %d\n",
+ display->error_traps);
meta_error_trap_push_internal (display, FALSE);
}
@@ -167,8 +163,8 @@ meta_error_trap_pop_with_return (MetaDisplay *display,
gboolean last_request_was_roundtrip)
{
if (!last_request_was_roundtrip)
- meta_topic (META_DEBUG_SYNC, "%d: Syncing on error_trap_pop_with_return, traps = %d, roundtrip = %d\n",
- sync_count, display->error_traps, last_request_was_roundtrip);
+ meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_pop_with_return, traps = %d, roundtrip = %d\n",
+ display->error_traps, last_request_was_roundtrip);
display->error_trap_synced_at_last_pop = TRUE;
diff --git a/src/run-metacity.sh b/src/run-metacity.sh
index 8c86111..e46dae1 100755
--- a/src/run-metacity.sh
+++ b/src/run-metacity.sh
@@ -89,5 +89,5 @@ if test -z "$ONLY_WM"; then
fi
if test -z "$ONLY_SETUP"; then
- METACITY_VERBOSE=1 METACITY_DEBUG=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 METACITY_DISPLAY=$CLIENT_DISPLAY exec $DEBUG ./metacity $OPTIONS
+ METACITY_VERBOSE=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 METACITY_DISPLAY=$CLIENT_DISPLAY exec $DEBUG ./metacity $OPTIONS
fi
diff --git a/src/util.c b/src/util.c
index 5d9c68a..8d5a57e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -267,6 +267,8 @@ topic_name (MetaDebugTopic topic)
return "Window manager";
}
+static int sync_count = 0;
+
void
meta_topic (MetaDebugTopic topic,
const char *format,
@@ -281,7 +283,7 @@ meta_topic (MetaDebugTopic topic,
if (!is_verbose)
return;
- va_start (args, format);
+ va_start (args, format);
str = g_strdup_vprintf (format, args);
va_end (args);
@@ -289,6 +291,13 @@ meta_topic (MetaDebugTopic topic,
if (no_prefix == 0)
fprintf (out, "%s: ", topic_name (topic));
+
+ if (topic == META_DEBUG_SYNC)
+ {
+ ++sync_count;
+ fprintf (out, "%d: ", sync_count);
+ }
+
utf8_fputs (str, out);
fflush (out);
diff --git a/src/xprops.c b/src/xprops.c
index af8facc..cacf91f 100644
--- a/src/xprops.c
+++ b/src/xprops.c
@@ -919,6 +919,8 @@ meta_prop_get_values (MetaDisplay *display,
}
/* Get replies for all our tasks */
+ meta_topic (META_DEBUG_SYNC, "Syncing to get %d GetProperty replies in %s\n",
+ n_values, __FUNCTION__);
XSync (display->xdisplay, False);
/* Collect results, should arrive in order requested */