Guest User

imbadatc

a guest
Sep 1st, 2023
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | Source Code | 0 0
  1. From 708242a473b83a3b399f778ffc5fe7d1358295af Mon Sep 17 00:00:00 2001
  2. From: bakkeby <[email protected]>
  3. Date: Tue, 18 May 2021 09:41:13 +0200
  4. Subject: [PATCH] dock windows patch
  5.  
  6. New windows that have the _NET_WM_WINDOW_TYPE_DOCK window type
  7. will not be managed by dwm.
  8.  
  9. This will apply to any application setting its window type hint to DOCK.
  10. ---
  11. dwm.c | 10 ++++++++++
  12.  1 file changed, 10 insertions(+)
  13.  
  14. diff --git a/dwm.c b/dwm.c
  15. index 4465af1..34a95ce 100644
  16. --- a/dwm.c
  17. +++ b/dwm.c
  18. @@ -62,6 +62,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
  19.  enum { SchemeNorm, SchemeSel }; /* color schemes */
  20.  enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
  21.         NetWMFullscreen, NetActiveWindow, NetWMWindowType,
  22. +       NetWMWindowTypeDock,
  23.         NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
  24.  enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
  25.  enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
  26. @@ -1023,6 +1024,14 @@ manage(Window w, XWindowAttributes *wa)
  27.  
  28.     c = ecalloc(1, sizeof(Client));
  29.     c->win = w;
  30. +
  31. +   if (getatomprop(c, netatom[NetWMWindowType]) == netatom[NetWMWindowTypeDock]) {
  32. +       XMapWindow(dpy, c->win);
  33. +       XLowerWindow(dpy, c->win);
  34. +       free(c);
  35. +       return;
  36. +   }
  37. +
  38.     /* geometry */
  39.     c->x = c->oldx = wa->x;
  40.     c->y = c->oldy = wa->y;
  41. @@ -1561,6 +1570,7 @@ setup(void)
  42.     netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
  43.     netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
  44.     netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
  45. +   netatom[NetWMWindowTypeDock] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False);
  46.     netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
  47.     /* init cursors */
  48.     cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
  49. --
  50. 2.19.1
  51.  
Tags: dwm patch
Advertisement
Add Comment
Please, Sign In to add comment