62 |
struct _seamless_window *next; |
struct _seamless_window *next; |
63 |
} seamless_window; |
} seamless_window; |
64 |
static seamless_window *g_seamless_windows = NULL; |
static seamless_window *g_seamless_windows = NULL; |
65 |
|
static BOOL g_seamless_started = False; /* Server end is up and running */ |
66 |
|
static BOOL g_seamless_active = False; /* We are currently in seamless mode */ |
67 |
extern BOOL g_seamless_rdp; |
extern BOOL g_seamless_rdp; |
68 |
|
|
69 |
extern uint32 g_embed_wnd; |
extern uint32 g_embed_wnd; |
1567 |
} |
} |
1568 |
|
|
1569 |
XSelectInput(g_display, g_wnd, input_mask); |
XSelectInput(g_display, g_wnd, input_mask); |
1570 |
if (!g_seamless_rdp) |
|
1571 |
|
XMapWindow(g_display, g_wnd); |
1572 |
|
/* wait for VisibilityNotify */ |
1573 |
|
do |
1574 |
{ |
{ |
1575 |
XMapWindow(g_display, g_wnd); |
XMaskEvent(g_display, VisibilityChangeMask, &xevent); |
|
/* wait for VisibilityNotify */ |
|
|
do |
|
|
{ |
|
|
XMaskEvent(g_display, VisibilityChangeMask, &xevent); |
|
|
} |
|
|
while (xevent.type != VisibilityNotify); |
|
|
g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured; |
|
1576 |
} |
} |
1577 |
|
while (xevent.type != VisibilityNotify); |
1578 |
|
g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured; |
1579 |
|
|
1580 |
g_focused = False; |
g_focused = False; |
1581 |
g_mouse_in_wnd = False; |
g_mouse_in_wnd = False; |
1639 |
{ |
{ |
1640 |
Pixmap contents = 0; |
Pixmap contents = 0; |
1641 |
|
|
1642 |
if (g_seamless_rdp) |
if (g_seamless_active) |
1643 |
/* Turn off SeamlessRDP mode */ |
/* Turn off SeamlessRDP mode */ |
1644 |
ui_seamless_toggle(); |
ui_seamless_toggle(); |
1645 |
|
|
1988 |
|
|
1989 |
break; |
break; |
1990 |
case MapNotify: |
case MapNotify: |
1991 |
if (!g_seamless_rdp) |
if (!g_seamless_active) |
1992 |
rdp_send_client_window_status(1); |
rdp_send_client_window_status(1); |
1993 |
break; |
break; |
1994 |
case UnmapNotify: |
case UnmapNotify: |
1995 |
if (!g_seamless_rdp) |
if (!g_seamless_active) |
1996 |
rdp_send_client_window_status(0); |
rdp_send_client_window_status(0); |
1997 |
break; |
break; |
1998 |
} |
} |
3006 |
} |
} |
3007 |
|
|
3008 |
void |
void |
3009 |
|
ui_seamless_begin() |
3010 |
|
{ |
3011 |
|
if (!g_seamless_rdp) |
3012 |
|
return; |
3013 |
|
|
3014 |
|
if (g_seamless_started) |
3015 |
|
return; |
3016 |
|
|
3017 |
|
g_seamless_started = True; |
3018 |
|
|
3019 |
|
ui_seamless_toggle(); |
3020 |
|
} |
3021 |
|
|
3022 |
|
void |
3023 |
ui_seamless_toggle() |
ui_seamless_toggle() |
3024 |
{ |
{ |
3025 |
if (g_seamless_rdp) |
if (!g_seamless_rdp) |
3026 |
|
return; |
3027 |
|
|
3028 |
|
if (!g_seamless_started) |
3029 |
|
return; |
3030 |
|
|
3031 |
|
if (g_seamless_active) |
3032 |
{ |
{ |
3033 |
/* Deactivate */ |
/* Deactivate */ |
3034 |
while (g_seamless_windows) |
while (g_seamless_windows) |
3041 |
else |
else |
3042 |
{ |
{ |
3043 |
/* Activate */ |
/* Activate */ |
|
if (g_win_button_size) |
|
|
{ |
|
|
error("SeamlessRDP mode cannot be activated when using single application mode\n"); |
|
|
return; |
|
|
} |
|
|
if (!g_using_full_workarea) |
|
|
{ |
|
|
error("SeamlessRDP mode requires a session that covers the whole screen"); |
|
|
return; |
|
|
} |
|
|
|
|
3044 |
XUnmapWindow(g_display, g_wnd); |
XUnmapWindow(g_display, g_wnd); |
3045 |
seamless_send_sync(); |
seamless_send_sync(); |
3046 |
} |
} |
3047 |
|
|
3048 |
g_seamless_rdp = !g_seamless_rdp; |
g_seamless_active = !g_seamless_active; |
3049 |
} |
} |
3050 |
|
|
3051 |
void |
void |
3058 |
long input_mask; |
long input_mask; |
3059 |
seamless_window *sw, *sw_parent; |
seamless_window *sw, *sw_parent; |
3060 |
|
|
3061 |
|
if (!g_seamless_active) |
3062 |
|
return; |
3063 |
|
|
3064 |
/* Ignore CREATEs for existing windows */ |
/* Ignore CREATEs for existing windows */ |
3065 |
sw = seamless_get_window_by_id(id); |
sw = seamless_get_window_by_id(id); |
3066 |
if (sw) |
if (sw) |
3140 |
{ |
{ |
3141 |
seamless_window *sw; |
seamless_window *sw; |
3142 |
|
|
3143 |
|
if (!g_seamless_active) |
3144 |
|
return; |
3145 |
|
|
3146 |
sw = seamless_get_window_by_id(id); |
sw = seamless_get_window_by_id(id); |
3147 |
if (!sw) |
if (!sw) |
3148 |
{ |
{ |
3160 |
{ |
{ |
3161 |
seamless_window *sw; |
seamless_window *sw; |
3162 |
|
|
3163 |
|
if (!g_seamless_active) |
3164 |
|
return; |
3165 |
|
|
3166 |
sw = seamless_get_window_by_id(id); |
sw = seamless_get_window_by_id(id); |
3167 |
if (!sw) |
if (!sw) |
3168 |
{ |
{ |
3204 |
{ |
{ |
3205 |
seamless_window *sw; |
seamless_window *sw; |
3206 |
|
|
3207 |
|
if (!g_seamless_active) |
3208 |
|
return; |
3209 |
|
|
3210 |
sw = seamless_get_window_by_id(id); |
sw = seamless_get_window_by_id(id); |
3211 |
if (!sw) |
if (!sw) |
3212 |
{ |
{ |
3225 |
{ |
{ |
3226 |
seamless_window *sw; |
seamless_window *sw; |
3227 |
|
|
3228 |
|
if (!g_seamless_active) |
3229 |
|
return; |
3230 |
|
|
3231 |
sw = seamless_get_window_by_id(id); |
sw = seamless_get_window_by_id(id); |
3232 |
if (!sw) |
if (!sw) |
3233 |
{ |
{ |
3277 |
void |
void |
3278 |
ui_seamless_syncbegin(unsigned long flags) |
ui_seamless_syncbegin(unsigned long flags) |
3279 |
{ |
{ |
3280 |
|
if (!g_seamless_active) |
3281 |
|
return; |
3282 |
|
|
3283 |
/* Destroy all seamless windows */ |
/* Destroy all seamless windows */ |
3284 |
while (g_seamless_windows) |
while (g_seamless_windows) |
3285 |
{ |
{ |