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
This commit is contained in:
Marco Trevisan (Treviño) 2017-10-13 19:08:46 -05:00
parent 4d2647cdbc
commit cc772ddd61

View File

@ -1326,15 +1326,25 @@ meta_display_get_current_time_roundtrip (MetaDisplay *display)
{ {
XEvent property_event; XEvent property_event;
meta_error_trap_push (display);
XChangeProperty (display->xdisplay, display->timestamp_pinging_window, XChangeProperty (display->xdisplay, display->timestamp_pinging_window,
display->atom__MUTTER_TIMESTAMP_PING, display->atom__MUTTER_TIMESTAMP_PING,
XA_STRING, 8, PropModeAppend, NULL, 0); XA_STRING, 8, PropModeAppend, NULL, 0);
if (meta_error_trap_pop_with_return (display) == Success)
{
meta_error_trap_push (display);
XIfEvent (display->xdisplay, XIfEvent (display->xdisplay,
&property_event, &property_event,
find_timestamp_predicate, find_timestamp_predicate,
(XPointer) display); (XPointer) display);
if (meta_error_trap_pop_with_return (display) == Success)
timestamp = property_event.xproperty.time; timestamp = property_event.xproperty.time;
} }
}
meta_display_sanity_check_timestamps (display, timestamp); meta_display_sanity_check_timestamps (display, timestamp);