xfreerdp: apply patch from zstegi (would grab window manager key combinations)

This commit is contained in:
Marc-André Moreau
2011-10-04 18:46:49 -04:00
parent cdad8ff697
commit 07077e2d3d
6 changed files with 13 additions and 2 deletions

View File

@@ -229,8 +229,10 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height)
input_mask =
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
VisibilityChangeMask | FocusChangeMask | StructureNotifyMask |
PointerMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask |
PropertyChangeMask;
PointerMotionMask | ExposureMask | PropertyChangeMask;
if (xfi->grab_keyboard)
input_mask |= EnterWindowMask | LeaveWindowMask;
XSelectInput(xfi->display, window->handle, input_mask);
XMapWindow(xfi->display, window->handle);

View File

@@ -535,6 +535,7 @@ boolean xf_pre_connect(freerdp* instance)
xfi->decoration = settings->decorations;
xfi->remote_app = settings->remote_app;
xfi->fullscreen = settings->fullscreen;
xfi->grab_keyboard = settings->grab_keyboard;
xfi->fullscreen_toggle = xfi->fullscreen;
xfi->sw_gdi = settings->sw_gdi;

View File

@@ -73,6 +73,7 @@ struct xf_info
int scanline_pad;
boolean big_endian;
boolean fullscreen;
boolean grab_keyboard;
boolean unobscured;
boolean decoration;
freerdp* instance;

View File

@@ -189,6 +189,7 @@ struct rdp_settings
boolean sw_gdi;
boolean workarea;
boolean fullscreen;
boolean grab_keyboard;
boolean decorations;
uint32 rdp_version;
uint16 color_depth;

View File

@@ -43,6 +43,7 @@ rdpSettings* settings_new(void* instance)
settings->height = 768;
settings->workarea = False;
settings->fullscreen = False;
settings->grab_keyboard = True;
settings->decorations = True;
settings->rdp_version = 7;
settings->color_depth = 16;

View File

@@ -67,6 +67,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
" -g: set geometry, using format WxH or X%% or 'workarea', default is 1024x768\n"
" -h: print this help\n"
" -k: set keyboard layout ID\n"
" -K: do not interfere with window manager bindings\n"
" -m: don't send mouse motion events\n"
" -n: hostname\n"
" -o: console audio\n"
@@ -216,6 +217,10 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
}
sscanf(argv[index], "%X", &(settings->kbd_layout));
}
else if (strcmp("-K", argv[index]) == 0)
{
settings->grab_keyboard = False;
}
else if (strcmp("-n", argv[index]) == 0)
{
index++;