aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-11-26 00:51:50 +0300
committerSimon Ser <contact@emersion.fr>2023-11-27 09:46:11 +0000
commit4990ed99ebc8eeb508e0077f620ec2df781fabdb (patch)
treec5a3b833f9f4e8c9bd14af80389612c9f8242a24 /backend
parent4102b722d9812dbdc6bc0a8cb816e429d4533424 (diff)
backend/x11: don't send ConfigureRequest with the same size
Under X11, ConfigureNotify means that the window has already been resized. Sending ConfigureRequest with the received size is not only useless, but also can confuse the window manager, which will probably reply with the current (i.e. *old*) size causing a configure loop. Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3769
Diffstat (limited to 'backend')
-rw-r--r--backend/x11/output.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 585e037a..58c90a89 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -63,6 +63,10 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
+ if (width == output->win_width && height == output->win_height) {
+ return true;
+ }
+
const uint32_t values[] = { width, height };
xcb_void_cookie_t cookie = xcb_configure_window_checked(
x11->xcb, output->win,
@@ -76,6 +80,9 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
return false;
}
+ output->win_width = width;
+ output->win_height = height;
+
// Move the pointer to its new location
update_x11_pointer_position(output, output->x11->time);
@@ -598,6 +605,9 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
x11->screen->root, 0, 0, wlr_output->width, wlr_output->height, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT, x11->visualid, mask, values);
+ output->win_width = wlr_output->width;
+ output->win_height = wlr_output->height;
+
struct {
xcb_input_event_mask_t head;
xcb_input_xi_event_mask_t mask;
@@ -659,6 +669,9 @@ void handle_x11_configure_notify(struct wlr_x11_output *output,
return;
}
+ output->win_width = ev->width;
+ output->win_height = ev->height;
+
struct wlr_output_state state;
wlr_output_state_init(&state);
wlr_output_state_set_custom_mode(&state, ev->width, ev->height, 0);