Skip to content

Commit

Permalink
Added support for additional docks, toolbars, and utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
JLErvin committed Aug 28, 2018
1 parent 9f65b97 commit e8fea83
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Type=XSession
Arch Linux users can download via the AUR: [berry](https://aur.archlinux.org/packages/berry-git/)

```bash
yay -S berry
yay -S berry-git
```

# Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.4
0.0.5
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __CONFIG_NAME__ = autostart
__THIS_VERSION__ = $(shell cat VERSION)

PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
MANPREFIX = $(PREFIX)/man
MANDIR = $(MANPREFIX)/man1
DOCPREFIX = $(PREFIX)/share/doc
X11INC = /usr/X11R6/include
Expand Down
38 changes: 38 additions & 0 deletions wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ enum AtomsNet
NetWMState,
NetWMName,
NetClientList,
NetWMWindowType,
NetWMWindowTypeMenu,
NetWMWindowTypeToolbar,
NetWMWindowTypeDock,
NetWMWindowTypeDialog,
NetWMWindowTypeUtility,
NetWMWindowTypeSplash,
NetLast
};

Expand Down Expand Up @@ -779,6 +786,32 @@ manage_client_focus(struct Client *c)
static void
manage_new_window(Window w, XWindowAttributes *wa)
{
/* Credits to vain for XGWP checking */
Atom prop, da;
unsigned char *prop_ret = NULL;
int di;
unsigned long dl;
if (XGetWindowProperty(display, w, net_atom[NetWMWindowType], 0,
sizeof (Atom), False, XA_ATOM, &da, &di, &dl, &dl,
&prop_ret) == Success)
{
if (prop_ret)
{
prop = ((Atom *)prop_ret)[0];
if (prop == net_atom[NetWMWindowTypeDock] ||
prop == net_atom[NetWMWindowTypeToolbar] ||
prop == net_atom[NetWMWindowTypeUtility] ||
prop == net_atom[NetWMWindowTypeMenu])
{
fprintf(stderr, "Window is of type dock, toolbar, utility, or menu: not managing\n");
fprintf(stderr, "Mapping new window, not managed\n");
XMapWindow(display, w);
return;
}
}
}


struct Client *c;
c = malloc(sizeof(struct Client));
c->win = w;
Expand Down Expand Up @@ -1025,6 +1058,11 @@ setup(void)
net_atom[NetWMState] = XInternAtom(display, "_NET_WM_STATE", False);
net_atom[NetWMName] = XInternAtom(display, "_NET_WM_NAME", False);
net_atom[NetClientList] = XInternAtom(display, "_NET_CLIENT_LIST", False);
net_atom[NetWMWindowType] = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
net_atom[NetWMWindowTypeDock] = XInternAtom(display, "_NET_WM_WINDOW_TYPE_DOCK", False);
net_atom[NetWMWindowTypeToolbar] = XInternAtom(display, "_NET_WM_WINDOW_TYPE_TOOLBAR", False);
net_atom[NetWMWindowTypeMenu] = XInternAtom(display, "_NET_WM_WINDOW_TYPE_MENU", False);
net_atom[NetWMWindowTypeSplash] = XInternAtom(display, "_NET_WM_WINDOW_TYPE_SPLASH", False);
/* Some icccm atoms */
wm_atom[WMDeleteWindow] = XInternAtom(display, "WM_DELETE_WINDOW", False);
wm_atom[WMProtocols] = XInternAtom(display, "WM_PROTOCOLS", False);
Expand Down

0 comments on commit e8fea83

Please sign in to comment.