diff --git a/xkeymap.c b/xkeymap.c index 1fcb5f7..7a23854 100644 --- a/xkeymap.c +++ b/xkeymap.c @@ -20,7 +20,7 @@ #include #define XK_MISCELLANY -#include +#include #include #include #include @@ -34,6 +34,7 @@ extern Display *display; extern char keymapname[16]; extern int keylayout; +extern int win_button_size; extern BOOL enable_compose; static BOOL keymap_loaded; @@ -307,6 +308,13 @@ handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, BOOL pres rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL); } return True; + + case XK_space: + /* Prevent access to the Windows system menu in single app mode */ + if (win_button_size + && (get_key_state(state, XK_Alt_L) || get_key_state(state, XK_Alt_R))) + return True; + } return False; } diff --git a/xwin.c b/xwin.c index 58003a6..8b0d2bc 100644 --- a/xwin.c +++ b/xwin.c @@ -858,9 +858,14 @@ xwin_process_events(void) /* If win_button_size is nonzero, enable single app mode */ if (xevent.xbutton.y < win_button_size) { - if (xevent.xbutton.x >= width - win_button_size) + if (xevent.xbutton.x < win_button_size) { - /* The close button, do nothing */ + /* The system menu, do not send to server */ + break; + } + else if (xevent.xbutton.x >= width - win_button_size) + { + /* The close button, continue */ ; } else if (xevent.xbutton.x >= width - win_button_size * 2)