diff options
author | sdilts <stuart.dilts@gmail.com> | 2018-08-09 22:09:48 -0600 |
---|---|---|
committer | sdilts <stuart.dilts@gmail.com> | 2018-08-09 22:09:48 -0600 |
commit | da79fef5f7d3fc7a27b5813e2e94bcf28b54da8b (patch) | |
tree | 8fca965e232396b5c9142653023f3ba7df3d1cf6 /backend | |
parent | 55cca6deaa4813a407cfecccf21478671a96d11e (diff) |
Add guard for changing the size of X11 backend windows
Events that set the window to either a width or height of zero are now
ignored and logged.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/x11/output.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c index 3be63d5f..867a3594 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -190,11 +190,17 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { void handle_x11_configure_notify(struct wlr_x11_output *output, xcb_configure_notify_event_t *ev) { - wlr_output_update_custom_mode(&output->wlr_output, ev->width, - ev->height, output->wlr_output.refresh); - - // Move the pointer to its new location - update_x11_pointer_position(output, output->x11->time); + // ignore events that set an invalid size: + if (ev->width > 0 && ev->height > 0) { + wlr_output_update_custom_mode(&output->wlr_output, ev->width, + ev->height, output->wlr_output.refresh); + + // Move the pointer to its new location + update_x11_pointer_position(output, output->x11->time); + } else { + wlr_log(WLR_DEBUG,"Ignoring X11 configure event for height=%d, width=%d", + ev->width, ev->height); + } } bool wlr_output_is_x11(struct wlr_output *wlr_output) { |