mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
backend/wayland: Request new configure size on xdg surface configure
This commit is contained in:
parent
78a09573af
commit
bd68e06c23
2 changed files with 21 additions and 10 deletions
|
|
@ -724,7 +724,20 @@ static void xdg_surface_handle_configure(void *data,
|
||||||
output->configured = true;
|
output->configured = true;
|
||||||
xdg_surface_ack_configure(xdg_surface, serial);
|
xdg_surface_ack_configure(xdg_surface, serial);
|
||||||
|
|
||||||
// nothing else?
|
if (output->toplevel_configured) {
|
||||||
|
output->toplevel_configured = false;
|
||||||
|
|
||||||
|
int32_t width = output->toplevel_configure_width;
|
||||||
|
int32_t height = output->toplevel_configure_height;
|
||||||
|
|
||||||
|
if (width > 0 && height > 0) {
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_custom_mode(&state, width, height, 0);
|
||||||
|
wlr_output_send_request_state(&output->wlr_output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct xdg_surface_listener xdg_surface_listener = {
|
static const struct xdg_surface_listener xdg_surface_listener = {
|
||||||
|
|
@ -737,15 +750,9 @@ static void xdg_toplevel_handle_configure(void *data,
|
||||||
struct wlr_wl_output *output = data;
|
struct wlr_wl_output *output = data;
|
||||||
assert(output && output->xdg_toplevel == xdg_toplevel);
|
assert(output && output->xdg_toplevel == xdg_toplevel);
|
||||||
|
|
||||||
if (width == 0 || height == 0) {
|
output->toplevel_configured = true;
|
||||||
return;
|
output->toplevel_configure_width = width;
|
||||||
}
|
output->toplevel_configure_height = height;
|
||||||
|
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_custom_mode(&state, width, height, 0);
|
|
||||||
wlr_output_send_request_state(&output->wlr_output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xdg_toplevel_handle_close(void *data,
|
static void xdg_toplevel_handle_close(void *data,
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,10 @@ struct wlr_wl_output {
|
||||||
bool configured;
|
bool configured;
|
||||||
uint32_t enter_serial;
|
uint32_t enter_serial;
|
||||||
|
|
||||||
|
bool toplevel_configured;
|
||||||
|
int32_t toplevel_configure_width;
|
||||||
|
int32_t toplevel_configure_height;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wlr_wl_pointer *pointer;
|
struct wlr_wl_pointer *pointer;
|
||||||
struct wl_surface *surface;
|
struct wl_surface *surface;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue