Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: _IS_FLOATING patch #50

Closed
B4rc1 opened this issue Sep 27, 2020 · 1 comment
Closed

Feature request: _IS_FLOATING patch #50

B4rc1 opened this issue Sep 27, 2020 · 1 comment

Comments

@B4rc1
Copy link

B4rc1 commented Sep 27, 2020

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
@bakkeby
Copy link
Owner

bakkeby commented Sep 28, 2020

This works nicely. I ended up embedding this with the ewmhtags patch (which I had given the bar_ prefix as it only added hints related to the bar. I may remove that prefix later on, but left it as-is for now). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants