Skip to content

Feature request: _IS_FLOATING patch #50

@B4rc1

Description

@B4rc1

A patch, that adds a _IS_FLOATING xproperty for floating windows,
so you can add compositor rules accordingly, for example (with a picom fork with rounded corners) adding this to your picom.conf

rounded-corners-exclude = [ "! _IS_FLOATING@:32c = 1" ];

rounds all floating windows

patch:

diff --git a/dwm.c b/dwm.c
index 664c527..2e05488 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1075,6 +1075,10 @@ manage(Window w, XWindowAttributes *wa)
 	arrange(c->mon);
 	XMapWindow(dpy, c->win);
 	focus(NULL);
+
+	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
@@ -1720,6 +1724,10 @@ togglefloating(const Arg *arg)
 		resize(selmon->sel, selmon->sel->x, selmon->sel->y,
 			selmon->sel->w, selmon->sel->h, 0);
 	arrange(selmon);
+
+	Atom target = XInternAtom(dpy, "_IS_FLOATING", 0);
+	unsigned int floating[1] = {selmon->sel->isfloating};
+    XChangeProperty(dpy, selmon->sel->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1);
 }
 
 v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions