1
0
Fork 0

wayland: Always use logical pixels for bounds

This fixes that with scale-monitor-framebuffer disabled, windows were always
configured with bounds using physical instead of logical pixels.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3269

Co-authored-by: Jonas Ådahl <jadahl@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3698>
This commit is contained in:
Sophie Herold 2024-04-12 13:22:17 +02:00 committed by Marge Bot
parent 454a70cce5
commit d36afd32d7
3 changed files with 10 additions and 4 deletions

View file

@ -100,14 +100,15 @@ meta_wayland_window_configuration_new_relative (MetaWindow *window,
MetaWaylandWindowConfiguration *
meta_wayland_window_configuration_new_empty (int bounds_width,
int bounds_height)
int bounds_height,
int scale)
{
MetaWaylandWindowConfiguration *configuration;
configuration = g_new0 (MetaWaylandWindowConfiguration, 1);
*configuration = (MetaWaylandWindowConfiguration) {
.serial = ++global_serial_counter,
.scale = 1,
.scale = scale,
.bounds_width = bounds_width,
.bounds_height = bounds_height,
};

View file

@ -68,6 +68,7 @@ MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_relative
int scale);
MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_empty (int bounds_width,
int bounds_height);
int bounds_height,
int scale);
void meta_wayland_window_configuration_free (MetaWaylandWindowConfiguration *configuration);

View file

@ -869,6 +869,9 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandWindowConfiguration *configuration;
int bounds_width;
int bounds_height;
int geometry_scale;
geometry_scale = meta_window_wayland_get_geometry_scale (window);
if (!meta_window_calculate_bounds (window, &bounds_width, &bounds_height))
{
@ -878,7 +881,8 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role,
configuration =
meta_wayland_window_configuration_new_empty (bounds_width,
bounds_height);
bounds_height,
geometry_scale);
meta_wayland_xdg_toplevel_send_configure (xdg_toplevel, configuration);
meta_wayland_window_configuration_free (configuration);
return;