mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
wmaker: Moved definition of GNUStep-related XAtoms into the global variables structure
This commit is contained in:
committed by
Carlos R. Mafra
parent
ecfb2dc902
commit
379f7022bd
@@ -498,6 +498,14 @@ extern struct wmaker_global_variables {
|
||||
Atom ignore_focus_events;
|
||||
} wm;
|
||||
|
||||
/* GNUStep related */
|
||||
struct {
|
||||
Atom wm_attr;
|
||||
Atom wm_miniaturize_window;
|
||||
Atom wm_resizebar;
|
||||
Atom titlebar_state;
|
||||
} gnustep;
|
||||
|
||||
} atom;
|
||||
|
||||
} w_global;
|
||||
|
||||
@@ -51,9 +51,6 @@ extern XContext wWinContext;
|
||||
|
||||
extern Atom _XA_WINDOWMAKER_MENU;
|
||||
|
||||
extern Atom _XA_GNUSTEP_WM_ATTR;
|
||||
extern Atom _XA_GNUSTEP_WM_RESIZEBAR;
|
||||
|
||||
#ifdef SHAPE
|
||||
extern Bool wShapeSupported;
|
||||
#endif
|
||||
@@ -618,7 +615,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
|
||||
wSetFocusTo(wwin->screen_ptr, NULL);
|
||||
wSetFocusTo(wwin->screen_ptr, wwin->screen_ptr->focused_window);
|
||||
}
|
||||
} else if (event->atom == _XA_GNUSTEP_WM_ATTR) {
|
||||
} else if (event->atom == w_global.atom.gnustep.wm_attr) {
|
||||
GNUstepWMAttributes *attr;
|
||||
|
||||
PropGetGNUstepWMAttr(wwin->client_win, &attr);
|
||||
|
||||
@@ -85,9 +85,6 @@ extern int wScreenCount;
|
||||
|
||||
#define MOD_MASK wPreferences.modifier_mask
|
||||
|
||||
extern Atom _XA_GNUSTEP_WM_ATTR;
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
extern Atom _XA_GNUSTEP_TITLEBAR_STATE;
|
||||
extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_COMMAND;
|
||||
|
||||
@@ -993,7 +990,7 @@ static void handleClientMessage(XEvent * event)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (event->xclient.message_type == _XA_GNUSTEP_WM_ATTR) {
|
||||
} else if (event->xclient.message_type == w_global.atom.gnustep.wm_attr) {
|
||||
wwin = wWindowFor(event->xclient.window);
|
||||
if (!wwin)
|
||||
return;
|
||||
@@ -1008,7 +1005,7 @@ static void handleClientMessage(XEvent * event)
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (event->xclient.message_type == _XA_GNUSTEP_TITLEBAR_STATE) {
|
||||
} else if (event->xclient.message_type == w_global.atom.gnustep.titlebar_state) {
|
||||
wwin = wWindowFor(event->xclient.window);
|
||||
if (!wwin)
|
||||
return;
|
||||
@@ -1401,7 +1398,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
if (wwin->protocols.MINIATURIZE_WINDOW)
|
||||
wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW, event->xbutton.time);
|
||||
wClientSendProtocol(wwin, w_global.atom.gnustep.wm_miniaturize_window, event->xbutton.time);
|
||||
else {
|
||||
wIconifyWindow(wwin);
|
||||
}
|
||||
|
||||
@@ -97,11 +97,6 @@ XContext wStackContext;
|
||||
XContext wVEdgeContext;
|
||||
|
||||
/* Atoms */
|
||||
Atom _XA_GNUSTEP_WM_ATTR;
|
||||
Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
Atom _XA_GNUSTEP_WM_RESIZEBAR;
|
||||
Atom _XA_GNUSTEP_TITLEBAR_STATE;
|
||||
|
||||
Atom _XA_WINDOWMAKER_MENU;
|
||||
Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
Atom _XA_WINDOWMAKER_STATE;
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
#include "properties.h"
|
||||
|
||||
/* atoms */
|
||||
extern Atom _XA_GNUSTEP_WM_ATTR;
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_MENU;
|
||||
extern Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
@@ -93,7 +91,7 @@ void PropGetProtocols(Window window, WProtocols * prots)
|
||||
prots->DELETE_WINDOW = 1;
|
||||
else if (protocols[i] == w_global.atom.wm.save_yourself)
|
||||
prots->SAVE_YOURSELF = 1;
|
||||
else if (protocols[i] == _XA_GNUSTEP_WM_MINIATURIZE_WINDOW)
|
||||
else if (protocols[i] == w_global.atom.gnustep.wm_miniaturize_window)
|
||||
prots->MINIATURIZE_WINDOW = 1;
|
||||
}
|
||||
XFree(protocols);
|
||||
@@ -135,8 +133,8 @@ int PropGetGNUstepWMAttr(Window window, GNUstepWMAttributes ** attr)
|
||||
{
|
||||
unsigned long *data;
|
||||
|
||||
data = (unsigned long *)PropGetCheckProperty(window, _XA_GNUSTEP_WM_ATTR,
|
||||
_XA_GNUSTEP_WM_ATTR, 32, 9, NULL);
|
||||
data = (unsigned long *)PropGetCheckProperty(window, w_global.atom.gnustep.wm_attr,
|
||||
w_global.atom.gnustep.wm_attr, 32, 9, NULL);
|
||||
|
||||
if (!data)
|
||||
return False;
|
||||
|
||||
@@ -108,7 +108,6 @@ extern XContext wStackContext;
|
||||
extern XContext wVEdgeContext;
|
||||
|
||||
/* atoms */
|
||||
extern Atom _XA_GNUSTEP_WM_ATTR;
|
||||
extern Atom _XA_WINDOWMAKER_MENU;
|
||||
extern Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
extern Atom _XA_WINDOWMAKER_STATE;
|
||||
@@ -117,8 +116,6 @@ extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
extern Atom _XA_WINDOWMAKER_COMMAND;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_SIZE;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_TILE;
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
extern Atom _XA_GNUSTEP_TITLEBAR_STATE;
|
||||
|
||||
#ifndef HAVE_INOTIFY
|
||||
/* special flags */
|
||||
@@ -522,9 +519,9 @@ void StartUp(Bool defaultScreenOnly)
|
||||
_XA_WINDOWMAKER_ICON_SIZE = atom[15];
|
||||
_XA_WINDOWMAKER_ICON_TILE = atom[16];
|
||||
|
||||
_XA_GNUSTEP_WM_ATTR = atom[17];
|
||||
_XA_GNUSTEP_WM_MINIATURIZE_WINDOW = atom[18];
|
||||
_XA_GNUSTEP_TITLEBAR_STATE = atom[19];
|
||||
w_global.atom.gnustep.wm_attr = atom[17];
|
||||
w_global.atom.gnustep.wm_miniaturize_window = atom[18];
|
||||
w_global.atom.gnustep.titlebar_state = atom[19];
|
||||
|
||||
w_global.atom.wm.ignore_focus_events = atom[20];
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ extern Bool wShapeSupported;
|
||||
extern XContext wWinContext;
|
||||
|
||||
/* protocol atoms */
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
extern Atom _XA_WINDOWMAKER_STATE;
|
||||
|
||||
/***** Local Stuff *****/
|
||||
@@ -2974,7 +2973,8 @@ static void windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||
return;
|
||||
|
||||
if (wwin->protocols.MINIATURIZE_WINDOW && event->xbutton.state == 0) {
|
||||
wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW, w_global.timestamp.last_event);
|
||||
wClientSendProtocol(wwin, w_global.atom.gnustep.wm_miniaturize_window,
|
||||
w_global.timestamp.last_event);
|
||||
} else {
|
||||
WApplication *wapp;
|
||||
if ((event->xbutton.state & ControlMask) || (event->xbutton.button == Button3)) {
|
||||
|
||||
@@ -69,8 +69,6 @@
|
||||
#define WO_ENTRIES 3
|
||||
|
||||
/**** Global data ***/
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
|
||||
extern WShortKey wKeyBindings[WKBD_LAST];
|
||||
|
||||
|
||||
@@ -133,7 +131,8 @@ static void execMenuCommand(WMenu * menu, WMenuEntry * entry)
|
||||
wDeiconifyWindow(wwin);
|
||||
} else {
|
||||
if (wwin->protocols.MINIATURIZE_WINDOW) {
|
||||
wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW, w_global.timestamp.last_event);
|
||||
wClientSendProtocol(wwin, w_global.atom.gnustep.wm_miniaturize_window,
|
||||
w_global.timestamp.last_event);
|
||||
} else {
|
||||
wIconifyWindow(wwin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user