X11: add suppress output support.

This commit is contained in:
Vic Lee 2012-05-28 20:21:56 +08:00
parent 20fda49c4e
commit 02ce0dba3b
2 changed files with 40 additions and 16 deletions

View File

@ -515,20 +515,34 @@ static boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app) static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
{ {
RECTANGLE_16 rect;
rdpWindow* window; rdpWindow* window;
rdpUpdate* update = xfi->instance->update;
rdpRail* rail = ((rdpContext*) xfi->context)->rail; rdpRail* rail = ((rdpContext*) xfi->context)->rail;
if (app != true) if (app != true)
return true;
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
if (window != NULL)
{ {
/* local restore event */ if (xfi->suppress_output == true)
xf_rail_send_client_system_command(xfi, window->windowId, SC_RESTORE); {
xfWindow *xfw = (xfWindow*) window->extra; xfi->suppress_output = false;
xfw->is_mapped = true; rect.left = 0;
rect.top = 0;
rect.right = xfi->width;
rect.bottom = xfi->height;
update->SuppressOutput((rdpContext*) xfi->context, 1, &rect);
}
}
else
{
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
if (window != NULL)
{
/* local restore event */
xf_rail_send_client_system_command(xfi, window->windowId, SC_RESTORE);
xfWindow *xfw = (xfWindow*) window->extra;
xfw->is_mapped = true;
}
} }
return true; return true;
@ -537,19 +551,28 @@ static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
static boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app) static boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app)
{ {
rdpWindow* window; rdpWindow* window;
rdpUpdate* update = xfi->instance->update;
rdpRail* rail = ((rdpContext*) xfi->context)->rail; rdpRail* rail = ((rdpContext*) xfi->context)->rail;
xf_kbd_release_all_keypress(xfi); xf_kbd_release_all_keypress(xfi);
if (app != true) if (app != true)
return true;
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
if (window != NULL)
{ {
xfWindow *xfw = (xfWindow*) window->extra; if (xfi->suppress_output == false)
xfw->is_mapped = false; {
xfi->suppress_output = true;
update->SuppressOutput((rdpContext*) xfi->context, 0, NULL);
}
}
else
{
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
if (window != NULL)
{
xfWindow *xfw = (xfWindow*) window->extra;
xfw->is_mapped = false;
}
} }
return true; return true;

View File

@ -119,6 +119,7 @@ struct xf_info
boolean focused; boolean focused;
boolean mouse_active; boolean mouse_active;
boolean mouse_motion; boolean mouse_motion;
boolean suppress_output;
boolean fullscreen_toggle; boolean fullscreen_toggle;
uint32 keyboard_layout_id; uint32 keyboard_layout_id;
boolean pressed_keys[256]; boolean pressed_keys[256];