Skip to content
Snippets Groups Projects
Commit 013f3c18 authored by Guido Gunther's avatar Guido Gunther :zzz: Committed by Sebastian Krzyszkowiak
Browse files

monitor-manager: Set logical position


This makes the monitor layout in g-c-c match what the compositor thinks
it is so monitors are displayed next to each other rather than over
each other.

Signed-off-by: default avatarGuido Günther <guido.gunther@puri.sm>
parent 7539ad6f
No related branches found
No related tags found
No related merge requests found
......@@ -502,10 +502,10 @@ phosh_monitor_manager_handle_get_current_state (
is_primary = (monitor == phosh_shell_get_primary_monitor (phosh_shell_get_default()));
g_variant_builder_add (&logical_monitors_builder,
LOGICAL_MONITOR_FORMAT,
(gint32)monitor->x, /* logical_monitor->rect.x */
(gint32)monitor->y, /* logical_monitor->rect.y */
(double)monitor->scale, /* (double) logical_monitor->scale */
(guint32)monitor->transform, /* logical_monitor->transform */
(gint32)monitor->logical.x, /* logical_monitor->rect.x */
(gint32)monitor->logical.y, /* logical_monitor->rect.y */
(double)monitor->scale, /* (double) logical_monitor->scale */
(guint32)monitor->transform, /* logical_monitor->transform */
is_primary, /* logical_monitor->is_primary */
&logical_monitor_monitors_builder,
NULL);
......
......@@ -143,7 +143,13 @@ xdg_output_v1_handle_logical_position (void *data,
int32_t x,
int32_t y)
{
/* TODO: use this */
PhoshMonitor *self = PHOSH_MONITOR (data);
g_return_if_fail (PHOSH_IS_MONITOR (self));
self->xdg_output_done = FALSE;
g_debug ("%p: Logical pos: %d,%d", self, x, y);
self->logical.x = x;
self->logical.y = y;
}
......@@ -153,7 +159,14 @@ xdg_output_v1_handle_logical_size (void *data,
int32_t width,
int32_t height)
{
/* Nothing todo atm */
PhoshMonitor *self = PHOSH_MONITOR (data);
g_return_if_fail (PHOSH_IS_MONITOR (self));
self->xdg_output_done = FALSE;
g_debug ("%p: Logical size: %dx%d", self, width, height);
self->logical.width = width;
self->logical.height = height;
}
static void
......@@ -181,6 +194,7 @@ xdg_output_v1_handle_name (void *data,
/* wlroots uses the connector's name as xdg_output name */
g_debug("Connector name is %s", name);
self->xdg_output_done = FALSE;
self->name = g_strdup (name);
/* wlroots uses the connector's name as output name so
......
......@@ -68,6 +68,10 @@ struct _PhoshMonitor {
gint subpixel;
gint32 transform, scale;
struct {
gint32 x, y, width, height;
} logical;
gint width_mm;
gint height_mm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment