55 |
Window wnd; |
Window wnd; |
56 |
unsigned long id; |
unsigned long id; |
57 |
unsigned long parent; |
unsigned long parent; |
58 |
|
unsigned long behind; |
59 |
int xoffset, yoffset; |
int xoffset, yoffset; |
60 |
int width, height; |
int width, height; |
61 |
int state; /* normal/minimized/maximized. */ |
int state; /* normal/minimized/maximized. */ |
63 |
struct _seamless_window *next; |
struct _seamless_window *next; |
64 |
} seamless_window; |
} seamless_window; |
65 |
static seamless_window *g_seamless_windows = NULL; |
static seamless_window *g_seamless_windows = NULL; |
66 |
|
static unsigned long g_seamless_focused = 0; |
67 |
static BOOL g_seamless_started = False; /* Server end is up and running */ |
static BOOL g_seamless_started = False; /* Server end is up and running */ |
68 |
static BOOL g_seamless_active = False; /* We are currently in seamless mode */ |
static BOOL g_seamless_active = False; /* We are currently in seamless mode */ |
69 |
extern BOOL g_seamless_rdp; |
extern BOOL g_seamless_rdp; |
326 |
|
|
327 |
|
|
328 |
static void |
static void |
329 |
|
seamless_restack_window(seamless_window * sw, unsigned long behind) |
330 |
|
{ |
331 |
|
seamless_window *sw_above; |
332 |
|
|
333 |
|
/* Remove window from stack */ |
334 |
|
for (sw_above = g_seamless_windows; sw_above; sw_above = sw_above->next) |
335 |
|
{ |
336 |
|
if (sw_above->behind == sw->id) |
337 |
|
break; |
338 |
|
} |
339 |
|
|
340 |
|
if (sw_above) |
341 |
|
sw_above->behind = sw->behind; |
342 |
|
|
343 |
|
/* And then add it at the new position */ |
344 |
|
|
345 |
|
for (sw_above = g_seamless_windows; sw_above; sw_above = sw_above->next) |
346 |
|
{ |
347 |
|
if (sw_above->behind == behind) |
348 |
|
break; |
349 |
|
} |
350 |
|
|
351 |
|
if (sw_above) |
352 |
|
sw_above->behind = sw->id; |
353 |
|
|
354 |
|
sw->behind = behind; |
355 |
|
} |
356 |
|
|
357 |
|
|
358 |
|
static void |
359 |
mwm_hide_decorations(Window wnd) |
mwm_hide_decorations(Window wnd) |
360 |
{ |
{ |
361 |
PropMotifWmHints motif_hints; |
PropMotifWmHints motif_hints; |
1806 |
break; |
break; |
1807 |
} |
} |
1808 |
|
|
1809 |
|
if (!sw_below && !sw->behind) |
1810 |
|
return; |
1811 |
|
if (sw_below && (sw_below->id == sw->behind)) |
1812 |
|
return; |
1813 |
|
|
1814 |
if (sw_below) |
if (sw_below) |
1815 |
|
{ |
1816 |
seamless_send_zchange(sw->id, sw_below->id, 0); |
seamless_send_zchange(sw->id, sw_below->id, 0); |
1817 |
|
seamless_restack_window(sw, sw_below->id); |
1818 |
|
} |
1819 |
else |
else |
1820 |
|
{ |
1821 |
seamless_send_zchange(sw->id, 0, 0); |
seamless_send_zchange(sw->id, 0, 0); |
1822 |
|
seamless_restack_window(sw, 0); |
1823 |
|
} |
1824 |
} |
} |
1825 |
|
|
1826 |
/* Process events in Xlib queue |
/* Process events in Xlib queue |
1960 |
if (!sw) |
if (!sw) |
1961 |
break; |
break; |
1962 |
|
|
1963 |
seamless_send_focus(sw->id, 0); |
if (sw->id != g_seamless_focused) |
1964 |
|
{ |
1965 |
|
seamless_send_focus(sw->id, 0); |
1966 |
|
g_seamless_focused = sw->id; |
1967 |
|
} |
1968 |
break; |
break; |
1969 |
|
|
1970 |
case FocusOut: |
case FocusOut: |
3220 |
sw->wnd = wnd; |
sw->wnd = wnd; |
3221 |
sw->id = id; |
sw->id = id; |
3222 |
sw->parent = parent; |
sw->parent = parent; |
3223 |
|
sw->behind = 0; |
3224 |
sw->xoffset = 0; |
sw->xoffset = 0; |
3225 |
sw->yoffset = 0; |
sw->yoffset = 0; |
3226 |
sw->width = 0; |
sw->width = 0; |
3332 |
{ |
{ |
3333 |
XRaiseWindow(g_display, sw->wnd); |
XRaiseWindow(g_display, sw->wnd); |
3334 |
} |
} |
3335 |
|
|
3336 |
|
seamless_restack_window(sw, behind); |
3337 |
} |
} |
3338 |
|
|
3339 |
void |
void |