wayland/xdg-shell: Add toplevel bounds support
This implements the new 'bounds' event that is part of the xdg_toplevel interface in the xdg-shell protocol. It aims to let clients create "good" default window sizes that depends on e.g. the resolution of the monitor the window will be mapped on, whether there are panels taking up space, and things like that. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2167>
This commit is contained in:
@ -43,6 +43,8 @@ is_window_size_fixed (MetaWindow *window)
|
||||
MetaWaylandWindowConfiguration *
|
||||
meta_wayland_window_configuration_new (MetaWindow *window,
|
||||
MetaRectangle rect,
|
||||
int bounds_width,
|
||||
int bounds_height,
|
||||
int scale,
|
||||
MetaMoveResizeFlags flags,
|
||||
MetaGravity gravity)
|
||||
@ -53,6 +55,9 @@ meta_wayland_window_configuration_new (MetaWindow *window,
|
||||
*configuration = (MetaWaylandWindowConfiguration) {
|
||||
.serial = ++global_serial_counter,
|
||||
|
||||
.bounds_width = bounds_width,
|
||||
.bounds_height = bounds_height,
|
||||
|
||||
.scale = scale,
|
||||
.gravity = gravity,
|
||||
.flags = flags,
|
||||
@ -108,7 +113,8 @@ meta_wayland_window_configuration_new_relative (int rel_x,
|
||||
}
|
||||
|
||||
MetaWaylandWindowConfiguration *
|
||||
meta_wayland_window_configuration_new_empty (void)
|
||||
meta_wayland_window_configuration_new_empty (int bounds_width,
|
||||
int bounds_height)
|
||||
{
|
||||
MetaWaylandWindowConfiguration *configuration;
|
||||
|
||||
@ -116,6 +122,8 @@ meta_wayland_window_configuration_new_empty (void)
|
||||
*configuration = (MetaWaylandWindowConfiguration) {
|
||||
.serial = ++global_serial_counter,
|
||||
.scale = 1,
|
||||
.bounds_width = bounds_width,
|
||||
.bounds_height = bounds_height,
|
||||
};
|
||||
|
||||
return configuration;
|
||||
|
Reference in New Issue
Block a user