diff options
author | Simon Ser <contact@emersion.fr> | 2021-01-28 18:10:56 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-15 15:39:55 +0000 |
commit | 3ef68a484243555b020200c6f95246d994932c3f (patch) | |
tree | 474d8f33011b5d72f81cace15ec887d4e51117f8 /backend | |
parent | 756ecf8ee9f1e75bc7b8297dc84f97c7d699174b (diff) |
backend/x11: use request_state when window is resized
Diffstat (limited to 'backend')
-rw-r--r-- | backend/x11/output.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c index 7ea0459a..052e4119 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -74,6 +74,11 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output, return false; } + wlr_output_update_custom_mode(&output->wlr_output, width, height, 0); + + // Move the pointer to its new location + update_x11_pointer_position(output, output->x11->time); + return true; } @@ -606,7 +611,6 @@ 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) { - // ignore events that set an invalid size: if (ev->width == 0 || ev->height == 0) { wlr_log(WLR_DEBUG, "Ignoring X11 configure event for height=%d, width=%d", @@ -614,11 +618,12 @@ void handle_x11_configure_notify(struct wlr_x11_output *output, return; } - wlr_output_update_custom_mode(&output->wlr_output, ev->width, - ev->height, 0); - - // Move the pointer to its new location - update_x11_pointer_position(output, output->x11->time); + struct wlr_output_state state = { + .committed = WLR_OUTPUT_STATE_MODE, + .mode_type = WLR_OUTPUT_STATE_MODE_CUSTOM, + .custom_mode = { .width = ev->width, .height = ev->height }, + }; + wlr_output_send_request_state(&output->wlr_output, &state); } bool wlr_output_is_x11(struct wlr_output *wlr_output) { |