sowm: turns out we can't pass 0 as an error handler. :P

This commit is contained in:
Dylan Araps 2019-10-17 09:40:24 +03:00
parent 60d88980fb
commit 3662ca427d
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
2 changed files with 4 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<a href="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg"><img src="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg" width="43%" align="right"></a>
An itsy bitsy floating window manager (*260~ sloc / 24kb compiled!*).
An itsy bitsy floating window manager (*250~ sloc / 24kb compiled!*).
- Floating only.
- Fullscreen toggle.

5
sowm.c
View File

@ -50,6 +50,7 @@ static void win_to_ws(const Arg arg);
static void ws_go(const Arg arg);
static void ws_save(int i);
static void ws_sel(int i);
static int xerror() { return 0;}
static client *list = {0};
static desktop ws_list[10];
@ -495,7 +496,7 @@ void configure_request(XEvent *e) {
void map_request(XEvent *e) {
Window w = e->xmaprequest.window;
XSelectInput(d, w, StructureNotifyMask|EnterWindowMask|LeaveWindowMask);
XSelectInput(d, w, StructureNotifyMask|EnterWindowMask);
win_center((Arg){.i = w});
XMapWindow(d, w);
@ -532,7 +533,7 @@ int main(void) {
if (!(d = XOpenDisplay(0x0))) return 0;
signal(SIGCHLD, SIG_IGN);
XSetErrorHandler(0);
XSetErrorHandler(xerror);
int s = DefaultScreen(d);
root = RootWindow(d, s);