mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-30 21:37:43 +08:00
wayland: Adjust the scaled popup position even if the dimensions didn't change
Otherwise, the unscaled position will be sent.
This commit is contained in:
@@ -1042,18 +1042,21 @@ static void handle_configure_xdg_popup(void *data,
|
|||||||
wind->requested.logical_height = height;
|
wind->requested.logical_height = height;
|
||||||
|
|
||||||
if (wind->scale_to_display) {
|
if (wind->scale_to_display) {
|
||||||
x = PointToPixel(wind->sdlwindow->parent, x);
|
|
||||||
y = PointToPixel(wind->sdlwindow->parent, y);
|
|
||||||
wind->requested.pixel_width = PointToPixel(wind->sdlwindow, width);
|
wind->requested.pixel_width = PointToPixel(wind->sdlwindow, width);
|
||||||
wind->requested.pixel_height = PointToPixel(wind->sdlwindow, height);
|
wind->requested.pixel_height = PointToPixel(wind->sdlwindow, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wind->last_configure.width = width;
|
if (wind->scale_to_display) {
|
||||||
wind->last_configure.height = height;
|
x = PointToPixel(wind->sdlwindow->parent, x);
|
||||||
|
y = PointToPixel(wind->sdlwindow->parent, y);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_SendWindowEvent(wind->sdlwindow, SDL_EVENT_WINDOW_MOVED, x, y);
|
SDL_SendWindowEvent(wind->sdlwindow, SDL_EVENT_WINDOW_MOVED, x, y);
|
||||||
|
|
||||||
|
wind->last_configure.width = width;
|
||||||
|
wind->last_configure.height = height;
|
||||||
|
|
||||||
if (wind->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
|
if (wind->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
|
||||||
wind->shell_surface_status = WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_FRAME;
|
wind->shell_surface_status = WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_FRAME;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user