mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-19 08:51:59 +00:00
so that's why you would want to use XMaskEvent... don't lose the FocusIn
and EnterNotify events when starting fullscreened
This commit is contained in:
parent
482daf4fa8
commit
0b808b0c49
3 changed files with 14 additions and 14 deletions
|
@ -36,6 +36,16 @@
|
|||
|
||||
#include <QF/qtypes.h>
|
||||
|
||||
|
||||
#define X11_WINDOW_MASK (VisibilityChangeMask | StructureNotifyMask \
|
||||
| ExposureMask)
|
||||
#define X11_KEY_MASK (KeyPressMask | KeyReleaseMask)
|
||||
#define X11_MOUSE_MASK (ButtonPressMask | ButtonReleaseMask \
|
||||
| PointerMotionMask)
|
||||
#define X11_FOCUS_MASK (FocusChangeMask | EnterWindowMask)
|
||||
#define X11_INPUT_MASK (X11_KEY_MASK | X11_MOUSE_MASK | X11_FOCUS_MASK)
|
||||
#define X11_MASK (X11_WINDOW_MASK | X11_FOCUS_MASK)
|
||||
|
||||
extern Display *x_disp;
|
||||
extern Visual *x_vis;
|
||||
extern Window x_root;
|
||||
|
|
|
@ -92,8 +92,6 @@ Time x_time;
|
|||
|
||||
qboolean x_have_focus = false;
|
||||
|
||||
#define X_MASK (VisibilityChangeMask | StructureNotifyMask | ExposureMask | FocusChangeMask | EnterWindowMask)
|
||||
|
||||
#ifdef HAVE_VIDMODE
|
||||
static XF86VidModeModeInfo **vidmodes;
|
||||
static int nummodes;
|
||||
|
@ -130,7 +128,6 @@ configure_notify (XEvent *event)
|
|||
c->override_redirect);
|
||||
}
|
||||
|
||||
|
||||
qboolean
|
||||
X11_AddEvent (int event, void (*event_handler) (XEvent *))
|
||||
{
|
||||
|
@ -178,8 +175,7 @@ X11_WaitForEvent (int event)
|
|||
int type;
|
||||
|
||||
while (1) {
|
||||
//XMaskEvent (x_disp, StructureNotifyMask, &ev);
|
||||
XNextEvent (x_disp, &ev);
|
||||
XMaskEvent (x_disp, X11_WINDOW_MASK, &ev);
|
||||
type = ev.type;
|
||||
X11_ProcessEventProxy (&ev);
|
||||
if (type == event)
|
||||
|
@ -481,7 +477,7 @@ X11_CreateWindow (int width, int height)
|
|||
attr.background_pixel = 0;
|
||||
attr.border_pixel = 0;
|
||||
attr.colormap = XCreateColormap (x_disp, x_root, x_vis, AllocNone);
|
||||
attr.event_mask = X_MASK;
|
||||
attr.event_mask = X11_MASK;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
x_win = XCreateWindow (x_disp, x_root, 0, 0, width, height, 0,
|
||||
|
|
|
@ -85,12 +85,6 @@ static qboolean dga_active;
|
|||
static keydest_t old_key_dest = key_none;
|
||||
static int p_mouse_x, p_mouse_y;
|
||||
|
||||
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
|
||||
#define FOCUS_MASK (FocusChangeMask | EnterWindowMask)
|
||||
#define INPUT_MASK (KEY_MASK | MOUSE_MASK | FOCUS_MASK)
|
||||
|
||||
|
||||
static void
|
||||
dga_on (void)
|
||||
{
|
||||
|
@ -609,7 +603,7 @@ IN_LL_Grab_Input (int grab)
|
|||
if (grab) {
|
||||
int ret;
|
||||
|
||||
ret = XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||
ret = XGrabPointer (x_disp, x_win, True, X11_MOUSE_MASK, GrabModeAsync,
|
||||
GrabModeAsync, x_win, None, CurrentTime);
|
||||
if (ret != GrabSuccess) {
|
||||
grab_error (ret, "mouse");
|
||||
|
@ -673,7 +667,7 @@ IN_LL_Init (void)
|
|||
|
||||
XGetWindowAttributes (x_disp, x_win, &attribs_1);
|
||||
|
||||
attribs_2.event_mask = attribs_1.your_event_mask | INPUT_MASK;
|
||||
attribs_2.event_mask = attribs_1.your_event_mask | X11_INPUT_MASK;
|
||||
|
||||
XChangeWindowAttributes (x_disp, x_win, attribmask, &attribs_2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue