1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

wmaker: Moved variables for the XShape extension into the global namespace

This commit is contained in:
Christophe CURIS
2013-10-10 20:38:23 +02:00
committed by Carlos R. Mafra
parent c3c2d8d7f1
commit 81aa311c42
7 changed files with 24 additions and 33 deletions

View File

@@ -570,6 +570,23 @@ extern struct wmaker_global_variables {
XContext stack; XContext stack;
} context; } context;
/* X Extensions */
struct {
#ifdef SHAPE
struct {
Bool supported;
int event_base;
} shape;
#endif
/*
* If no extension were activated, we would end up with an empty
* structure, which old compilers may not appreciate, so let's
* work around this with a simple:
*/
int dummy;
} xext;
/* Session related */ /* Session related */
WMPropList *session_state; WMPropList *session_state;

View File

@@ -44,11 +44,6 @@
#include "wmspec.h" #include "wmspec.h"
#include "misc.h" #include "misc.h"
/****** Global Variables ******/
#ifdef SHAPE
extern Bool wShapeSupported;
#endif
/* /*
*-------------------------------------------------------------------- *--------------------------------------------------------------------
@@ -172,7 +167,7 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
return; return;
} }
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported) { if (w_global.xext.shape.supported) {
int junk; int junk;
unsigned int ujunk; unsigned int ujunk;
int b_shaped; int b_shaped;

View File

@@ -81,11 +81,6 @@ extern WShortKey wKeyBindings[WKBD_LAST];
#define MOD_MASK wPreferences.modifier_mask #define MOD_MASK wPreferences.modifier_mask
#ifdef SHAPE
extern Bool wShapeSupported;
extern int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
extern int wXkbEventBase; extern int wXkbEventBase;
#endif #endif
@@ -551,7 +546,7 @@ static void handleExtensions(XEvent * event)
xkbevent = (XkbEvent *) event; xkbevent = (XkbEvent *) event;
#endif /*KEEP_XKB_LOCK_STATUS */ #endif /*KEEP_XKB_LOCK_STATUS */
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported && event->type == (wShapeEventBase + ShapeNotify)) { if (w_global.xext.shape.supported && event->type == (w_global.xext.shape.event_base + ShapeNotify)) {
handleShapeNotify(event); handleShapeNotify(event);
} }
#endif #endif

View File

@@ -88,11 +88,6 @@ WDDomain *WDWindowMaker = NULL;
WDDomain *WDWindowAttributes = NULL; WDDomain *WDWindowAttributes = NULL;
WDDomain *WDRootMenu = NULL; WDDomain *WDRootMenu = NULL;
#ifdef SHAPE
Bool wShapeSupported;
int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
Bool wXkbSupported; Bool wXkbSupported;
int wXkbEventBase; int wXkbEventBase;

View File

@@ -90,11 +90,6 @@ extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes; extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST]; extern WShortKey wKeyBindings[WKBD_LAST];
#ifdef SHAPE
extern Bool wShapeSupported;
extern int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
extern Bool wXkbSupported; extern Bool wXkbSupported;
extern int wXkbEventBase; extern int wXkbEventBase;
@@ -633,7 +628,7 @@ void StartUp(Bool defaultScreenOnly)
#ifdef SHAPE #ifdef SHAPE
/* ignore j */ /* ignore j */
wShapeSupported = XShapeQueryExtension(dpy, &wShapeEventBase, &j); w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j);
#endif #endif
#ifdef HAVE_XRANDR #ifdef HAVE_XRANDR

View File

@@ -38,8 +38,6 @@
#ifdef SHAPE #ifdef SHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
extern Bool wShapeSupported;
#endif #endif
struct SwitchPanel { struct SwitchPanel {
@@ -522,7 +520,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, Bool class_only)
XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win), pixmap); XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win), pixmap);
#ifdef SHAPE #ifdef SHAPE
if (mask && wShapeSupported) if (mask && w_global.xext.shape.supported)
XShapeCombineMask(dpy, WMWidgetXID(panel->win), ShapeBounding, 0, 0, mask, ShapeSet); XShapeCombineMask(dpy, WMWidgetXID(panel->win), ShapeBounding, 0, 0, mask, ShapeSet);
#endif #endif
if (pixmap) if (pixmap)

View File

@@ -75,10 +75,6 @@
/****** Global Variables ******/ /****** Global Variables ******/
extern WShortKey wKeyBindings[WKBD_LAST]; extern WShortKey wKeyBindings[WKBD_LAST];
#ifdef SHAPE
extern Bool wShapeSupported;
#endif
/***** Local Stuff *****/ /***** Local Stuff *****/
static WWindowState *windowState = NULL; static WWindowState *windowState = NULL;
static FocusMode getFocusMode(WWindow *wwin); static FocusMode getFocusMode(WWindow *wwin);
@@ -621,7 +617,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
XSaveContext(dpy, window, w_global.context.client_win, (XPointer) & wwin->client_descriptor); XSaveContext(dpy, window, w_global.context.client_win, (XPointer) & wwin->client_descriptor);
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported) { if (w_global.xext.shape.supported) {
int junk; int junk;
unsigned int ujunk; unsigned int ujunk;
int b_shaped; int b_shaped;
@@ -2042,7 +2038,7 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
wwin->client.y += wwin->screen_ptr->frame_border_width; wwin->client.y += wwin->screen_ptr->frame_border_width;
} }
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported && wwin->flags.shaped && resize) if (w_global.xext.shape.supported && wwin->flags.shaped && resize)
wWindowSetShape(wwin); wWindowSetShape(wwin);
#endif #endif
@@ -2266,7 +2262,7 @@ void wWindowConfigureBorders(WWindow *wwin)
wFrameWindowHideButton(wwin->frame, flags); wFrameWindowHideButton(wwin->frame, flags);
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported && wwin->flags.shaped) if (w_global.xext.shape.supported && wwin->flags.shaped)
wWindowSetShape(wwin); wWindowSetShape(wwin);
#endif #endif
} }