1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Moved global var with list of cursors to the preferences variable

As the cursor choice for each action is actually a user choice,
it is logical to put this into the structure, instead of a poorly
defined 'extern' in every file.
This commit is contained in:
Christophe CURIS
2013-09-29 17:36:36 +02:00
committed by Carlos R. Mafra
parent 2c20413831
commit b48b3370e2
14 changed files with 71 additions and 83 deletions

View File

@@ -102,25 +102,31 @@ typedef struct WObjDescriptor {
#define PRED_BPIXMAPS 4 /* count of WBUT icons */ #define PRED_BPIXMAPS 4 /* count of WBUT icons */
#endif /* XKB_BUTTON_HINT */ #endif /* XKB_BUTTON_HINT */
/* cursors */ /* Mouse cursors */
#define WCUR_DEFAULT 0 typedef enum {
#define WCUR_NORMAL 0 WCUR_NORMAL,
#define WCUR_MOVE 1 WCUR_MOVE,
#define WCUR_RESIZE 2 WCUR_RESIZE,
#define WCUR_TOPLEFTRESIZE 3 WCUR_TOPLEFTRESIZE,
#define WCUR_TOPRIGHTRESIZE 4 WCUR_TOPRIGHTRESIZE,
#define WCUR_BOTTOMLEFTRESIZE 5 WCUR_BOTTOMLEFTRESIZE,
#define WCUR_BOTTOMRIGHTRESIZE 6 WCUR_BOTTOMRIGHTRESIZE,
#define WCUR_VERTICALRESIZE 7 WCUR_VERTICALRESIZE,
#define WCUR_HORIZONRESIZE 8 WCUR_HORIZONRESIZE,
#define WCUR_WAIT 9 WCUR_WAIT,
#define WCUR_ARROW 10 WCUR_ARROW,
#define WCUR_QUESTION 11 WCUR_QUESTION,
#define WCUR_TEXT 12 WCUR_TEXT,
#define WCUR_SELECT 13 WCUR_SELECT,
#define WCUR_ROOT 14 WCUR_ROOT,
#define WCUR_EMPTY 15 WCUR_EMPTY,
#define WCUR_LAST 16
/* Count of the number of cursors defined */
WCUR_LAST,
/* Alias for the Default cursor */
WCUR_DEFAULT = WCUR_NORMAL
} w_cursor;
/* geometry displays */ /* geometry displays */
#define WDIS_NEW 0 /* new style */ #define WDIS_NEW 0 /* new style */
@@ -449,6 +455,10 @@ extern struct WPreferences {
#endif #endif
unsigned int restarting:2; unsigned int restarting:2;
} flags; /* internal flags */ } flags; /* internal flags */
/* Map table between w_cursor and actual X id */
Cursor cursor[WCUR_LAST];
} wPreferences; } wPreferences;
/****** Global Variables ******/ /****** Global Variables ******/

View File

@@ -61,7 +61,6 @@
*/ */
/**** Global variables ****/ /**** Global variables ****/
extern Cursor wCursor[WCUR_LAST];
extern WDDomain *WDWindowAttributes; extern WDDomain *WDWindowAttributes;
extern XContext wWinContext; extern XContext wWinContext;
@@ -852,7 +851,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|| abs(ofs_y - ev.xmotion.y) >= MOVE_THRESHOLD) { || abs(ofs_y - ev.xmotion.y) >= MOVE_THRESHOLD) {
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_MOVE], CurrentTime); wPreferences.cursor[WCUR_MOVE], CurrentTime);
grabbed = 1; grabbed = 1;
} else { } else {
break; break;

View File

@@ -161,7 +161,6 @@ static WDECallbackUpdate updateUsableArea;
static WDECallbackUpdate setModifierKeyLabels; static WDECallbackUpdate setModifierKeyLabels;
extern Cursor wCursor[WCUR_LAST];
static WDECallbackConvert getCursor; static WDECallbackConvert getCursor;
static WDECallbackUpdate setCursor; static WDECallbackUpdate setCursor;
@@ -3225,11 +3224,11 @@ static int setCursor(WScreen * scr, WDefaultEntry * entry, void *tdata, void *ex
Cursor *cursor = tdata; Cursor *cursor = tdata;
long widx = (long) extra_data; long widx = (long) extra_data;
if (wCursor[widx] != None) { if (wPreferences.cursor[widx] != None) {
XFreeCursor(dpy, wCursor[widx]); XFreeCursor(dpy, wPreferences.cursor[widx]);
} }
wCursor[widx] = *cursor; wPreferences.cursor[widx] = *cursor;
if (widx == WCUR_ROOT && *cursor != None) { if (widx == WCUR_ROOT && *cursor != None) {
XDefineCursor(dpy, scr->root_win, *cursor); XDefineCursor(dpy, scr->root_win, *cursor);

View File

@@ -66,7 +66,6 @@
#define CLIP_FORWARD 2 #define CLIP_FORWARD 2
/**** Global variables ****/ /**** Global variables ****/
extern Cursor wCursor[WCUR_LAST];
extern XContext wWinContext; extern XContext wWinContext;
#define MOD_MASK wPreferences.modifier_mask #define MOD_MASK wPreferences.modifier_mask
@@ -3699,7 +3698,7 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|| abs(ofs_y - ev.xmotion.y) >= MOVE_THRESHOLD) { || abs(ofs_y - ev.xmotion.y) >= MOVE_THRESHOLD) {
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_MOVE], CurrentTime); wPreferences.cursor[WCUR_MOVE], CurrentTime);
grabbed = 1; grabbed = 1;
} }
break; break;

