Skip to content

Commit

Permalink
Adding _IS_FLOATING xproperty patch for floating windows ref. bakkeby#50
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkeby committed Sep 28, 2020
1 parent 7c470d0 commit 3df097f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions patch/bar_ewmhtags.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions patch/bar_ewmhtags.h
Original file line number Diff line number Diff line change
@@ -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);
9 changes: 9 additions & 0 deletions patches.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3df097f

Please sign in to comment.