mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
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
This commit is contained in:
parent
4102b722d9
commit
4990ed99eb
@ -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);
|
||||
|
@ -35,6 +35,8 @@ struct wlr_x11_output {
|
||||
xcb_window_t win;
|
||||
xcb_present_event_t present_event_id;
|
||||
|
||||
int32_t win_width, win_height;
|
||||
|
||||
struct wlr_pointer pointer;
|
||||
|
||||
struct wlr_touch touch;
|
||||
|
Loading…
Reference in New Issue
Block a user