View File

@@ -80,8 +80,6 @@
extern XContext wWinContext; extern XContext wWinContext;
extern XContext wVEdgeContext; extern XContext wVEdgeContext;
extern Cursor wCursor[WCUR_LAST];
extern WShortKey wKeyBindings[WKBD_LAST]; extern WShortKey wKeyBindings[WKBD_LAST];
extern int wScreenCount; extern int wScreenCount;

View File

@@ -54,8 +54,6 @@
#define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps" #define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps"
#define ICON_BORDER 3 #define ICON_BORDER 3
extern Cursor wCursor[WCUR_LAST];
static void miniwindowExpose(WObjDescriptor * desc, XEvent * event); static void miniwindowExpose(WObjDescriptor * desc, XEvent * event);
static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event); static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event);
static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event); static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event);
@@ -721,7 +719,7 @@ static void set_dockapp_in_icon(WIcon *icon)
(attr.all_event_masks & ButtonPressMask)) (attr.all_event_masks & ButtonPressMask))
wHackedGrabButton(Button1, MOD_MASK, icon->core->window, True, wHackedGrabButton(Button1, MOD_MASK, icon->core->window, True,
ButtonPressMask, GrabModeSync, GrabModeAsync, ButtonPressMask, GrabModeSync, GrabModeAsync,
None, wCursor[WCUR_ARROW]); None, wPreferences.cursor[WCUR_ARROW]);
} }
/* Get the RImage from the XWindow wm_hints */ /* Get the RImage from the XWindow wm_hints */
@@ -862,7 +860,7 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
|| abs(dy - ev.xmotion.y) >= MOVE_THRESHOLD) { || abs(dy - ev.xmotion.y) >= MOVE_THRESHOLD) {
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_MOVE], CurrentTime); wPreferences.cursor[WCUR_MOVE], CurrentTime);
grabbed = 1; grabbed = 1;
} else { } else {
break; break;

View File

@@ -125,9 +125,6 @@ Atom _XA_WINDOWMAKER_ICON_TILE;
Atom _XA_WM_IGNORE_FOCUS_EVENTS; Atom _XA_WM_IGNORE_FOCUS_EVENTS;
/* cursors */
Cursor wCursor[WCUR_LAST];
#ifdef SHAPE #ifdef SHAPE
Bool wShapeSupported; Bool wShapeSupported;
int wShapeEventBase; int wShapeEventBase;

View File

@@ -47,8 +47,6 @@
/****** Global Variables ******/ /****** Global Variables ******/
extern Cursor wCursor[WCUR_LAST];
extern XContext wWinContext; extern XContext wWinContext;
#define MOD_MASK wPreferences.modifier_mask #define MOD_MASK wPreferences.modifier_mask
@@ -2185,7 +2183,7 @@ static void menuTitleMouseDown(WCoreWindow * sender, void *data, XEvent * event)
ButtonMotionMask | ButtonReleaseMask ButtonMotionMask | ButtonReleaseMask
| ButtonPressMask, | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, GrabModeAsync, GrabModeAsync, None,
wCursor[WCUR_MOVE], CurrentTime); wPreferences.cursor[WCUR_MOVE], CurrentTime);
} }
} }
break; break;

View File

