diff --git a/README.md b/README.md index bf95801..4bde053 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: +2020-09-28 - Added the \_IS\_FLOATING patch (embedded in the EWMHTAGS patch) + 2020-09-18 - Added the nomodbuttons patch allowing for toggleable mouse button bindings that have no modifiers 2020-09-10 - Added the anybar patch (with experimental support for dwm bar(s) + anybar) @@ -369,6 +371,11 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - implements inter-process communication through a UNIX socket for dwm - allows for the window manager to be queried for information, e.g. listen for events such as tag or layout changes, as well as send commands to control the window manager via other programs + - [\_IS\_FLOATING](https://github.com/bakkeby/dwm-flexipatch/issues/50) + - adds the \_IS\_FLOATING xproperty for floating windows + - this can allow for a compositor to handle floating windows differently to tiled windows, e.g. only show shadows on floating windows + - this patch is enabled via the ewmhtags patch + - [ispermanent](https://dwm.suckless.org/patches/ispermanent/) - adds rule option for clients to avoid accidental termination by killclient for sticky windows diff --git a/dwm.c b/dwm.c index 37f9c69..b32b36d 100644 --- a/dwm.c +++ b/dwm.c @@ -2253,6 +2253,10 @@ manage(Window w, XWindowAttributes *wa) arrange(c->mon); #endif // SWALLOW_PATCH focus(NULL); + + #if BAR_EWMHTAGS_PATCH + setfloatinghint(c); + #endif // BAR_EWMHTAGS_PATCH } void @@ -3663,6 +3667,10 @@ togglefloating(const Arg *arg) #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH } arrange(c->mon); + + #if BAR_EWMHTAGS_PATCH + setfloatinghint(c); + #endif // BAR_EWMHTAGS_PATCH } void diff --git a/patch/bar_ewmhtags.c b/patch/bar_ewmhtags.c index ee17ac6..99774c9 100644 --- a/patch/bar_ewmhtags.c +++ b/patch/bar_ewmhtags.c @@ -17,6 +17,14 @@ setdesktopnames(void) XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]); } +void +setfloatinghint(Client *c) +{ + Atom target = XInternAtom(dpy, "_IS_FLOATING", 0); + unsigned int floating[1] = {c->isfloating}; + XChangeProperty(dpy, c->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1); +} + void setnumdesktops(void) { diff --git a/patch/bar_ewmhtags.h b/patch/bar_ewmhtags.h index 937f1f6..959ab75 100644 --- a/patch/bar_ewmhtags.h +++ b/patch/bar_ewmhtags.h @@ -1,5 +1,6 @@ static void setcurrentdesktop(void); static void setdesktopnames(void); +static void setfloatinghint(Client *c); static void setnumdesktops(void); static void setviewport(void); static void updatecurrentdesktop(void); \ No newline at end of file diff --git a/patches.def.h b/patches.def.h index f1494e3..5d54f8e 100644 --- a/patches.def.h +++ b/patches.def.h @@ -238,6 +238,15 @@ /* Adds EWMH support for _NET_NUMBER_OF_DESKTOPS, _NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES * and _NET_DESKTOP_VIEWPORT, which allows for compatibility with other bars and programs * that request workspace information. For example polybar's xworkspaces module. + * + * This patch also includes support for adding the _IS_FLOATING property for floating windows + * allowing for compositors to treat floating windows differently to tiled windows. + * + * E.g. this setting makes picom only render shadows for floating windows: + * + * shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ]; + * + * https://github.com/bakkeby/dwm-flexipatch/issues/50 (_IS_FLOATING patch) * https://dwm.suckless.org/patches/ewmhtags/ */ #define BAR_EWMHTAGS_PATCH 0