2028 |
/* the window manager told us to quit */ |
/* the window manager told us to quit */ |
2029 |
if ((xevent.xclient.message_type == g_protocol_atom) |
if ((xevent.xclient.message_type == g_protocol_atom) |
2030 |
&& ((Atom) xevent.xclient.data.l[0] == g_kill_atom)) |
&& ((Atom) xevent.xclient.data.l[0] == g_kill_atom)) |
2031 |
/* Quit */ |
{ |
2032 |
return 0; |
/* When killing a seamless window, close the window on the |
2033 |
|
serverside instead of terminating rdesktop */ |
2034 |
|
sw = sw_get_window_by_wnd(xevent.xclient.window); |
2035 |
|
if (!sw) |
2036 |
|
/* Otherwise, quit */ |
2037 |
|
return 0; |
2038 |
|
/* send seamless destroy process message */ |
2039 |
|
seamless_send_destroy(sw->id); |
2040 |
|
} |
2041 |
break; |
break; |
2042 |
|
|
2043 |
case KeyPress: |
case KeyPress: |
3460 |
ewmh_set_window_modal(wnd); |
ewmh_set_window_modal(wnd); |
3461 |
} |
} |
3462 |
|
|
3463 |
|
if (flags & SEAMLESSRDP_CREATE_TOPMOST) |
3464 |
|
{ |
3465 |
|
/* Make window always-on-top */ |
3466 |
|
ewmh_set_window_above(wnd); |
3467 |
|
} |
3468 |
|
|
3469 |
/* FIXME: Support for Input Context:s */ |
/* FIXME: Support for Input Context:s */ |
3470 |
|
|
3471 |
get_input_mask(&input_mask); |
get_input_mask(&input_mask); |
3473 |
|
|
3474 |
XSelectInput(g_display, wnd, input_mask); |
XSelectInput(g_display, wnd, input_mask); |
3475 |
|
|
3476 |
/* handle the WM_DELETE_WINDOW protocol. FIXME: When killing a |
/* handle the WM_DELETE_WINDOW protocol. */ |
|
seamless window, we could try to close the window on the |
|
|
serverside, instead of terminating rdesktop */ |
|
3477 |
XSetWMProtocols(g_display, wnd, &g_kill_atom, 1); |
XSetWMProtocols(g_display, wnd, &g_kill_atom, 1); |
3478 |
|
|
3479 |
sw = xmalloc(sizeof(seamless_window)); |
sw = xmalloc(sizeof(seamless_window)); |
3702 |
sw_behind = sw_get_window_by_id(behind); |
sw_behind = sw_get_window_by_id(behind); |
3703 |
if (!sw_behind) |
if (!sw_behind) |
3704 |
{ |
{ |
3705 |
warning("ui_seamless_restack_window: No information for window 0x%lx\n", |
warning("ui_seamless_restack_window: No information for behind window 0x%lx\n", behind); |
|
behind); |
|
3706 |
return; |
return; |
3707 |
} |
} |
3708 |
|
|
3709 |
wnds[1] = sw_behind->wnd; |
wnds[1] = sw->wnd; |
3710 |
wnds[0] = sw->wnd; |
wnds[0] = sw_behind->wnd; |
3711 |
|
|
3712 |
XRestackWindows(g_display, wnds, 2); |
XRestackWindows(g_display, wnds, 2); |
3713 |
} |
} |
3717 |
} |
} |
3718 |
|
|
3719 |
sw_restack_window(sw, behind); |
sw_restack_window(sw, behind); |
3720 |
|
|
3721 |
|
if (flags & SEAMLESSRDP_CREATE_TOPMOST) |
3722 |
|
{ |
3723 |
|
/* Make window always-on-top */ |
3724 |
|
ewmh_set_window_above(sw->wnd); |
3725 |
|
} |
3726 |
} |
} |
3727 |
|
|
3728 |
|
|