@@ -60,8 +60,6 @@
*/ */
#define HAS_BORDER_WITH_SELECT(w) ((w)->flags.selected || HAS_BORDER(w)) #define HAS_BORDER_WITH_SELECT(w) ((w)->flags.selected || HAS_BORDER(w))
/****** Global Variables ******/
extern Cursor wCursor[WCUR_LAST];
/* /*
*---------------------------------------------------------------------- *----------------------------------------------------------------------
@@ -564,7 +562,7 @@ static void crossWorkspace(WScreen * scr, WWindow * wwin, int opaque_move, int n
if (!opaque_move) { if (!opaque_move) {
XGrabPointer(dpy, scr->root_win, True, PointerMotionMask XGrabPointer(dpy, scr->root_win, True, PointerMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, wCursor[WCUR_MOVE], CurrentTime); GrabModeAsync, None, wPreferences.cursor[WCUR_MOVE], CurrentTime);
} }
} }
@@ -1242,7 +1240,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
XGrabServer(dpy); XGrabServer(dpy);
XGrabPointer(dpy, scr->root_win, True, PointerMotionMask XGrabPointer(dpy, scr->root_win, True, PointerMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime); GrabModeAsync, None, wPreferences.cursor[WCUR_DEFAULT], CurrentTime);
@@ -1696,7 +1694,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_MOVE], CurrentTime); wPreferences.cursor[WCUR_MOVE], CurrentTime);
started = 1; started = 1;
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime); XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
@@ -1988,31 +1986,31 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
if (res == (UP | LEFT)) if (res == (UP | LEFT))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_TOPLEFTRESIZE], CurrentTime); wPreferences.cursor[WCUR_TOPLEFTRESIZE], CurrentTime);
else if (res == (UP | RIGHT)) else if (res == (UP | RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_TOPRIGHTRESIZE], CurrentTime); wPreferences.cursor[WCUR_TOPRIGHTRESIZE], CurrentTime);
else if (res == (DOWN | LEFT)) else if (res == (DOWN | LEFT))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_BOTTOMLEFTRESIZE], CurrentTime); wPreferences.cursor[WCUR_BOTTOMLEFTRESIZE], CurrentTime);
else if (res == (DOWN | RIGHT)) else if (res == (DOWN | RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_BOTTOMRIGHTRESIZE], CurrentTime); wPreferences.cursor[WCUR_BOTTOMRIGHTRESIZE], CurrentTime);
else if (res == DOWN || res == UP) else if (res == DOWN || res == UP)
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_VERTICALRESIZE], CurrentTime); wPreferences.cursor[WCUR_VERTICALRESIZE], CurrentTime);
else if (res & (DOWN | UP)) else if (res & (DOWN | UP))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_VERTICALRESIZE], CurrentTime); wPreferences.cursor[WCUR_VERTICALRESIZE], CurrentTime);
else if (res & (LEFT | RIGHT)) else if (res & (LEFT | RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, | ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_HORIZONRESIZE], CurrentTime); wPreferences.cursor[WCUR_HORIZONRESIZE], CurrentTime);
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime); XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
@@ -2153,7 +2151,7 @@ void wSelectWindows(WScreen * scr, XEvent * ev)
if (XGrabPointer(dpy, scr->root_win, False, ButtonMotionMask if (XGrabPointer(dpy, scr->root_win, False, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime) != Success) { GrabModeAsync, None, wPreferences.cursor[WCUR_DEFAULT], CurrentTime) != Success) {
return; return;
} }
XGrabServer(dpy); XGrabServer(dpy);
@@ -2215,7 +2213,7 @@ void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned wid
int junk; int junk;
if (XGrabPointer(dpy, root, True, PointerMotionMask | ButtonPressMask, if (XGrabPointer(dpy, root, True, PointerMotionMask | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime) != Success) { GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_DEFAULT], CurrentTime) != Success) {
*x_ret = 0; *x_ret = 0;
*y_ret = 0; *y_ret = 0;
return; return;

View File

@@ -61,7 +61,6 @@
#define MAX_SHORTCUT_LENGTH 32 #define MAX_SHORTCUT_LENGTH 32
extern WDDomain *WDRootMenu; extern WDDomain *WDRootMenu;
extern Cursor wCursor[WCUR_LAST];
static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readMenuPipe(WScreen * scr, char **file_name);
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name); static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
@@ -155,7 +154,7 @@ static void execCommand(WMenu * menu, WMenuEntry * entry)
cmdline = ExpandOptions(menu->frame->screen_ptr, (char *)entry->clientdata); cmdline = ExpandOptions(menu->frame->screen_ptr, (char *)entry->clientdata);
XGrabPointer(dpy, menu->frame->screen_ptr->root_win, True, 0, XGrabPointer(dpy, menu->frame->screen_ptr->root_win, True, 0,
GrabModeAsync, GrabModeAsync, None, wCursor[WCUR_WAIT], CurrentTime); GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_WAIT], CurrentTime);
XSync(dpy, 0); XSync(dpy, 0);
if (cmdline) { if (cmdline) {

View File

@@ -70,7 +70,6 @@
|KeyPressMask|KeyReleaseMask) |KeyPressMask|KeyReleaseMask)
/**** Global variables ****/ /**** Global variables ****/
extern Cursor wCursor[WCUR_LAST];
extern Atom _XA_WINDOWMAKER_STATE; extern Atom _XA_WINDOWMAKER_STATE;
extern Atom _XA_WINDOWMAKER_NOTICEBOARD; extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
@@ -464,7 +463,7 @@ static void createInternalWindows(WScreen * scr)
attribs.override_redirect = True; attribs.override_redirect = True;
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = scr->white_pixel; attribs.background_pixel = scr->white_pixel;
attribs.cursor = wCursor[WCUR_DEFAULT]; attribs.cursor = wPreferences.cursor[WCUR_DEFAULT];
vmask |= CWColormap; vmask |= CWColormap;
attribs.colormap = scr->w_colormap; attribs.colormap = scr->w_colormap;
scr->dock_shadow = scr->dock_shadow =
@@ -571,7 +570,7 @@ WScreen *wScreenInit(int screen_number)
return NULL; return NULL;
} }
XDefineCursor(dpy, scr->root_win, wCursor[WCUR_ROOT]); XDefineCursor(dpy, scr->root_win, wPreferences.cursor[WCUR_ROOT]);
/* screen descriptor for raster graphic library */ /* screen descriptor for raster graphic library */
rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap; rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap;

