1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +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;
} 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 */
WMPropList *session_state;

View File

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

View File

@@ -81,11 +81,6 @@ extern WShortKey wKeyBindings[WKBD_LAST];
#define MOD_MASK wPreferences.modifier_mask
#ifdef SHAPE
extern Bool wShapeSupported;
extern int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS
extern int wXkbEventBase;
#endif
@@ -551,7 +546,7 @@ static void handleExtensions(XEvent * event)
xkbevent = (XkbEvent *) event;
#endif /*KEEP_XKB_LOCK_STATUS */
#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);
}
#endif

View File

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

View File

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

View File

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

View File

@@ -75,10 +75,6 @@
/****** Global Variables ******/
extern WShortKey wKeyBindings[WKBD_LAST];
#ifdef SHAPE
extern Bool wShapeSupported;
#endif
/***** Local Stuff *****/
static WWindowState *windowState = NULL;
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);
#ifdef SHAPE
if (wShapeSupported) {
if (w_global.xext.shape.supported) {
int junk;
unsigned int ujunk;
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;
}
#ifdef SHAPE
if (wShapeSupported && wwin->flags.shaped && resize)
if (w_global.xext.shape.supported && wwin->flags.shaped && resize)
wWindowSetShape(wwin);
#endif
@@ -2266,7 +2262,7 @@ void wWindowConfigureBorders(WWindow *wwin)
wFrameWindowHideButton(wwin->frame, flags);
#ifdef SHAPE
if (wShapeSupported && wwin->flags.shaped)
if (w_global.xext.shape.supported && wwin->flags.shaped)
wWindowSetShape(wwin);
#endif
}