Prevent access to sys menu in single app mode

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@330 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2003-02-18 13:44:27 +00:00
parent d384c1b539
commit 410c48cf5b
2 changed files with 16 additions and 3 deletions

View File

@ -20,7 +20,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define XK_MISCELLANY #define XK_MISCELLANY
#include <X11/keysymdef.h> #include <X11/keysym.h>
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <time.h> #include <time.h>
@ -34,6 +34,7 @@
extern Display *display; extern Display *display;
extern char keymapname[16]; extern char keymapname[16];
extern int keylayout; extern int keylayout;
extern int win_button_size;
extern BOOL enable_compose; extern BOOL enable_compose;
static BOOL keymap_loaded; 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); rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL);
} }
return True; 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; return False;
} }

9
xwin.c
View File

@ -858,9 +858,14 @@ xwin_process_events(void)
/* If win_button_size is nonzero, enable single app mode */ /* If win_button_size is nonzero, enable single app mode */
if (xevent.xbutton.y < win_button_size) 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) else if (xevent.xbutton.x >= width - win_button_size * 2)