MetaOnscreenNative: fix mirror mode with stage views

Using the view's MetaMonitorInfo to find all the crtcs which should be
configured to display a given onscreen doesn't work unfortunately. The
association runs only the other way around, i.e. we need to go through
each crtc and find the ones corresponding to our monitor info.

https://bugzilla.gnome.org/show_bug.cgi?id=773115
This commit is contained in:
Rui Matos 2016-10-17 18:37:31 +02:00
parent 8290e1f09a
commit 1d4a5a7520

View File

@ -466,16 +466,19 @@ meta_onscreen_native_set_crtc_modes (MetaOnscreenNative *onscreen_native)
monitor_info = meta_renderer_view_get_monitor_info (view); monitor_info = meta_renderer_view_get_monitor_info (view);
if (monitor_info) if (monitor_info)
{ {
int i; unsigned int i;
for (i = 0; i < monitor_info->n_outputs; i++) for (i = 0; i < monitor_manager->n_crtcs; i++)
{ {
MetaOutput *output = monitor_info->outputs[i]; MetaCRTC *crtc = &monitor_manager->crtcs[i];
int x = output->crtc->rect.x - monitor_info->rect.x; int x = crtc->rect.x - monitor_info->rect.x;
int y = output->crtc->rect.y - monitor_info->rect.y; int y = crtc->rect.y - monitor_info->rect.y;
if (crtc->logical_monitor != monitor_info)
continue;
meta_monitor_manager_kms_apply_crtc_mode (monitor_manager_kms, meta_monitor_manager_kms_apply_crtc_mode (monitor_manager_kms,
output->crtc, crtc,
x, y, x, y,
next_fb_id); next_fb_id);
} }
@ -530,16 +533,19 @@ meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen)
monitor_info = meta_renderer_view_get_monitor_info (view); monitor_info = meta_renderer_view_get_monitor_info (view);
if (monitor_info) if (monitor_info)
{ {
int i; unsigned int i;
for (i = 0; i < monitor_info->n_outputs; i++) for (i = 0; i < monitor_manager->n_crtcs; i++)
{ {
MetaOutput *output = monitor_info->outputs[i]; MetaCRTC *crtc = &monitor_manager->crtcs[i];
int x = output->crtc->rect.x - monitor_info->rect.x; int x = crtc->rect.x - monitor_info->rect.x;
int y = output->crtc->rect.y - monitor_info->rect.y; int y = crtc->rect.y - monitor_info->rect.y;
if (crtc->logical_monitor != monitor_info)
continue;
meta_onscreen_native_flip_crtc (onscreen_native, flip_closure, meta_onscreen_native_flip_crtc (onscreen_native, flip_closure,
output->crtc, x, y, crtc, x, y,
&fb_in_use); &fb_in_use);
} }
} }