1744 |
} |
} |
1745 |
} |
} |
1746 |
|
|
1747 |
|
static void |
1748 |
|
ui_seamless_handle_restack(seamless_window * sw) |
1749 |
|
{ |
1750 |
|
Status status; |
1751 |
|
Window root, parent, *children; |
1752 |
|
unsigned int nchildren, i; |
1753 |
|
seamless_window *sw_below; |
1754 |
|
|
1755 |
|
status = XQueryTree(g_display, RootWindowOfScreen(g_screen), |
1756 |
|
&root, &parent, &children, &nchildren); |
1757 |
|
if (!status || !nchildren) |
1758 |
|
return; |
1759 |
|
|
1760 |
|
sw_below = NULL; |
1761 |
|
|
1762 |
|
i = 0; |
1763 |
|
while (children[i] != sw->wnd) |
1764 |
|
{ |
1765 |
|
i++; |
1766 |
|
if (i >= nchildren) |
1767 |
|
return; |
1768 |
|
} |
1769 |
|
|
1770 |
|
for (i++; i < nchildren; i++) |
1771 |
|
{ |
1772 |
|
sw_below = seamless_get_window_by_wnd(children[i]); |
1773 |
|
if (sw_below) |
1774 |
|
break; |
1775 |
|
} |
1776 |
|
|
1777 |
|
if (sw_below) |
1778 |
|
seamless_send_zchange(sw->id, sw_below->id, 0); |
1779 |
|
else |
1780 |
|
seamless_send_zchange(sw->id, 0, 0); |
1781 |
|
} |
1782 |
|
|
1783 |
/* Process events in Xlib queue |
/* Process events in Xlib queue |
1784 |
Returns 0 after user quit, 1 otherwise */ |
Returns 0 after user quit, 1 otherwise */ |
1785 |
static int |
static int |
2031 |
if (!g_seamless_active) |
if (!g_seamless_active) |
2032 |
rdp_send_client_window_status(0); |
rdp_send_client_window_status(0); |
2033 |
break; |
break; |
2034 |
|
case ConfigureNotify: |
2035 |
|
/* seamless */ |
2036 |
|
sw = seamless_get_window_by_wnd(xevent.xconfigure.window); |
2037 |
|
if (!sw) |
2038 |
|
break; |
2039 |
|
|
2040 |
|
ui_seamless_handle_restack(sw); |
2041 |
} |
} |
2042 |
} |
} |
2043 |
/* Keep going */ |
/* Keep going */ |
3241 |
XMoveResizeWindow(g_display, sw->wnd, sw->xoffset, sw->yoffset, sw->width, sw->height); |
XMoveResizeWindow(g_display, sw->wnd, sw->xoffset, sw->yoffset, sw->width, sw->height); |
3242 |
} |
} |
3243 |
|
|
3244 |
|
void |
3245 |
|
ui_seamless_restack_window(unsigned long id, unsigned long behind, unsigned long flags) |
3246 |
|
{ |
3247 |
|
seamless_window *sw; |
3248 |
|
|
3249 |
|
if (!g_seamless_active) |
3250 |
|
return; |
3251 |
|
|
3252 |
|
sw = seamless_get_window_by_id(id); |
3253 |
|
if (!sw) |
3254 |
|
{ |
3255 |
|
warning("ui_seamless_restack_window: No information for window 0x%lx\n", id); |
3256 |
|
return; |
3257 |
|
} |
3258 |
|
|
3259 |
|
if (behind) |
3260 |
|
{ |
3261 |
|
seamless_window *sw_behind; |
3262 |
|
Window wnds[2]; |
3263 |
|
|
3264 |
|
sw_behind = seamless_get_window_by_id(behind); |
3265 |
|
if (!sw_behind) |
3266 |
|
{ |
3267 |
|
warning("ui_seamless_restack_window: No information for window 0x%lx\n", |
3268 |
|
behind); |
3269 |
|
return; |
3270 |
|
} |
3271 |
|
|
3272 |
|
wnds[1] = sw_behind->wnd; |
3273 |
|
wnds[0] = sw->wnd; |
3274 |
|
|
3275 |
|
XRestackWindows(g_display, wnds, 2); |
3276 |
|
} |
3277 |
|
else |
3278 |
|
{ |
3279 |
|
XRaiseWindow(g_display, sw->wnd); |
3280 |
|
} |
3281 |
|
} |
3282 |
|
|
3283 |
void |
void |
3284 |
ui_seamless_settitle(unsigned long id, const char *title, unsigned long flags) |
ui_seamless_settitle(unsigned long id, const char *title, unsigned long flags) |