View | Details | Raw Unified | Return to bug 13388
Collapse All | Expand All

(-)xfwm4/src/display.c (+17 lines)
Lines 178-183 Link Here
178
                          FALSE, display_info->atoms) != 0);
178
                          FALSE, display_info->atoms) != 0);
179
}
179
}
180
180
181
static void
182
myDisplayCreateTimestampWin (DisplayInfo *display_info)
183
{
184
    XSetWindowAttributes attributes;
185
186
    attributes.event_mask = PropertyChangeMask;
187
    attributes.override_redirect = TRUE;
188
    display_info->timestamp_win = 
189
        XCreateWindow (display_info->dpy, DefaultRootWindow (display_info->dpy),
190
                       -100, -100, 10, 10, 0, 0, CopyFromParent, CopyFromParent,
191
                       CWEventMask | CWOverrideRedirect, &attributes);
192
}
193
181
DisplayInfo *
194
DisplayInfo *
182
myDisplayInit (GdkDisplay *gdisplay)
195
myDisplayInit (GdkDisplay *gdisplay)
183
{
196
{
Lines 309-314 Link Here
309
    display->resize_cursor[CORNER_COUNT + SIDE_BOTTOM] =
322
    display->resize_cursor[CORNER_COUNT + SIDE_BOTTOM] =
310
        XCreateFontCursor (display->dpy, XC_bottom_side);
323
        XCreateFontCursor (display->dpy, XC_bottom_side);
311
324
325
    myDisplayCreateTimestampWin (display);
326
312
    display->xfilter = NULL;
327
    display->xfilter = NULL;
313
    display->screens = NULL;
328
    display->screens = NULL;
314
    display->clients = NULL;
329
    display->clients = NULL;
Lines 340-345 Link Here
340
    display->move_cursor = None;
355
    display->move_cursor = None;
341
    XFreeCursor (display->dpy, display->root_cursor);
356
    XFreeCursor (display->dpy, display->root_cursor);
342
    display->root_cursor = None;
357
    display->root_cursor = None;
358
    XDestroyWindow (display->dpy, display->timestamp_win);
359
    display->timestamp_win = None;
343
360
344
    if (display->hostname)
361
    if (display->hostname)
345
    {
362
    {
(-)xfwm4/src/display.h (+1 lines)
Lines 226-231 Link Here
226
    gboolean quit;
226
    gboolean quit;
227
    gboolean reload;
227
    gboolean reload;
228
228
229
    Window timestamp_win;
229
    Cursor busy_cursor;
230
    Cursor busy_cursor;
230
    Cursor move_cursor;
231
    Cursor move_cursor;
231
    Cursor root_cursor;
232
    Cursor root_cursor;
(-)xfwm4/src/client.c (-4 / +2 lines)
Lines 4868-4888 Link Here
4868
4868
4869
    if (passdata.c)
4869
    if (passdata.c)
4870
    {
4870
    {
4871
        GdkPixbuf *icon;
4872
4873
        TRACE ("entering cycle loop");
4871
        TRACE ("entering cycle loop");
4874
        passdata.wireframe = wireframeCreate (passdata.c);
4872
        passdata.wireframe = wireframeCreate (passdata.c);
4875
        icon = getAppIcon (display_info, passdata.c->window, 32, 32);
4876
        passdata.tabwin = tabwinCreate (passdata.c->screen_info->gscr, c,
4873
        passdata.tabwin = tabwinCreate (passdata.c->screen_info->gscr, c,
4877
                                        passdata.c, passdata.cycle_range,
4874
                                        passdata.c, passdata.cycle_range,
4878
                                        screen_info->params->cycle_workspaces);
4875
                                        screen_info->params->cycle_workspaces);
4879
        eventFilterPush (display_info->xfilter, clientCycleEventFilter, &passdata);
4876
        eventFilterPush (display_info->xfilter, clientCycleEventFilter, &passdata);
4880
        gtk_main ();
4877
        gtk_main ();
4881
        eventFilterPop (display_info->xfilter);
4878
        eventFilterPop (display_info->xfilter);
4882
        wireframeDelete (screen_info, passdata.wireframe);
4883
        TRACE ("leaving cycle loop");
4879
        TRACE ("leaving cycle loop");
4884
        tabwinDestroy (passdata.tabwin);
4880
        tabwinDestroy (passdata.tabwin);
4885
        g_free (passdata.tabwin);
4881
        g_free (passdata.tabwin);
4882
        wireframeDelete (screen_info, passdata.wireframe);
4883
        updateXserverTime (display_info);
4886
    }
4884
    }
4887
4885
4888
    if (passdata.c)
4886
    if (passdata.c)
(-)xfwm4/src/hints.c (-24 / +10 lines)
Lines 1167-1193 Link Here
1167
    return setXAtomManagerOwner(display_info, display_info->atoms[atom_id], root, w);
1167
    return setXAtomManagerOwner(display_info, display_info->atoms[atom_id], root, w);
1168
}
1168
}
1169
1169
1170
1170
void
1171
static Bool
1171
updateXserverTime (DisplayInfo *display_info)
1172
checkPropEvent (Display *display, XEvent *xevent, XPointer arg)
1173
{
1172
{
1174
    DisplayInfo *display_info;
1175
    ScreenInfo *screen_info;
1173
    ScreenInfo *screen_info;
1174
    char c = '\0';
1176
1175
1177
    display_info = (DisplayInfo *) arg;
1176
    g_return_if_fail (display_info);
1178
    g_return_val_if_fail (display_info, FALSE);
1179
1177
1180
    screen_info = myDisplayGetDefaultScreen (display_info);
1178
    XChangeProperty (display_info->dpy, display_info->timestamp_win,
1181
    g_return_val_if_fail (screen_info, FALSE);
1179
                     display_info->atoms[XFWM4_TIMESTAMP_PROP],
1182
1180
                     display_info->atoms[XFWM4_TIMESTAMP_PROP],
1183
    if ((xevent->type == PropertyNotify) &&
1181
                     8, PropModeReplace, (unsigned char *) &c, 1);
1184
        (xevent->xproperty.window == screen_info->xfwm4_win) &&
1185
        (xevent->xproperty.atom == display_info->atoms[XFWM4_TIMESTAMP_PROP]))
1186
    {
1187
        return TRUE;
1188
    }
1189
1190
    return FALSE;
1191
}
1182
}
1192
1183
1193
Time
1184
Time
Lines 1196-1202 Link Here
1196
    ScreenInfo *screen_info;
1187
    ScreenInfo *screen_info;
1197
    XEvent xevent;
1188
    XEvent xevent;
1198
    Time timestamp;
1189
    Time timestamp;
1199
    char c = '\0';
1200
1190
1201
    g_return_val_if_fail (display_info, (Time) CurrentTime);
1191
    g_return_val_if_fail (display_info, (Time) CurrentTime);
1202
    timestamp = myDisplayGetCurrentTime (display_info);
1192
    timestamp = myDisplayGetCurrentTime (display_info);
Lines 1206-1217 Link Here
1206
        g_return_val_if_fail (screen_info,  (Time) CurrentTime);
1196
        g_return_val_if_fail (screen_info,  (Time) CurrentTime);
1207
1197
1208
        TRACE ("getXServerTime: Using X server roundtrip");
1198
        TRACE ("getXServerTime: Using X server roundtrip");
1209
        XChangeProperty (display_info->dpy, screen_info->xfwm4_win, 
1199
        updateXserverTime (display_info);
1210
                         display_info->atoms[XFWM4_TIMESTAMP_PROP],
1200
        XWindowEvent (display_info->dpy, display_info->timestamp_win, PropertyChangeMask, &xevent);
1211
                         display_info->atoms[XFWM4_TIMESTAMP_PROP],
1212
                         8, PropModeReplace, (unsigned char *) &c, 1);
1213
        XIfEvent (display_info->dpy, &xevent, checkPropEvent, (XPointer) display_info);
1214
1215
        timestamp = (Time) myDisplayUpdateCurrentTime (display_info, &xevent);
1201
        timestamp = (Time) myDisplayUpdateCurrentTime (display_info, &xevent);
1216
    }
1202
    }
1217
1203
(-)xfwm4/src/hints.h (+1 lines)
Lines 269-274 Link Here
269
                                                                 int, 
269
                                                                 int, 
270
                                                                 Window , 
270
                                                                 Window , 
271
                                                                 Window);
271
                                                                 Window);
272
void                     updateXserverTime                      (DisplayInfo *);
272
Time                     getXServerTime                         (DisplayInfo *);
273
Time                     getXServerTime                         (DisplayInfo *);
273
274
274
#ifdef ENABLE_KDE_SYSTRAY_PROXY
275
#ifdef ENABLE_KDE_SYSTRAY_PROXY

Return to bug 13388