diff --git a/include/context_x11.h b/include/context_x11.h index 6e628ea0d..6f18d548e 100644 --- a/include/context_x11.h +++ b/include/context_x11.h @@ -51,7 +51,6 @@ extern qboolean x_have_focus; void GetEvent (void); -vec3_t *X11_GetGamma (void); qboolean X11_AddEvent (int event, void (*event_handler)(XEvent *)); qboolean X11_RemoveEvent (int event, void (*event_handler)(XEvent *)); qboolean X11_SetGamma (double); diff --git a/libs/video/targets/context_x11.c b/libs/video/targets/context_x11.c index b4e3b6723..0d069c7b7 100644 --- a/libs/video/targets/context_x11.c +++ b/libs/video/targets/context_x11.c @@ -93,7 +93,6 @@ Time x_time; qboolean x_have_focus = false; #define X_MASK (VisibilityChangeMask | StructureNotifyMask | ExposureMask | FocusChangeMask | EnterWindowMask) -#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask) #ifdef HAVE_VIDMODE static XF86VidModeModeInfo **vidmodes; @@ -147,7 +146,7 @@ X11_RemoveEvent (int event, void (*event_handler) (XEvent *)) return true; } -static void +static inline void X11_ProcessEventProxy(XEvent *x_event) { if (x_event->type >= LASTEvent) { @@ -174,7 +173,7 @@ X11_WaitForEvent (int event) } } -void +inline void X11_ProcessEvent (void) { XEvent x_event; @@ -186,10 +185,8 @@ X11_ProcessEvent (void) void X11_ProcessEvents (void) { - // Get events from X server. - while (XPending (x_disp)) { + while (XPending (x_disp)) X11_ProcessEvent (); - } } void @@ -295,6 +292,31 @@ X11_ForceMove (int x, int y) X11_WaitForEvent (ConfigureNotify); } +static vec3_t * +X11_GetGamma (void) +{ +#ifdef HAVE_VIDMODE +# ifdef X_XF86VidModeGetGamma + XF86VidModeGamma xgamma; + vec3_t *temp; + + if (vid_gamma_avail && vid_system_gamma->int_val) { + if (XF86VidModeGetGamma (x_disp, x_screen, &xgamma)) { + if ((temp = malloc (sizeof (vec3_t)))) { + (*temp)[0] = xgamma.red; + (*temp)[1] = xgamma.green; + (*temp)[2] = xgamma.blue; + return temp; + } + return NULL; + } + } +# endif +#endif + vid_gamma_avail = false; + return NULL; +} + void X11_SetVidMode (int width, int height) { @@ -545,31 +567,6 @@ X11_ForceViewPort (void) #endif } -vec3_t * -X11_GetGamma (void) -{ -#ifdef HAVE_VIDMODE -# ifdef X_XF86VidModeGetGamma - XF86VidModeGamma xgamma; - vec3_t *temp; - - if (vid_gamma_avail && vid_system_gamma->int_val) { - if (XF86VidModeGetGamma (x_disp, x_screen, &xgamma)) { - if ((temp = malloc (sizeof (vec3_t)))) { - (*temp)[0] = xgamma.red; - (*temp)[1] = xgamma.green; - (*temp)[2] = xgamma.blue; - return temp; - } - return NULL; - } - } -# endif -#endif - vid_gamma_avail = false; - return NULL; -} - qboolean X11_SetGamma (double gamma) {