1383
1383
gtk_window_iconify (window);
1386
/* Code from Thomas Thurman
1387
* http://people.collabora.co.uk/~tthurman/pingwindow.c.txt
1390
get_server_time (void)
1393
Window pingingWindow;
1394
XEvent propertyEvent;
1395
XSetWindowAttributes attrs;
1397
display = XOpenDisplay (NULL);
1399
attrs.override_redirect = True;
1400
attrs.event_mask = PropertyChangeMask;
1402
pingingWindow = XCreateWindow (display,
1403
XRootWindow (display, 0), /* parent */
1404
-100, -100, 1, 1, /* off-screen */
1408
(Visual *) CopyFromParent,
1409
CWOverrideRedirect | CWEventMask,
1412
/* Change a property. XA_PRIMARY is never really
1413
* used for properties, so it's safe.
1415
XChangeProperty (display,
1417
XA_PRIMARY, XA_STRING, 8,
1418
PropModeAppend, NULL, 0);
1420
/* Pick up the event. */
1421
XWindowEvent (display,
1426
/* If you want to do this often,
1427
* just keep the window around and
1430
XDestroyWindow (display, pingingWindow);
1432
return ((XPropertyEvent *) &propertyEvent)->time;
1386
1435
/* Takes care of moving the window to the current workspace. */
1388
1437
empathy_window_present (GtkWindow *window)
1413
1462
timestamp = gtk_get_current_event_time ();
1414
1463
if (timestamp == 0)
1415
/* No event, fallback to _NET_WM_USER_TIME */
1416
timestamp = gdk_x11_display_get_user_time (gdk_display_get_default ());
1464
/* No event, fallback to X server time */
1465
timestamp = get_server_time ();
1418
1467
gtk_window_present_with_time (window, timestamp);
1419
1468
gtk_window_set_skip_taskbar_hint (window, FALSE);