aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Roman2021-01-07 21:35:21 +0200
committerGitHub2021-01-07 21:35:21 +0200
commiteddf3fd29be96d9a4430a92e0d6e788fd67f3523 (patch)
treefc9bfaca42e78eff2a9c9d0f8ea86fac6bbfa7fd
parentaaf9d5cd538e8e68d93f4c6b1f96ca825bcefee3 (diff)
parent6d20e439d80ec1f3f063f35b4fa6425166d8d3de (diff)
downloadruler-eddf3fd29be96d9a4430a92e0d6e788fd67f3523.tar.gz
ruler-eddf3fd29be96d9a4430a92e0d6e788fd67f3523.zip
Merge pull request #4 from neyuki/master
Fixes for the latest version of libwm (Fixes #3)
-rw-r--r--config.mk2
-rw-r--r--ruler.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/config.mk b/config.mk
index 97eb50c..1e771b1 100644
--- a/config.mk
+++ b/config.mk
@@ -3,4 +3,4 @@ MANPREFIX = $(PREFIX)/share/man
MANDIR = $(MANPREFIX)/man1
CFLAGS += -std=c99 -Wall -g -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500
-LDFLAGS += -lxcb -lxcb-ewmh -lxcb-icccm -lwm
+LDFLAGS += -lxcb -lxcb-ewmh -lxcb-icccm -lwm -lxcb-randr -lxcb-cursor
diff --git a/ruler.c b/ruler.c
index aa1eef1..9d8c544 100644
--- a/ruler.c
+++ b/ruler.c
@@ -10,6 +10,7 @@
#include <sys/wait.h>
#include <sys/select.h>
#include <xcb/xcb.h>
+#include <xcb/randr.h>
#include <xcb/xcb_icccm.h>
#include <xcb/xcb_ewmh.h>
#include <wm.h>
@@ -681,7 +682,7 @@ register_events(void)
len = wm_get_windows(scrn->root, &windows);
for (i = 0; i < len; i++) {
if (wm_is_listable(windows[i], 0))
- wm_reg_event(windows[i], XCB_EVENT_MASK_PROPERTY_CHANGE);
+ wm_reg_window_event(windows[i], XCB_EVENT_MASK_PROPERTY_CHANGE);
}
free(windows);
}
@@ -707,7 +708,7 @@ handle_events(void)
fd_set descs;
/* to receive window creation notifications */
- wm_reg_event(scrn->root, XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY);
+ wm_reg_window_event(scrn->root, XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY);
xcb_flush(conn);
state_run = 1;
@@ -743,7 +744,7 @@ handle_events(void)
/* we need to get notified for further property changes */
if (conf.exec_on_prop_change) {
- wm_reg_event(ec->window, XCB_EVENT_MASK_PROPERTY_CHANGE);
+ wm_reg_window_event(ec->window, XCB_EVENT_MASK_PROPERTY_CHANGE);
}
}
} else if (conf.exec_on_prop_change && (ev->response_type & ~0x80) == XCB_PROPERTY_NOTIFY) {
@@ -958,9 +959,9 @@ main(int argc, char **argv)
}
}
- if (wm_init_xcb() == 0)
+ if (wm_init_xcb() == -1)
errx(1, "error while estabilishing connection to the X server");
- if (wm_get_screen() == 0)
+ if (wm_get_screen() == -1)
errx(1, "couldn't get X screen");
init_ewmh();