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,12 +515,25 @@ static boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
{
RECTANGLE_16 rect;
rdpWindow* window;
rdpUpdate* update = xfi->instance->update;
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
if (app != true)
return true;
{
if (xfi->suppress_output == true)
{
xfi->suppress_output = false;
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)
@ -530,6 +543,7 @@ static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
xfWindow *xfw = (xfWindow*) window->extra;
xfw->is_mapped = true;
}
}
return true;
}
@ -537,13 +551,21 @@ static boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
static boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app)
{
rdpWindow* window;
rdpUpdate* update = xfi->instance->update;
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
xf_kbd_release_all_keypress(xfi);
if (app != true)
return true;
{
if (xfi->suppress_output == 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)
@ -551,6 +573,7 @@ static boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app)
xfWindow *xfw = (xfWindow*) window->extra;
xfw->is_mapped = false;
}
}
return true;
}

View File

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