2014-04-22 22:03:40 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Red Hat
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Written by:
|
|
|
|
* Jasper St. Pierre <jstpierre@mecheye.net>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "wayland/meta-wayland-outputs.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2016-12-13 02:37:11 +00:00
|
|
|
#include "backends/meta-logical-monitor.h"
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "backends/meta-monitor.h"
|
|
|
|
#include "backends/meta-monitor-manager-private.h"
|
|
|
|
#include "wayland/meta-wayland-private.h"
|
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
#include "xdg-output-unstable-v1-server-protocol.h"
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2019-07-25 12:12:46 +00:00
|
|
|
/* Wayland protocol headers list new additions, not deprecations */
|
|
|
|
#define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3
|
2014-04-26 08:27:34 +00:00
|
|
|
|
2018-12-19 08:04:25 +00:00
|
|
|
enum
|
|
|
|
{
|
wayland: Send wl_surface.enter and wl_surface.leave
Whenever a MetaSurfaceActor is painted, update the list of what outputs
the surface is being drawed upon. Since we do this on paint, we
effectively avoids this whenever the surface is not drawn, for example
being minimized, on a non-active workspace, or simply outside of the
damage region of a frame.
DND icons and cursors are not affected by this patch, since they are not
drawn as MetaSurfaceActors. If a MetaSurfaceActor or a parent is cloned,
then we'll check the position of the original actor again when the clone is
drawn, which is slightly expensive, but harmless. If the MetaShapedTexture
instead is cloned, as GNOME Shell does in many cases, then these clones
will not cause duplicate position checks.
https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-02-03 07:49:52 +00:00
|
|
|
OUTPUT_DESTROYED,
|
2020-03-09 11:33:17 +00:00
|
|
|
OUTPUT_BOUND,
|
wayland: Send wl_surface.enter and wl_surface.leave
Whenever a MetaSurfaceActor is painted, update the list of what outputs
the surface is being drawed upon. Since we do this on paint, we
effectively avoids this whenever the surface is not drawn, for example
being minimized, on a non-active workspace, or simply outside of the
damage region of a frame.
DND icons and cursors are not affected by this patch, since they are not
drawn as MetaSurfaceActors. If a MetaSurfaceActor or a parent is cloned,
then we'll check the position of the original actor again when the clone is
drawn, which is slightly expensive, but harmless. If the MetaShapedTexture
instead is cloned, as GNOME Shell does in many cases, then these clones
will not cause duplicate position checks.
https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-02-03 07:49:52 +00:00
|
|
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
static guint signals[LAST_SIGNAL];
|
|
|
|
|
2021-02-05 15:47:33 +00:00
|
|
|
struct _MetaWaylandOutput
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
|
|
|
|
struct wl_global *global;
|
|
|
|
uint32_t mode_flags;
|
|
|
|
float refresh_rate;
|
|
|
|
int scale;
|
2018-11-26 18:59:37 +00:00
|
|
|
MetaMonitorTransform transform;
|
2021-02-05 15:47:33 +00:00
|
|
|
int mode_width;
|
|
|
|
int mode_height;
|
|
|
|
|
|
|
|
GList *resources;
|
|
|
|
GList *xdg_output_resources;
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor;
|
2021-02-05 15:47:33 +00:00
|
|
|
};
|
|
|
|
|
2015-04-17 09:17:46 +00:00
|
|
|
G_DEFINE_TYPE (MetaWaylandOutput, meta_wayland_output, G_TYPE_OBJECT)
|
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
static void
|
|
|
|
send_xdg_output_events (struct wl_resource *resource,
|
|
|
|
MetaWaylandOutput *wayland_output,
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor,
|
2017-09-05 16:53:41 +00:00
|
|
|
gboolean need_all_events,
|
|
|
|
gboolean *pending_done_event);
|
|
|
|
|
2021-02-05 15:38:31 +00:00
|
|
|
const GList *
|
|
|
|
meta_wayland_output_get_resources (MetaWaylandOutput *wayland_output)
|
|
|
|
{
|
|
|
|
return wayland_output->resources;
|
|
|
|
}
|
|
|
|
|
2021-02-05 15:46:43 +00:00
|
|
|
MetaLogicalMonitor *
|
|
|
|
meta_wayland_output_get_logical_monitor (MetaWaylandOutput *wayland_output)
|
|
|
|
{
|
2021-02-05 16:22:30 +00:00
|
|
|
return meta_monitor_get_logical_monitor (wayland_output->monitor);
|
2021-02-05 15:46:43 +00:00
|
|
|
}
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
static void
|
|
|
|
output_resource_destroy (struct wl_resource *res)
|
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output;
|
|
|
|
|
|
|
|
wayland_output = wl_resource_get_user_data (res);
|
2015-07-01 05:18:45 +00:00
|
|
|
if (!wayland_output)
|
|
|
|
return;
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
wayland_output->resources = g_list_remove (wayland_output->resources, res);
|
|
|
|
}
|
|
|
|
|
2016-12-22 07:16:48 +00:00
|
|
|
static enum wl_output_subpixel
|
|
|
|
cogl_subpixel_order_to_wl_output_subpixel (CoglSubpixelOrder subpixel_order)
|
|
|
|
{
|
|
|
|
switch (subpixel_order)
|
|
|
|
{
|
|
|
|
case COGL_SUBPIXEL_ORDER_UNKNOWN:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_UNKNOWN;
|
|
|
|
case COGL_SUBPIXEL_ORDER_NONE:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_NONE;
|
|
|
|
case COGL_SUBPIXEL_ORDER_HORIZONTAL_RGB:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB;
|
|
|
|
case COGL_SUBPIXEL_ORDER_HORIZONTAL_BGR:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR;
|
|
|
|
case COGL_SUBPIXEL_ORDER_VERTICAL_RGB:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB;
|
|
|
|
case COGL_SUBPIXEL_ORDER_VERTICAL_BGR:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert_not_reached ();
|
2019-01-24 23:47:44 +00:00
|
|
|
return WL_OUTPUT_SUBPIXEL_UNKNOWN;
|
2016-12-22 07:16:48 +00:00
|
|
|
}
|
|
|
|
|
2017-05-25 09:20:59 +00:00
|
|
|
static int
|
2021-02-05 16:22:30 +00:00
|
|
|
calculate_wayland_output_scale (MetaMonitor *monitor)
|
2017-05-25 09:20:59 +00:00
|
|
|
{
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2017-05-25 09:20:59 +00:00
|
|
|
float scale;
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
2017-05-25 09:20:59 +00:00
|
|
|
scale = meta_logical_monitor_get_scale (logical_monitor);
|
|
|
|
return ceilf (scale);
|
|
|
|
}
|
|
|
|
|
2017-09-20 09:25:55 +00:00
|
|
|
static void
|
2021-02-05 16:22:30 +00:00
|
|
|
get_native_output_mode_resolution (MetaMonitor *monitor,
|
|
|
|
MetaMonitorMode *mode,
|
|
|
|
int *mode_width,
|
|
|
|
int *mode_height)
|
2017-09-20 09:25:55 +00:00
|
|
|
{
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2017-09-20 09:25:55 +00:00
|
|
|
MetaMonitorTransform transform;
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
2017-09-20 09:25:55 +00:00
|
|
|
transform = meta_logical_monitor_get_transform (logical_monitor);
|
|
|
|
if (meta_monitor_transform_is_rotated (transform))
|
|
|
|
meta_monitor_mode_get_resolution (mode, mode_height, mode_width);
|
|
|
|
else
|
|
|
|
meta_monitor_mode_get_resolution (mode, mode_width, mode_height);
|
|
|
|
}
|
|
|
|
|
2018-11-26 18:59:37 +00:00
|
|
|
static enum wl_output_transform
|
|
|
|
wl_output_transform_from_transform (MetaMonitorTransform transform)
|
|
|
|
{
|
|
|
|
switch (transform)
|
|
|
|
{
|
|
|
|
case META_MONITOR_TRANSFORM_NORMAL:
|
|
|
|
return WL_OUTPUT_TRANSFORM_NORMAL;
|
|
|
|
case META_MONITOR_TRANSFORM_90:
|
|
|
|
return WL_OUTPUT_TRANSFORM_90;
|
|
|
|
case META_MONITOR_TRANSFORM_180:
|
|
|
|
return WL_OUTPUT_TRANSFORM_180;
|
|
|
|
case META_MONITOR_TRANSFORM_270:
|
|
|
|
return WL_OUTPUT_TRANSFORM_270;
|
|
|
|
case META_MONITOR_TRANSFORM_FLIPPED:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED;
|
|
|
|
case META_MONITOR_TRANSFORM_FLIPPED_90:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_90;
|
|
|
|
case META_MONITOR_TRANSFORM_FLIPPED_180:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_180;
|
|
|
|
case META_MONITOR_TRANSFORM_FLIPPED_270:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_270;
|
|
|
|
}
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
|
2016-05-16 18:28:14 +00:00
|
|
|
static void
|
|
|
|
send_output_events (struct wl_resource *resource,
|
|
|
|
MetaWaylandOutput *wayland_output,
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor,
|
2017-09-05 16:53:41 +00:00
|
|
|
gboolean need_all_events,
|
|
|
|
gboolean *pending_done_event)
|
2016-05-16 18:28:14 +00:00
|
|
|
{
|
|
|
|
int version = wl_resource_get_version (resource);
|
2016-12-22 07:24:02 +00:00
|
|
|
MetaMonitorMode *current_mode;
|
|
|
|
MetaMonitorMode *preferred_mode;
|
2016-05-16 18:28:14 +00:00
|
|
|
guint mode_flags = WL_OUTPUT_MODE_CURRENT;
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2016-12-13 13:44:16 +00:00
|
|
|
MetaLogicalMonitor *old_logical_monitor;
|
|
|
|
guint old_mode_flags;
|
|
|
|
gint old_scale;
|
2016-12-13 14:08:17 +00:00
|
|
|
float old_refresh_rate;
|
|
|
|
float refresh_rate;
|
2018-11-26 18:59:37 +00:00
|
|
|
MetaMonitorTransform old_transform;
|
|
|
|
MetaMonitorTransform transform;
|
2017-09-20 09:25:55 +00:00
|
|
|
int new_width, new_height;
|
2016-12-13 13:44:16 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
|
|
|
old_logical_monitor =
|
|
|
|
meta_monitor_get_logical_monitor (wayland_output->monitor);
|
2016-12-13 13:44:16 +00:00
|
|
|
old_mode_flags = wayland_output->mode_flags;
|
|
|
|
old_scale = wayland_output->scale;
|
2018-11-26 18:59:37 +00:00
|
|
|
old_transform = wayland_output->transform;
|
2016-12-13 14:08:17 +00:00
|
|
|
old_refresh_rate = wayland_output->refresh_rate;
|
2016-12-13 13:44:16 +00:00
|
|
|
|
2016-12-22 07:24:02 +00:00
|
|
|
current_mode = meta_monitor_get_current_mode (monitor);
|
|
|
|
refresh_rate = meta_monitor_mode_get_refresh_rate (current_mode);
|
2018-11-26 18:59:37 +00:00
|
|
|
transform = meta_logical_monitor_get_transform (logical_monitor);
|
2016-05-16 18:28:14 +00:00
|
|
|
|
|
|
|
gboolean need_done = FALSE;
|
|
|
|
|
|
|
|
if (need_all_events ||
|
2016-11-25 06:31:38 +00:00
|
|
|
old_logical_monitor->rect.x != logical_monitor->rect.x ||
|
2018-11-07 09:13:24 +00:00
|
|
|
old_logical_monitor->rect.y != logical_monitor->rect.y ||
|
2018-11-26 18:59:37 +00:00
|
|
|
old_transform != transform)
|
2016-05-16 18:28:14 +00:00
|
|
|
{
|
2016-12-22 07:24:02 +00:00
|
|
|
int width_mm, height_mm;
|
|
|
|
const char *vendor;
|
|
|
|
const char *product;
|
2018-11-26 18:59:37 +00:00
|
|
|
uint32_t wl_transform;
|
2021-02-05 16:22:30 +00:00
|
|
|
CoglSubpixelOrder cogl_subpixel_order;
|
2016-12-22 07:16:48 +00:00
|
|
|
enum wl_output_subpixel subpixel_order;
|
|
|
|
|
2018-11-26 18:59:37 +00:00
|
|
|
meta_monitor_get_physical_dimensions (monitor, &width_mm, &height_mm);
|
2016-12-22 07:24:02 +00:00
|
|
|
vendor = meta_monitor_get_vendor (monitor);
|
|
|
|
product = meta_monitor_get_product (monitor);
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
cogl_subpixel_order = meta_monitor_get_subpixel_order (monitor);
|
|
|
|
subpixel_order =
|
|
|
|
cogl_subpixel_order_to_wl_output_subpixel (cogl_subpixel_order);
|
2016-12-22 07:16:48 +00:00
|
|
|
|
2018-11-26 18:59:37 +00:00
|
|
|
wl_transform = wl_output_transform_from_transform (transform);
|
2016-12-22 07:24:02 +00:00
|
|
|
|
2016-05-16 18:28:14 +00:00
|
|
|
wl_output_send_geometry (resource,
|
2016-11-25 06:31:38 +00:00
|
|
|
logical_monitor->rect.x,
|
|
|
|
logical_monitor->rect.y,
|
2016-12-22 07:24:02 +00:00
|
|
|
width_mm,
|
|
|
|
height_mm,
|
2016-12-22 07:16:48 +00:00
|
|
|
subpixel_order,
|
2021-10-28 13:25:58 +00:00
|
|
|
vendor ? vendor : "unknown",
|
|
|
|
product ? product : "unknown",
|
2018-11-26 18:59:37 +00:00
|
|
|
wl_transform);
|
2016-05-16 18:28:14 +00:00
|
|
|
need_done = TRUE;
|
|
|
|
}
|
|
|
|
|
2016-12-22 07:24:02 +00:00
|
|
|
preferred_mode = meta_monitor_get_preferred_mode (monitor);
|
|
|
|
if (current_mode == preferred_mode)
|
2016-05-16 18:28:14 +00:00
|
|
|
mode_flags |= WL_OUTPUT_MODE_PREFERRED;
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
get_native_output_mode_resolution (monitor,
|
2017-09-20 09:25:55 +00:00
|
|
|
current_mode,
|
|
|
|
&new_width,
|
|
|
|
&new_height);
|
2016-05-16 18:28:14 +00:00
|
|
|
if (need_all_events ||
|
2017-09-20 09:25:55 +00:00
|
|
|
wayland_output->mode_width != new_width ||
|
|
|
|
wayland_output->mode_height != new_height ||
|
2016-12-13 14:08:17 +00:00
|
|
|
old_refresh_rate != refresh_rate ||
|
2016-05-16 18:28:14 +00:00
|
|
|
old_mode_flags != mode_flags)
|
|
|
|
{
|
|
|
|
wl_output_send_mode (resource,
|
|
|
|
mode_flags,
|
2017-09-20 09:25:55 +00:00
|
|
|
new_width,
|
|
|
|
new_height,
|
2016-12-13 14:08:17 +00:00
|
|
|
(int32_t) (refresh_rate * 1000));
|
2016-05-16 18:28:14 +00:00
|
|
|
need_done = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (version >= WL_OUTPUT_SCALE_SINCE_VERSION)
|
|
|
|
{
|
2016-12-22 07:24:02 +00:00
|
|
|
int scale;
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
scale = calculate_wayland_output_scale (monitor);
|
2016-05-16 18:28:14 +00:00
|
|
|
if (need_all_events ||
|
2016-12-22 07:24:02 +00:00
|
|
|
old_scale != scale)
|
2016-05-16 18:28:14 +00:00
|
|
|
{
|
2016-12-22 07:24:02 +00:00
|
|
|
wl_output_send_scale (resource, scale);
|
2016-05-16 18:28:14 +00:00
|
|
|
need_done = TRUE;
|
|
|
|
}
|
2017-09-05 16:53:41 +00:00
|
|
|
}
|
2016-05-16 18:28:14 +00:00
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
if (need_all_events && version >= WL_OUTPUT_DONE_SINCE_VERSION)
|
|
|
|
{
|
|
|
|
wl_output_send_done (resource);
|
|
|
|
need_done = FALSE;
|
2016-05-16 18:28:14 +00:00
|
|
|
}
|
2017-09-05 16:53:41 +00:00
|
|
|
|
|
|
|
if (pending_done_event && need_done)
|
|
|
|
*pending_done_event = TRUE;
|
2016-05-16 18:28:14 +00:00
|
|
|
}
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
static void
|
|
|
|
bind_output (struct wl_client *client,
|
|
|
|
void *data,
|
|
|
|
guint32 version,
|
|
|
|
guint32 id)
|
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output = data;
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor;
|
2014-04-22 22:03:40 +00:00
|
|
|
struct wl_resource *resource;
|
2018-07-12 15:08:52 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2018-07-12 15:08:52 +00:00
|
|
|
#endif
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2014-08-04 14:24:59 +00:00
|
|
|
resource = wl_resource_create (client, &wl_output_interface, version, id);
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
monitor = wayland_output->monitor;
|
|
|
|
if (!monitor)
|
2017-12-06 16:05:02 +00:00
|
|
|
return;
|
|
|
|
|
2021-03-22 15:27:54 +00:00
|
|
|
wayland_output->resources = g_list_prepend (wayland_output->resources,
|
|
|
|
resource);
|
|
|
|
wl_resource_set_user_data (resource, wayland_output);
|
|
|
|
wl_resource_set_destructor (resource, output_resource_destroy);
|
|
|
|
|
2018-07-12 15:08:52 +00:00
|
|
|
#ifdef WITH_VERBOSE_MODE
|
2021-02-05 16:22:30 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
2020-10-02 15:47:22 +00:00
|
|
|
meta_verbose ("Binding monitor %p/%s (%u, %u, %u, %u) x %f",
|
2016-12-22 07:24:02 +00:00
|
|
|
logical_monitor,
|
|
|
|
meta_monitor_get_product (monitor),
|
2016-11-25 06:31:38 +00:00
|
|
|
logical_monitor->rect.x, logical_monitor->rect.y,
|
2017-09-20 09:25:55 +00:00
|
|
|
wayland_output->mode_width,
|
|
|
|
wayland_output->mode_height,
|
2016-12-13 14:08:17 +00:00
|
|
|
wayland_output->refresh_rate);
|
2018-07-12 15:08:52 +00:00
|
|
|
#endif
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
send_output_events (resource, wayland_output, monitor, TRUE, NULL);
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2020-03-09 11:33:17 +00:00
|
|
|
g_signal_emit (wayland_output, signals[OUTPUT_BOUND], 0, resource);
|
2014-04-22 22:03:40 +00:00
|
|
|
}
|
|
|
|
|
2016-05-16 18:28:14 +00:00
|
|
|
static void
|
2021-02-05 16:22:30 +00:00
|
|
|
meta_wayland_output_set_monitor (MetaWaylandOutput *wayland_output,
|
|
|
|
MetaMonitor *monitor)
|
2014-07-10 21:39:47 +00:00
|
|
|
{
|
2016-12-22 07:24:02 +00:00
|
|
|
MetaMonitorMode *current_mode;
|
|
|
|
MetaMonitorMode *preferred_mode;
|
2018-11-26 18:59:37 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2016-05-16 18:28:14 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output->monitor = monitor;
|
2016-05-16 18:28:14 +00:00
|
|
|
wayland_output->mode_flags = WL_OUTPUT_MODE_CURRENT;
|
2016-12-13 13:44:16 +00:00
|
|
|
|
2016-12-22 07:24:02 +00:00
|
|
|
current_mode = meta_monitor_get_current_mode (monitor);
|
|
|
|
preferred_mode = meta_monitor_get_preferred_mode (monitor);
|
|
|
|
|
|
|
|
if (current_mode == preferred_mode)
|
2016-05-16 18:28:14 +00:00
|
|
|
wayland_output->mode_flags |= WL_OUTPUT_MODE_PREFERRED;
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output->scale = calculate_wayland_output_scale (monitor);
|
2016-12-22 07:24:02 +00:00
|
|
|
wayland_output->refresh_rate = meta_monitor_mode_get_refresh_rate (current_mode);
|
2018-10-17 14:55:18 +00:00
|
|
|
|
2018-11-26 18:59:37 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
|
|
|
wayland_output->transform =
|
|
|
|
meta_logical_monitor_get_transform (logical_monitor);
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
get_native_output_mode_resolution (monitor,
|
2017-09-20 09:25:55 +00:00
|
|
|
current_mode,
|
|
|
|
&wayland_output->mode_width,
|
|
|
|
&wayland_output->mode_height);
|
2014-07-10 21:39:47 +00:00
|
|
|
}
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
static void
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output_update_for_output (MetaWaylandOutput *wayland_output,
|
|
|
|
MetaMonitor *monitor)
|
2014-04-22 22:03:40 +00:00
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
GList *l;
|
2017-09-05 16:53:41 +00:00
|
|
|
gboolean pending_done_event;
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
pending_done_event = FALSE;
|
2021-02-05 16:24:27 +00:00
|
|
|
for (l = wayland_output->resources; l; l = l->next)
|
2014-04-22 22:03:40 +00:00
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
struct wl_resource *resource = l->data;
|
2021-02-05 16:22:30 +00:00
|
|
|
|
|
|
|
send_output_events (resource, wayland_output, monitor,
|
|
|
|
FALSE, &pending_done_event);
|
2014-04-22 22:03:40 +00:00
|
|
|
}
|
|
|
|
|
2021-02-05 16:24:27 +00:00
|
|
|
for (l = wayland_output->xdg_output_resources; l; l = l->next)
|
2017-09-05 16:53:41 +00:00
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
struct wl_resource *xdg_output = l->data;
|
2021-02-05 16:22:30 +00:00
|
|
|
|
|
|
|
send_xdg_output_events (xdg_output, wayland_output, monitor,
|
|
|
|
FALSE, &pending_done_event);
|
2017-09-05 16:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Send the "done" events if needed */
|
|
|
|
if (pending_done_event)
|
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
for (l = wayland_output->resources; l; l = l->next)
|
2017-09-05 16:53:41 +00:00
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
struct wl_resource *resource = l->data;
|
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
if (wl_resource_get_version (resource) >= WL_OUTPUT_DONE_SINCE_VERSION)
|
|
|
|
wl_output_send_done (resource);
|
|
|
|
}
|
|
|
|
|
2021-02-05 16:24:27 +00:00
|
|
|
for (l = wayland_output->xdg_output_resources; l; l = l->next)
|
2017-09-05 16:53:41 +00:00
|
|
|
{
|
2021-02-05 16:24:27 +00:00
|
|
|
struct wl_resource *xdg_output = l->data;
|
|
|
|
|
2019-07-25 12:12:46 +00:00
|
|
|
if (wl_resource_get_version (xdg_output) < NO_XDG_OUTPUT_DONE_SINCE_VERSION)
|
|
|
|
zxdg_output_v1_send_done (xdg_output);
|
2017-09-05 16:53:41 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-05 16:22:30 +00:00
|
|
|
|
|
|
|
meta_wayland_output_set_monitor (wayland_output, monitor);
|
2014-04-22 22:03:40 +00:00
|
|
|
}
|
|
|
|
|
2015-04-17 09:17:46 +00:00
|
|
|
static MetaWaylandOutput *
|
2016-05-16 18:28:14 +00:00
|
|
|
meta_wayland_output_new (MetaWaylandCompositor *compositor,
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor)
|
2015-04-17 09:17:46 +00:00
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output;
|
|
|
|
|
|
|
|
wayland_output = g_object_new (META_TYPE_WAYLAND_OUTPUT, NULL);
|
|
|
|
wayland_output->global = wl_global_create (compositor->wayland_display,
|
|
|
|
&wl_output_interface,
|
|
|
|
META_WL_OUTPUT_VERSION,
|
|
|
|
wayland_output, bind_output);
|
2021-05-06 16:48:15 +00:00
|
|
|
meta_wayland_compositor_flush_clients (compositor);
|
2021-02-05 16:22:30 +00:00
|
|
|
meta_wayland_output_set_monitor (wayland_output, monitor);
|
2015-04-17 09:17:46 +00:00
|
|
|
|
|
|
|
return wayland_output;
|
|
|
|
}
|
|
|
|
|
2017-12-06 16:05:02 +00:00
|
|
|
static void
|
2018-07-27 16:32:31 +00:00
|
|
|
make_output_resources_inert (MetaWaylandOutput *wayland_output)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
2021-03-22 15:27:54 +00:00
|
|
|
wl_global_remove (wayland_output->global);
|
|
|
|
|
2018-07-27 16:32:31 +00:00
|
|
|
for (l = wayland_output->resources; l; l = l->next)
|
|
|
|
{
|
|
|
|
struct wl_resource *output_resource = l->data;
|
|
|
|
|
|
|
|
wl_resource_set_user_data (output_resource, NULL);
|
|
|
|
}
|
|
|
|
g_list_free (wayland_output->resources);
|
|
|
|
wayland_output->resources = NULL;
|
|
|
|
|
|
|
|
for (l = wayland_output->xdg_output_resources; l; l = l->next)
|
|
|
|
{
|
|
|
|
struct wl_resource *xdg_output_resource = l->data;
|
|
|
|
|
|
|
|
wl_resource_set_user_data (xdg_output_resource, NULL);
|
|
|
|
}
|
|
|
|
g_list_free (wayland_output->xdg_output_resources);
|
|
|
|
wayland_output->xdg_output_resources = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
make_output_inert (gpointer key,
|
|
|
|
gpointer value,
|
|
|
|
gpointer data)
|
2017-12-06 16:05:02 +00:00
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output = value;
|
2018-07-27 16:32:31 +00:00
|
|
|
|
2020-03-09 11:32:07 +00:00
|
|
|
g_signal_emit (wayland_output, signals[OUTPUT_DESTROYED], 0);
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output->monitor = NULL;
|
2018-07-27 16:32:31 +00:00
|
|
|
make_output_resources_inert (wayland_output);
|
2017-12-06 16:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
delayed_destroy_outputs (gpointer data)
|
|
|
|
{
|
|
|
|
g_hash_table_destroy (data);
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
}
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
static GHashTable *
|
|
|
|
meta_wayland_compositor_update_outputs (MetaWaylandCompositor *compositor,
|
2016-12-02 08:00:03 +00:00
|
|
|
MetaMonitorManager *monitor_manager)
|
2014-04-22 22:03:40 +00:00
|
|
|
{
|
|
|
|
GHashTable *new_table;
|
2021-02-05 16:22:30 +00:00
|
|
|
GList *monitors, *l;
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
monitors = meta_monitor_manager_get_monitors (monitor_manager);
|
|
|
|
new_table = g_hash_table_new_full (meta_monitor_spec_hash,
|
|
|
|
(GEqualFunc) meta_monitor_spec_equals,
|
|
|
|
(GDestroyNotify) meta_monitor_spec_free,
|
2020-03-09 11:32:07 +00:00
|
|
|
g_object_unref);
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
for (l = monitors; l; l = l->next)
|
2014-04-22 22:03:40 +00:00
|
|
|
{
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor = l->data;
|
|
|
|
MetaMonitorSpec *monitor_spec = meta_monitor_get_spec (monitor);
|
2018-10-17 14:55:18 +00:00
|
|
|
MetaWaylandOutput *wayland_output = NULL;
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
if (!meta_monitor_is_active (monitor))
|
2015-03-31 01:12:04 +00:00
|
|
|
continue;
|
2016-11-25 06:31:38 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
if (compositor->outputs)
|
|
|
|
wayland_output = g_hash_table_lookup (compositor->outputs, monitor_spec);
|
2014-04-22 22:03:40 +00:00
|
|
|
|
|
|
|
if (wayland_output)
|
2021-02-05 16:22:30 +00:00
|
|
|
g_hash_table_steal (compositor->outputs, monitor_spec);
|
2014-04-22 22:03:40 +00:00
|
|
|
else
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output = meta_wayland_output_new (compositor, monitor);
|
2014-04-22 22:03:40 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output_update_for_output (wayland_output, monitor);
|
2016-11-25 06:31:38 +00:00
|
|
|
g_hash_table_insert (new_table,
|
2021-02-05 16:22:30 +00:00
|
|
|
meta_monitor_spec_clone (monitor_spec),
|
2016-11-25 06:31:38 +00:00
|
|
|
wayland_output);
|
2014-04-22 22:03:40 +00:00
|
|
|
}
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
if (compositor->outputs)
|
|
|
|
{
|
|
|
|
g_hash_table_foreach (compositor->outputs, make_output_inert, NULL);
|
|
|
|
g_timeout_add_seconds (10, delayed_destroy_outputs, compositor->outputs);
|
|
|
|
}
|
2017-12-06 16:05:02 +00:00
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
return new_table;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
on_monitors_changed (MetaMonitorManager *monitors,
|
|
|
|
MetaWaylandCompositor *compositor)
|
|
|
|
{
|
|
|
|
compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors);
|
|
|
|
}
|
|
|
|
|
2015-04-17 09:17:46 +00:00
|
|
|
static void
|
|
|
|
meta_wayland_output_init (MetaWaylandOutput *wayland_output)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_output_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output = META_WAYLAND_OUTPUT (object);
|
|
|
|
|
2021-03-22 15:27:54 +00:00
|
|
|
g_warn_if_fail (!wayland_output->resources);
|
|
|
|
g_warn_if_fail (!wayland_output->xdg_output_resources);
|
2015-07-01 05:18:45 +00:00
|
|
|
|
2021-03-22 15:27:54 +00:00
|
|
|
wl_global_destroy (wayland_output->global);
|
2017-09-05 16:53:41 +00:00
|
|
|
|
2015-04-17 09:17:46 +00:00
|
|
|
G_OBJECT_CLASS (meta_wayland_output_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_output_class_init (MetaWaylandOutputClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->finalize = meta_wayland_output_finalize;
|
wayland: Send wl_surface.enter and wl_surface.leave
Whenever a MetaSurfaceActor is painted, update the list of what outputs
the surface is being drawed upon. Since we do this on paint, we
effectively avoids this whenever the surface is not drawn, for example
being minimized, on a non-active workspace, or simply outside of the
damage region of a frame.
DND icons and cursors are not affected by this patch, since they are not
drawn as MetaSurfaceActors. If a MetaSurfaceActor or a parent is cloned,
then we'll check the position of the original actor again when the clone is
drawn, which is slightly expensive, but harmless. If the MetaShapedTexture
instead is cloned, as GNOME Shell does in many cases, then these clones
will not cause duplicate position checks.
https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-02-03 07:49:52 +00:00
|
|
|
|
|
|
|
signals[OUTPUT_DESTROYED] = g_signal_new ("output-destroyed",
|
|
|
|
G_TYPE_FROM_CLASS (object_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 0);
|
2020-03-09 11:33:17 +00:00
|
|
|
|
|
|
|
signals[OUTPUT_BOUND] = g_signal_new ("output-bound",
|
|
|
|
G_TYPE_FROM_CLASS (object_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
0,
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
2015-04-17 09:17:46 +00:00
|
|
|
}
|
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
static void
|
|
|
|
meta_xdg_output_destructor (struct wl_resource *resource)
|
|
|
|
{
|
|
|
|
MetaWaylandOutput *wayland_output;
|
|
|
|
|
|
|
|
wayland_output = wl_resource_get_user_data (resource);
|
|
|
|
if (!wayland_output)
|
|
|
|
return;
|
|
|
|
|
|
|
|
wayland_output->xdg_output_resources =
|
|
|
|
g_list_remove (wayland_output->xdg_output_resources, resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_xdg_output_destroy (struct wl_client *client,
|
|
|
|
struct wl_resource *resource)
|
|
|
|
{
|
|
|
|
wl_resource_destroy (resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct zxdg_output_v1_interface
|
|
|
|
meta_xdg_output_interface = {
|
|
|
|
meta_xdg_output_destroy,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
send_xdg_output_events (struct wl_resource *resource,
|
|
|
|
MetaWaylandOutput *wayland_output,
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaMonitor *monitor,
|
2017-09-05 16:53:41 +00:00
|
|
|
gboolean need_all_events,
|
|
|
|
gboolean *pending_done_event)
|
|
|
|
{
|
2021-10-11 12:06:00 +00:00
|
|
|
MetaRectangle layout;
|
2021-02-05 16:22:30 +00:00
|
|
|
MetaLogicalMonitor *logical_monitor;
|
2019-06-26 09:42:29 +00:00
|
|
|
int version;
|
2017-09-05 16:53:41 +00:00
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
2021-10-11 12:06:00 +00:00
|
|
|
layout = meta_logical_monitor_get_layout (logical_monitor);
|
2017-09-05 16:53:41 +00:00
|
|
|
|
2021-10-11 12:06:00 +00:00
|
|
|
zxdg_output_v1_send_logical_position (resource, layout.x, layout.y);
|
|
|
|
zxdg_output_v1_send_logical_size (resource, layout.width, layout.height);
|
2017-09-05 16:53:41 +00:00
|
|
|
|
2019-06-26 09:42:29 +00:00
|
|
|
version = wl_resource_get_version (resource);
|
|
|
|
|
|
|
|
if (need_all_events && version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION)
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
name = meta_monitor_get_connector (monitor);
|
|
|
|
zxdg_output_v1_send_name (resource, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (need_all_events && version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION)
|
|
|
|
{
|
|
|
|
const char *description;
|
|
|
|
|
|
|
|
description = meta_monitor_get_display_name (monitor);
|
|
|
|
zxdg_output_v1_send_description (resource, description);
|
|
|
|
}
|
|
|
|
|
2021-10-11 12:06:00 +00:00
|
|
|
if (pending_done_event)
|
2017-09-05 16:53:41 +00:00
|
|
|
*pending_done_event = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_xdg_output_manager_get_xdg_output (struct wl_client *client,
|
|
|
|
struct wl_resource *resource,
|
|
|
|
uint32_t id,
|
|
|
|
struct wl_resource *output)
|
|
|
|
{
|
|
|
|
struct wl_resource *xdg_output_resource;
|
|
|
|
MetaWaylandOutput *wayland_output;
|
2019-09-03 11:46:37 +00:00
|
|
|
int xdg_output_version;
|
|
|
|
int wl_output_version;
|
2017-09-05 16:53:41 +00:00
|
|
|
|
|
|
|
xdg_output_resource = wl_resource_create (client,
|
|
|
|
&zxdg_output_v1_interface,
|
|
|
|
wl_resource_get_version (resource),
|
|
|
|
id);
|
|
|
|
|
|
|
|
wayland_output = wl_resource_get_user_data (output);
|
2019-04-15 12:55:45 +00:00
|
|
|
wl_resource_set_implementation (xdg_output_resource,
|
|
|
|
&meta_xdg_output_interface,
|
|
|
|
wayland_output, meta_xdg_output_destructor);
|
|
|
|
|
2021-12-02 18:02:33 +00:00
|
|
|
if (!wayland_output)
|
|
|
|
goto done;
|
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
wayland_output->xdg_output_resources =
|
|
|
|
g_list_prepend (wayland_output->xdg_output_resources, xdg_output_resource);
|
|
|
|
|
2021-02-05 16:22:30 +00:00
|
|
|
if (!wayland_output->monitor)
|
2021-12-02 18:02:33 +00:00
|
|
|
goto done;
|
2018-09-25 11:50:09 +00:00
|
|
|
|
2017-09-05 16:53:41 +00:00
|
|
|
send_xdg_output_events (xdg_output_resource,
|
|
|
|
wayland_output,
|
2021-02-05 16:22:30 +00:00
|
|
|
wayland_output->monitor,
|
2017-09-05 16:53:41 +00:00
|
|
|
TRUE, NULL);
|
2019-09-03 11:46:37 +00:00
|
|
|
|
2021-12-02 18:02:33 +00:00
|
|
|
done:
|
2019-09-03 11:46:37 +00:00
|
|
|
xdg_output_version = wl_resource_get_version (xdg_output_resource);
|
|
|
|
wl_output_version = wl_resource_get_version (output);
|
|
|
|
|
|
|
|
if (xdg_output_version < NO_XDG_OUTPUT_DONE_SINCE_VERSION)
|
|
|
|
zxdg_output_v1_send_done (xdg_output_resource);
|
|
|
|
else if (wl_output_version >= WL_OUTPUT_DONE_SINCE_VERSION)
|
|
|
|
wl_output_send_done (output);
|
2017-09-05 16:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_xdg_output_manager_destroy (struct wl_client *client,
|
|
|
|
struct wl_resource *resource)
|
|
|
|
{
|
|
|
|
wl_resource_destroy (resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct zxdg_output_manager_v1_interface
|
|
|
|
meta_xdg_output_manager_interface = {
|
|
|
|
meta_xdg_output_manager_destroy,
|
|
|
|
meta_xdg_output_manager_get_xdg_output,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
bind_xdg_output_manager (struct wl_client *client,
|
|
|
|
void *data,
|
|
|
|
uint32_t version,
|
|
|
|
uint32_t id)
|
|
|
|
{
|
|
|
|
struct wl_resource *resource;
|
|
|
|
|
|
|
|
resource = wl_resource_create (client,
|
|
|
|
&zxdg_output_manager_v1_interface,
|
|
|
|
version, id);
|
|
|
|
|
|
|
|
wl_resource_set_implementation (resource,
|
|
|
|
&meta_xdg_output_manager_interface,
|
|
|
|
NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2022-07-23 15:06:59 +00:00
|
|
|
void
|
|
|
|
meta_wayland_outputs_finalize (MetaWaylandCompositor *compositor)
|
|
|
|
{
|
|
|
|
MetaBackend *backend = meta_context_get_backend (compositor->context);
|
|
|
|
MetaMonitorManager *monitor_manager =
|
|
|
|
meta_backend_get_monitor_manager (backend);
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (monitor_manager, on_monitors_changed,
|
|
|
|
compositor);
|
|
|
|
|
|
|
|
g_hash_table_destroy (compositor->outputs);
|
|
|
|
}
|
|
|
|
|
2014-04-22 22:03:40 +00:00
|
|
|
void
|
|
|
|
meta_wayland_outputs_init (MetaWaylandCompositor *compositor)
|
|
|
|
{
|
|
|
|
MetaMonitorManager *monitors;
|
|
|
|
|
|
|
|
monitors = meta_monitor_manager_get ();
|
2017-10-13 00:14:40 +00:00
|
|
|
g_signal_connect (monitors, "monitors-changed-internal",
|
2014-04-22 22:03:40 +00:00
|
|
|
G_CALLBACK (on_monitors_changed), compositor);
|
|
|
|
|
|
|
|
compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors);
|
2017-09-05 16:53:41 +00:00
|
|
|
|
|
|
|
wl_global_create (compositor->wayland_display,
|
|
|
|
&zxdg_output_manager_v1_interface,
|
|
|
|
META_ZXDG_OUTPUT_V1_VERSION,
|
|
|
|
NULL,
|
|
|
|
bind_xdg_output_manager);
|
2014-04-22 22:03:40 +00:00
|
|
|
}
|