mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
wayland: Fetch wl_output logical monitor via helper
Will be useful when wl_output gets tied to a MetaMonitor, instead of a MetaLogicalMonitor. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1712>
This commit is contained in:
parent
99531f9d4b
commit
2b59b85d85
@ -438,9 +438,17 @@ zxdg_toplevel_v6_set_fullscreen (struct wl_client *client,
|
||||
|
||||
if (output_resource)
|
||||
{
|
||||
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
|
||||
if (output && output->logical_monitor)
|
||||
meta_window_move_to_monitor (window, output->logical_monitor->number);
|
||||
MetaWaylandOutput *wayland_output;
|
||||
|
||||
wayland_output = wl_resource_get_user_data (output_resource);
|
||||
if (wayland_output)
|
||||
{
|
||||
MetaLogicalMonitor *logical_monitor;
|
||||
|
||||
logical_monitor =
|
||||
meta_wayland_output_get_logical_monitor (wayland_output);
|
||||
meta_window_move_to_monitor (window, logical_monitor->number);
|
||||
}
|
||||
}
|
||||
|
||||
meta_window_make_fullscreen (window);
|
||||
|
@ -63,6 +63,12 @@ meta_wayland_output_get_resources (MetaWaylandOutput *wayland_output)
|
||||
return wayland_output->resources;
|
||||
}
|
||||
|
||||
MetaLogicalMonitor *
|
||||
meta_wayland_output_get_logical_monitor (MetaWaylandOutput *wayland_output)
|
||||
{
|
||||
return wayland_output->logical_monitor;
|
||||
}
|
||||
|
||||
static void
|
||||
output_resource_destroy (struct wl_resource *res)
|
||||
{
|
||||
|
@ -52,6 +52,8 @@ struct _MetaWaylandOutput
|
||||
|
||||
const GList * meta_wayland_output_get_resources (MetaWaylandOutput *wayland_output);
|
||||
|
||||
MetaLogicalMonitor * meta_wayland_output_get_logical_monitor (MetaWaylandOutput *wayland_output);
|
||||
|
||||
void meta_wayland_outputs_init (MetaWaylandCompositor *compositor);
|
||||
|
||||
#endif /* META_WAYLAND_OUTPUTS_H */
|
||||
|
@ -1368,7 +1368,7 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
|
||||
|
||||
g_assert (surface->role);
|
||||
|
||||
logical_monitor = wayland_output->logical_monitor;
|
||||
logical_monitor = meta_wayland_output_get_logical_monitor (wayland_output);
|
||||
if (!logical_monitor)
|
||||
{
|
||||
set_surface_is_on_output (surface, wayland_output, FALSE);
|
||||
|
@ -461,12 +461,16 @@ xdg_toplevel_set_fullscreen (struct wl_client *client,
|
||||
|
||||
if (output_resource)
|
||||
{
|
||||
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
|
||||
MetaWaylandOutput *wayland_output;
|
||||
|
||||
if (output && output->logical_monitor)
|
||||
wayland_output = wl_resource_get_user_data (output_resource);
|
||||
if (wayland_output)
|
||||
{
|
||||
meta_window_move_to_monitor (window,
|
||||
output->logical_monitor->number);
|
||||
MetaLogicalMonitor *logical_monitor;
|
||||
|
||||
logical_monitor =
|
||||
meta_wayland_output_get_logical_monitor (wayland_output);
|
||||
meta_window_move_to_monitor (window, logical_monitor->number);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user