sticky is now EWMH compliant
This commit is contained in:
parent
e02ebc27ef
commit
1428873bf9
93
speedwm.c
93
speedwm.c
|
@ -97,43 +97,60 @@ enum { SchemeBorderNorm,
|
||||||
SchemeLayout,
|
SchemeLayout,
|
||||||
SchemeStatus,
|
SchemeStatus,
|
||||||
SchemeSystray,
|
SchemeSystray,
|
||||||
SchemePowerline1,
|
|
||||||
SchemePowerline2,
|
|
||||||
SchemePowerline3,
|
|
||||||
SchemePowerline4,
|
|
||||||
SchemePowerline5,
|
|
||||||
SchemePowerline6,
|
|
||||||
SchemePowerline7,
|
|
||||||
SchemePowerline8,
|
|
||||||
SchemePowerline9,
|
|
||||||
SchemePowerline10,
|
|
||||||
SchemePowerline11,
|
|
||||||
SchemePowerline12,
|
|
||||||
SchemePowerline13,
|
|
||||||
SchemePowerline14,
|
|
||||||
SchemePowerline15,
|
|
||||||
SchemePowerline16,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { NetSupported, NetWMName,
|
/* EWMH atoms */
|
||||||
NetWMState, NetWMCheck,
|
enum { NetSupported,
|
||||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDesktop,
|
NetWMName,
|
||||||
NetWMWindowTypeDialog, NetClientList, NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop,
|
NetWMState,
|
||||||
|
NetWMCheck,
|
||||||
|
NetWMFullscreen,
|
||||||
|
NetActiveWindow,
|
||||||
|
NetWMWindowType,
|
||||||
|
NetWMWindowTypeDesktop,
|
||||||
|
NetWMSticky,
|
||||||
|
NetWMWindowTypeDialog,
|
||||||
|
NetClientList, NetDesktopNames,
|
||||||
|
NetDesktopViewport,
|
||||||
|
NetNumberOfDesktops,
|
||||||
|
NetCurrentDesktop,
|
||||||
#if USEFADE
|
#if USEFADE
|
||||||
NetWMWindowsOpacity,
|
NetWMWindowsOpacity,
|
||||||
#endif
|
#endif
|
||||||
#if USESYSTRAY
|
#if USESYSTRAY
|
||||||
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation,
|
NetSystemTray,
|
||||||
NetSystemTrayVisual, NetWMWindowTypeDock, NetSystemTrayOrientationHorz,
|
NetSystemTrayOP,
|
||||||
|
NetSystemTrayOrientation,
|
||||||
|
NetSystemTrayVisual,
|
||||||
|
NetWMWindowTypeDock,
|
||||||
|
NetSystemTrayOrientationHorz,
|
||||||
#endif
|
#endif
|
||||||
#if USEWINICON
|
#if USEWINICON
|
||||||
NetWMIcon,
|
NetWMIcon,
|
||||||
#endif
|
#endif
|
||||||
NetClientListStacking, NetClientInfo, NetLast }; /* EWMH atoms */
|
NetClientListStacking,
|
||||||
|
NetClientInfo,
|
||||||
|
NetLast,
|
||||||
|
};
|
||||||
|
|
||||||
enum { WMClass, WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
|
/* default atoms */
|
||||||
enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
|
enum { WMClass,
|
||||||
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
|
WMProtocols,
|
||||||
|
WMDelete,
|
||||||
|
WMState,
|
||||||
|
WMTakeFocus,
|
||||||
|
WMLast,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* clicks */
|
||||||
|
enum { ClkTagBar,
|
||||||
|
ClkLtSymbol,
|
||||||
|
ClkStatusText,
|
||||||
|
ClkWinTitle,
|
||||||
|
ClkClientWin,
|
||||||
|
ClkRootWin,
|
||||||
|
ClkLast,
|
||||||
|
};
|
||||||
|
|
||||||
#if USEIPC
|
#if USEIPC
|
||||||
typedef struct TagState TagState;
|
typedef struct TagState TagState;
|
||||||
|
@ -581,6 +598,7 @@ static void setclientstate(Client *c, long state);
|
||||||
static void setclienttagprop(Client *c);
|
static void setclienttagprop(Client *c);
|
||||||
static void setfocus(Client *c);
|
static void setfocus(Client *c);
|
||||||
static void setfullscreen(Client *c, int fullscreen);
|
static void setfullscreen(Client *c, int fullscreen);
|
||||||
|
static void setsticky(Client *c, int sticky);
|
||||||
static void setgaps(int oh, int ov, int ih, int iv);
|
static void setgaps(int oh, int ov, int ih, int iv);
|
||||||
static void incrgaps(const Arg *arg);
|
static void incrgaps(const Arg *arg);
|
||||||
static void incrigaps(const Arg *arg);
|
static void incrigaps(const Arg *arg);
|
||||||
|
@ -1567,6 +1585,9 @@ clientmessage(XEvent *e)
|
||||||
|| cme->data.l[2] == netatom[NetWMFullscreen])
|
|| cme->data.l[2] == netatom[NetWMFullscreen])
|
||||||
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|
||||||
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|
||||||
|
if (cme->data.l[1] == netatom[NetWMSticky]
|
||||||
|
|| cme->data.l[2] == netatom[NetWMSticky])
|
||||||
|
setsticky(c, (cme->data.l[0] == 1 || (cme->data.l[0] == 2 && !c->issticky)));
|
||||||
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
||||||
if (!autofocus) {
|
if (!autofocus) {
|
||||||
if (c != selmon->sel && !c->isurgent)
|
if (c != selmon->sel && !c->isurgent)
|
||||||
|
@ -5170,6 +5191,7 @@ setup(void)
|
||||||
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
||||||
|
|
||||||
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
netatom[NetWMSticky] = XInternAtom(dpy, "_NET_WM_STATE_STICKY", False);
|
||||||
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
|
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
|
||||||
netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
|
netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
|
||||||
netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
|
netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
|
||||||
|
@ -5581,6 +5603,22 @@ togglefloating(const Arg *arg)
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setsticky(Client *c, int sticky)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(sticky && !c->issticky) {
|
||||||
|
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
|
||||||
|
PropModeReplace, (unsigned char *) &netatom[NetWMSticky], 1);
|
||||||
|
c->issticky = 1;
|
||||||
|
} else if(!sticky && c->issticky){
|
||||||
|
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
|
||||||
|
PropModeReplace, (unsigned char *)0, 0);
|
||||||
|
c->issticky = 0;
|
||||||
|
arrange(c->mon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
togglesticky(const Arg *arg)
|
togglesticky(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
@ -6076,6 +6114,9 @@ updatewindowtype(Client *c)
|
||||||
|
|
||||||
if (state == netatom[NetWMFullscreen])
|
if (state == netatom[NetWMFullscreen])
|
||||||
setfullscreen(c, 1);
|
setfullscreen(c, 1);
|
||||||
|
if (state == netatom[NetWMSticky]) {
|
||||||
|
setsticky(c, 1);
|
||||||
|
}
|
||||||
if (wtype == netatom[NetWMWindowTypeDialog])
|
if (wtype == netatom[NetWMWindowTypeDialog])
|
||||||
c->isfloating = 1;
|
c->isfloating = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue