aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-13 15:02:51 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-13 15:02:51 -0400
commit563db15f881207a49f85df5b9358dabb6a8826c8 (patch)
tree8bfd7f356d602720b791a2832182b2dbf7a37b4f /window-xlib.c
parent28f813cb5a8daa4641dc1afdbf1545da709729a6 (diff)
downloadrunes-563db15f881207a49f85df5b9358dabb6a8826c8.tar.gz
runes-563db15f881207a49f85df5b9358dabb6a8826c8.zip
change cursor display based on if the window has focus or not
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/window-xlib.c b/window-xlib.c
index a8e4029..8ed74ac 100644
--- a/window-xlib.c
+++ b/window-xlib.c
@@ -109,7 +109,8 @@ void runes_window_backend_loop_init(RunesTerm *t, int argc, char *argv[])
XGetICValues(w->ic, XNFilterEvents, &mask, NULL);
XSelectInput(
- w->dpy, w->w, mask|KeyPressMask|StructureNotifyMask|ExposureMask);
+ w->dpy, w->w,
+ mask|KeyPressMask|StructureNotifyMask|ExposureMask|FocusChangeMask);
XSetICFocus(w->ic);
data = malloc(sizeof(RunesXlibLoopData));
@@ -285,6 +286,14 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
runes_window_backend_resize_window(
t, e->xconfigure.width, e->xconfigure.height);
break;
+ case FocusIn:
+ runes_display_focus_in(t);
+ runes_window_backend_flush(t);
+ break;
+ case FocusOut:
+ runes_display_focus_out(t);
+ runes_window_backend_flush(t);
+ break;
case ClientMessage: {
Atom a = e->xclient.data.l[0];
if (a == w->atoms[RUNES_ATOM_WM_DELETE_WINDOW]) {