dwm-nocornermonocle-20260112-1dcbe74.diff (2369B)
1 From 1dcbe74def11a2e330e8972114bb5f6759d22663 Mon Sep 17 00:00:00 2001 2 From: Savar <savar95x@gmail.com> 3 Date: Mon, 12 Jan 2026 17:30:21 +0530 4 Subject: [PATCH] nocornermonocle: added EWMH support for monocle layout, 5 allowing users to disable corners in monocle while using picom 6 7 --- 8 dwm.c | 22 ++++++++++++++++++++++ 9 1 file changed, 22 insertions(+) 10 11 diff --git a/dwm.c b/dwm.c 12 index 8f4fa75..4030b04 100644 13 --- a/dwm.c 14 +++ b/dwm.c 15 @@ -61,6 +61,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 16 enum { SchemeNorm, SchemeSel }; /* color schemes */ 17 enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 18 NetWMFullscreen, NetActiveWindow, NetWMWindowType, 19 + NetWMMaximizedVert, NetWMMaximizedHorz, /* -> no corner monocle */ 20 NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 21 enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 22 enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 23 @@ -388,6 +389,25 @@ arrange(Monitor *m) 24 if (m) { 25 arrangemon(m); 26 restack(m); 27 + 28 + /* no corner monocle */ 29 + Client *c; 30 + int isMonocle = (m->lt[m->sellt]->arrange == monocle); 31 + Atom data[2] = { netatom[NetWMMaximizedVert], netatom[NetWMMaximizedHorz] }; 32 + 33 + for (c = m->clients; c; c = c->next) { 34 + if (!ISVISIBLE(c)) continue; 35 + if (c->isfullscreen) continue; 36 + 37 + if (isMonocle) { /* set */ 38 + XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, 39 + PropModeReplace, (unsigned char *)data, 2); 40 + } else { /* delete */ 41 + XDeleteProperty(dpy, c->win, netatom[NetWMState]); 42 + } 43 + } 44 + /* end of no corner monocle logic */ 45 + 46 } else for (m = mons; m; m = m->next) 47 arrangemon(m); 48 } 49 @@ -1577,6 +1597,8 @@ setup(void) 50 netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); 51 netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 52 netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 53 + netatom[NetWMMaximizedVert] = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_VERT", False); /* no corner monocle */ 54 + netatom[NetWMMaximizedHorz] = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", False); 55 netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 56 netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 57 /* init cursors */ 58 -- 59 2.51.2 60