Relay the xdg_output.name to GdkMonitor
The xdg_output interface has a `name` property that reflects the output name coming from the compositor. This is the closest thing we can get to a connector name. Fixes: #1961
This commit is contained in:
@ -515,8 +515,11 @@ gdk_registry_handle_global (void *data,
|
||||
}
|
||||
else if (strcmp(interface, "zxdg_output_manager_v1") == 0)
|
||||
{
|
||||
display_wayland->xdg_output_manager_version = MIN (version, 2);
|
||||
display_wayland->xdg_output_manager =
|
||||
wl_registry_bind (registry, id, &zxdg_output_manager_v1_interface, 1);
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&zxdg_output_manager_v1_interface,
|
||||
display_wayland->xdg_output_manager_version);
|
||||
_gdk_wayland_screen_init_xdg_output (display_wayland->screen);
|
||||
_gdk_wayland_display_async_roundtrip (display_wayland);
|
||||
}
|
||||
|
||||
@ -121,6 +121,7 @@ struct _GdkWaylandDisplay
|
||||
int seat_version;
|
||||
int data_device_manager_version;
|
||||
int gtk_shell_version;
|
||||
int xdg_output_manager_version;
|
||||
|
||||
uint32_t server_decoration_mode;
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ gdk_wayland_monitor_finalize (GObject *object)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)object;
|
||||
|
||||
g_free (monitor->name);
|
||||
|
||||
wl_output_destroy (monitor->output);
|
||||
|
||||
G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
|
||||
|
||||
@ -37,6 +37,7 @@ struct _GdkWaylandMonitor {
|
||||
int32_t y;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
char *name;
|
||||
gboolean wl_output_done;
|
||||
gboolean xdg_output_done;
|
||||
};
|
||||
|
||||
@ -1458,6 +1458,7 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
||||
|
||||
gdk_monitor_set_position (GDK_MONITOR (monitor), monitor->x, monitor->y);
|
||||
gdk_monitor_set_size (GDK_MONITOR (monitor), monitor->width, monitor->height);
|
||||
gdk_monitor_set_connector (GDK_MONITOR (monitor), monitor->name);
|
||||
monitor->wl_output_done = FALSE;
|
||||
monitor->xdg_output_done = FALSE;
|
||||
|
||||
@ -1509,10 +1510,36 @@ xdg_output_handle_done (void *data,
|
||||
apply_monitor_change (monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_output_handle_name (void *data,
|
||||
struct zxdg_output_v1 *xdg_output,
|
||||
const char *name)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *) data;
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("handle name xdg-output %d", monitor->id));
|
||||
|
||||
monitor->name = g_strdup (name);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_output_handle_description (void *data,
|
||||
struct zxdg_output_v1 *xdg_output,
|
||||
const char *description)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *) data;
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("handle description xdg-output %d", monitor->id));
|
||||
}
|
||||
|
||||
static const struct zxdg_output_v1_listener xdg_output_listener = {
|
||||
xdg_output_handle_logical_position,
|
||||
xdg_output_handle_logical_size,
|
||||
xdg_output_handle_done,
|
||||
xdg_output_handle_name,
|
||||
xdg_output_handle_description,
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user