View File

@@ -130,9 +130,6 @@ extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
extern Atom _XA_GNUSTEP_TITLEBAR_STATE; extern Atom _XA_GNUSTEP_TITLEBAR_STATE;
extern Atom _XA_WM_IGNORE_FOCUS_EVENTS; extern Atom _XA_WM_IGNORE_FOCUS_EVENTS;
/* cursors */
extern Cursor wCursor[WCUR_LAST];
#ifndef HAVE_INOTIFY #ifndef HAVE_INOTIFY
/* special flags */ /* special flags */
extern char WDelayedActionSet; extern char WDelayedActionSet;
@@ -546,21 +543,21 @@ void StartUp(Bool defaultScreenOnly)
#endif #endif
/* cursors */ /* cursors */
wCursor[WCUR_NORMAL] = None; /* inherit from root */ wPreferences.cursor[WCUR_NORMAL] = None; /* inherit from root */
wCursor[WCUR_ROOT] = XCreateFontCursor(dpy, XC_left_ptr); wPreferences.cursor[WCUR_ROOT] = XCreateFontCursor(dpy, XC_left_ptr);
wCursor[WCUR_ARROW] = XCreateFontCursor(dpy, XC_top_left_arrow); wPreferences.cursor[WCUR_ARROW] = XCreateFontCursor(dpy, XC_top_left_arrow);
wCursor[WCUR_MOVE] = XCreateFontCursor(dpy, XC_fleur); wPreferences.cursor[WCUR_MOVE] = XCreateFontCursor(dpy, XC_fleur);
wCursor[WCUR_RESIZE] = XCreateFontCursor(dpy, XC_sizing); wPreferences.cursor[WCUR_RESIZE] = XCreateFontCursor(dpy, XC_sizing);
wCursor[WCUR_TOPLEFTRESIZE] = XCreateFontCursor(dpy, XC_top_left_corner); wPreferences.cursor[WCUR_TOPLEFTRESIZE] = XCreateFontCursor(dpy, XC_top_left_corner);
wCursor[WCUR_TOPRIGHTRESIZE] = XCreateFontCursor(dpy, XC_top_right_corner); wPreferences.cursor[WCUR_TOPRIGHTRESIZE] = XCreateFontCursor(dpy, XC_top_right_corner);
wCursor[WCUR_BOTTOMLEFTRESIZE] = XCreateFontCursor(dpy, XC_bottom_left_corner); wPreferences.cursor[WCUR_BOTTOMLEFTRESIZE] = XCreateFontCursor(dpy, XC_bottom_left_corner);
wCursor[WCUR_BOTTOMRIGHTRESIZE] = XCreateFontCursor(dpy, XC_bottom_right_corner); wPreferences.cursor[WCUR_BOTTOMRIGHTRESIZE] = XCreateFontCursor(dpy, XC_bottom_right_corner);
wCursor[WCUR_VERTICALRESIZE] = XCreateFontCursor(dpy, XC_sb_v_double_arrow); wPreferences.cursor[WCUR_VERTICALRESIZE] = XCreateFontCursor(dpy, XC_sb_v_double_arrow);
wCursor[WCUR_HORIZONRESIZE] = XCreateFontCursor(dpy, XC_sb_h_double_arrow); wPreferences.cursor[WCUR_HORIZONRESIZE] = XCreateFontCursor(dpy, XC_sb_h_double_arrow);
wCursor[WCUR_WAIT] = XCreateFontCursor(dpy, XC_watch); wPreferences.cursor[WCUR_WAIT] = XCreateFontCursor(dpy, XC_watch);
wCursor[WCUR_QUESTION] = XCreateFontCursor(dpy, XC_question_arrow); wPreferences.cursor[WCUR_QUESTION] = XCreateFontCursor(dpy, XC_question_arrow);
wCursor[WCUR_TEXT] = XCreateFontCursor(dpy, XC_xterm); /* odd name??? */ wPreferences.cursor[WCUR_TEXT] = XCreateFontCursor(dpy, XC_xterm); /* odd name??? */
wCursor[WCUR_SELECT] = XCreateFontCursor(dpy, XC_cross); wPreferences.cursor[WCUR_SELECT] = XCreateFontCursor(dpy, XC_cross);
Pixmap cur = XCreatePixmap(dpy, DefaultRootWindow(dpy), 16, 16, 1); Pixmap cur = XCreatePixmap(dpy, DefaultRootWindow(dpy), 16, 16, 1);
GC gc = XCreateGC(dpy, cur, 0, NULL); GC gc = XCreateGC(dpy, cur, 0, NULL);
@@ -569,7 +566,7 @@ void StartUp(Bool defaultScreenOnly)
XSetForeground(dpy, gc, 0); XSetForeground(dpy, gc, 0);
XFillRectangle(dpy, cur, gc, 0, 0, 16, 16); XFillRectangle(dpy, cur, gc, 0, 0, 16, 16);
XFreeGC(dpy, gc); XFreeGC(dpy, gc);
wCursor[WCUR_EMPTY] = XCreatePixmapCursor(dpy, cur, cur, &black, &black, 0, 0); wPreferences.cursor[WCUR_EMPTY] = XCreatePixmapCursor(dpy, cur, cur, &black, &black, 0, 0);
XFreePixmap(dpy, cur); XFreePixmap(dpy, cur);

