summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2017-10-13 19:08:46 -0500
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2017-10-20 16:10:18 +0800
commitcc772ddd61be5fcb0412f1f871e5814d841362aa (patch)
tree4d06f529cf1ea5b3cfa564be54eeeb34812597cd /src
parent4d2647cdbc6cc2b5a41eb8fcd5183a77819283dd (diff)
downloadmutter-cc772ddd61be5fcb0412f1f871e5814d841362aa.tar.gz
display: trap X errors in get_current_time_roundtrip
Only return the actual timestamp if we get one. https://bugzilla.gnome.org/show_bug.cgi?id=788971
Diffstat (limited to 'src')
-rw-r--r--src/core/display.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/display.c b/src/core/display.c
index dc4d8dfe5..6fc2ff736 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1326,14 +1326,24 @@ meta_display_get_current_time_roundtrip (MetaDisplay *display)
{
XEvent property_event;
+ meta_error_trap_push (display);
+
XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
display->atom__MUTTER_TIMESTAMP_PING,
XA_STRING, 8, PropModeAppend, NULL, 0);
- XIfEvent (display->xdisplay,
- &property_event,
- find_timestamp_predicate,
- (XPointer) display);
- timestamp = property_event.xproperty.time;
+
+ if (meta_error_trap_pop_with_return (display) == Success)
+ {
+ meta_error_trap_push (display);
+
+ XIfEvent (display->xdisplay,
+ &property_event,
+ find_timestamp_predicate,
+ (XPointer) display);
+
+ if (meta_error_trap_pop_with_return (display) == Success)
+ timestamp = property_event.xproperty.time;
+ }
}
meta_display_sanity_check_timestamps (display, timestamp);