Adding (temporary?) EWMH_WINDOWS_FLOAT_PATCH

This commit is contained in:
bakkeby 2020-05-20 15:25:07 +02:00
parent 57ef22eaba
commit 5e281dcd44
2 changed files with 42 additions and 12 deletions

27
dwm.c
View File

@ -111,7 +111,8 @@ enum {
#endif // VTCOLORS_PATCH
}; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
enum {
NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
#if SYSTRAY_PATCH
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation,
@ -120,6 +121,9 @@ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
#if EWMHTAGS_PATCH
NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop,
#endif // EWMHTAGS_PATCH
#if EWMH_WINDOWS_FLOAT_PATCH
NetWMModal, NetWMWindowTypeUtility, NetWMWindowTypeToolbar, NetWMWindowTypeSplash,
#endif // EWMH_WINDOWS_FLOAT_PATCH
NetWMWindowTypeDialog, NetClientList, NetLast
}; /* EWMH atoms */
@ -3044,8 +3048,16 @@ setup(void)
netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
#if EWMH_WINDOWS_FLOAT_PATCH
netatom[NetWMModal] = XInternAtom(dpy, "_NET_WM_STATE_MODAL", False);
#endif // EWMH_WINDOWS_FLOAT_PATCH
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
#if EWMH_WINDOWS_FLOAT_PATCH
netatom[NetWMWindowTypeUtility] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_UTILITY", False);
netatom[NetWMWindowTypeToolbar] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR", False);
netatom[NetWMWindowTypeSplash] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_SPLASH", False);
#endif // EWMH_WINDOWS_FLOAT_PATCH
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
/* init cursors */
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
@ -3947,8 +3959,19 @@ updatewindowtype(Client *c)
if (state == netatom[NetWMFullscreen])
setfullscreen(c, 1);
if (wtype == netatom[NetWMWindowTypeDialog]) {
#if EWMH_WINDOWS_FLOAT_PATCH
if (wtype == netatom[NetWMWindowTypeDialog] ||
wtype == netatom[NetWMWindowTypeUtility] ||
wtype == netatom[NetWMWindowTypeToolbar] ||
wtype == netatom[NetWMWindowTypeSplash] ||
state == netatom[NetWMModal])
#else
if (wtype == netatom[NetWMWindowTypeDialog])
#endif //EWMH_WINDOWS_FLOAT_PATCH
{
#if CENTER_PATCH
if (c->x == c->mon->mx && c->y == c->mon->my)
c->iscentered = 1;
#endif // CENTER_PATCH
c->isfloating = 1;

View File

@ -169,6 +169,13 @@
*/
#define EWMHTAGS_PATCH 0
/* This patch makes dialog, utility, toolbar, splash and modal windows float by default.
* This may only be a temporary patch depending on whether this is integrated in the main
* dwm source, and if so how.
* https://lists.suckless.org/hackers/2005/17318.html
*/
#define EWMH_WINDOWS_FLOAT_PATCH 0
/* This patch allows the user to change size and placement of floating windows using only the
* keyboard. It also allows for temporary vertical and horizontal extension of windows similar
* to other WMs fill command.