View File

@@ -30,8 +30,6 @@
#include "wcore.h" #include "wcore.h"
/****** Global Variables ******/ /****** Global Variables ******/
/* cursors */
extern Cursor wCursor[WCUR_LAST];
extern XContext wWinContext; extern XContext wWinContext;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@@ -51,7 +49,7 @@ WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int h
vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect | CWColormap; vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect | CWColormap;
attribs.override_redirect = True; attribs.override_redirect = True;
attribs.cursor = wCursor[WCUR_DEFAULT]; attribs.cursor = wPreferences.cursor[WCUR_DEFAULT];
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = screen->black_pixel; attribs.background_pixel = screen->black_pixel;
attribs.border_pixel = border_pixel; attribs.border_pixel = border_pixel;
@@ -102,7 +100,7 @@ WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int heigh
core = wmalloc(sizeof(WCoreWindow)); core = wmalloc(sizeof(WCoreWindow));
vmask = CWBorderPixel | CWCursor | CWEventMask | CWColormap; vmask = CWBorderPixel | CWCursor | CWEventMask | CWColormap;
attribs.cursor = wCursor[WCUR_DEFAULT]; attribs.cursor = wPreferences.cursor[WCUR_DEFAULT];
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = parent->screen_ptr->black_pixel; attribs.background_pixel = parent->screen_ptr->black_pixel;
attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |

View File

@@ -114,7 +114,6 @@ typedef struct InspectorPanel {
unsigned int choosingIcon:1; unsigned int choosingIcon:1;
} InspectorPanel; } InspectorPanel;
extern Cursor wCursor[WCUR_LAST];
extern WDDomain *WDWindowAttributes; extern WDDomain *WDWindowAttributes;
static InspectorPanel *panelList = NULL; static InspectorPanel *panelList = NULL;
@@ -1017,7 +1016,7 @@ static void selectWindow(WMWidget *bPtr, void *data)
if (XGrabPointer(dpy, scr->root_win, True, if (XGrabPointer(dpy, scr->root_win, True,
ButtonPressMask, GrabModeAsync, GrabModeAsync, None, ButtonPressMask, GrabModeAsync, GrabModeAsync, None,
wCursor[WCUR_SELECT], CurrentTime) != GrabSuccess) { wPreferences.cursor[WCUR_SELECT], CurrentTime) != GrabSuccess) {
wwarning("could not grab mouse pointer"); wwarning("could not grab mouse pointer");
return; return;
} }