aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-30 03:28:42 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-30 03:28:42 -0400
commit21c4112cf12e3aa0e83170ca87100917eeeb3374 (patch)
tree2f1e0b965eb5cf329eeef8127c900964163e2bff /src/window-xlib.c
parent59be0a78dff68ee4a2fc29e33705fbc0c8b6c850 (diff)
downloadrunes-21c4112cf12e3aa0e83170ca87100917eeeb3374.tar.gz
runes-21c4112cf12e3aa0e83170ca87100917eeeb3374.zip
implement window resizing (again)
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r--src/window-xlib.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c
index fc6f0f0..7325595 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -215,7 +215,7 @@ void runes_window_backend_start_loop(RunesTerm *t)
void *data;
XGetICValues(w->ic, XNFilterEvents, &mask, NULL);
- XSelectInput(w->dpy, w->border_w, mask|KeyPressMask);
+ XSelectInput(w->dpy, w->border_w, mask|KeyPressMask|StructureNotifyMask);
XSelectInput(
w->dpy, w->w,
mask|KeyPressMask|ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|PointerMotionHintMask|EnterWindowMask|LeaveWindowMask|StructureNotifyMask|ExposureMask|FocusChangeMask);
@@ -414,8 +414,9 @@ static void runes_window_backend_resize_window(
}
if (width != t->xpixel || height != t->ypixel) {
+ XResizeWindow(w->dpy, w->w, width - 4, height - 4);
cairo_xlib_surface_set_size(
- cairo_get_target(w->backend_cr), width, height);
+ cairo_get_target(w->backend_cr), width - 4, height - 4);
runes_display_set_window_size(t);
}
}
@@ -738,7 +739,12 @@ static void runes_window_backend_handle_configure_event(
{
RunesWindowBackend *w = &t->w;
- while (XCheckTypedWindowEvent(w->dpy, w->w, ConfigureNotify, (XEvent *)e));
+ if (e->window != w->border_w) {
+ return;
+ }
+
+ while (XCheckTypedWindowEvent(
+ w->dpy, w->border_w, ConfigureNotify, (XEvent *)e));
runes_window_backend_resize_window(t, e->width, e->height);
}