mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
monitor-manager: Derive logical monitor position from top left CRTC
Derive the logical monitor position not by looking at the main output (the (0, 0) tile), but the one that is placed on the top-left corner. This might be the non-main output on certain transformations. https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
parent
d804ecbd95
commit
af4017de49
@ -158,11 +158,25 @@ static void
|
||||
derive_monitor_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
MetaOutput *main_output;
|
||||
GList *outputs;
|
||||
GList *l;
|
||||
int x = INT_MAX;
|
||||
int y = INT_MAX;
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
layout->x = main_output->crtc->rect.x;
|
||||
layout->y = main_output->crtc->rect.y;
|
||||
outputs = meta_monitor_get_outputs (monitor);
|
||||
for (l = outputs; l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
|
||||
if (!output->crtc)
|
||||
continue;
|
||||
|
||||
x = MIN (x, output->crtc->rect.x);
|
||||
y = MIN (y, output->crtc->rect.y);
|
||||
}
|
||||
|
||||
layout->x = x;
|
||||
layout->y = y;
|
||||
|
||||
meta_monitor_derive_dimensions (monitor, &layout->width, &layout->height);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user