mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
monitor-manager-dummy: Add non-preferred mode
Add an extra mode besides the preferred one. This makes it possible to test monitor configuration paths when running nested. https://bugzilla.gnome.org/show_bug.cgi?id=779745
This commit is contained in:
parent
8f2daed9e0
commit
3ace913aed
@ -60,17 +60,25 @@ append_monitor (GArray *modes,
|
||||
GArray *outputs,
|
||||
int scale)
|
||||
{
|
||||
MetaCrtcMode mode;
|
||||
MetaCrtc crtc;
|
||||
MetaOutput output;
|
||||
|
||||
mode = (MetaCrtcMode) {
|
||||
.mode_id = modes->len,
|
||||
MetaCrtcMode modes_decl[] = {
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.refresh_rate = 60.0
|
||||
}
|
||||
};
|
||||
g_array_append_val (modes, mode);
|
||||
MetaCrtc crtc;
|
||||
MetaOutput output;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (modes_decl); i++)
|
||||
modes_decl[i].mode_id = modes->len + i;
|
||||
g_array_append_vals (modes, modes_decl, G_N_ELEMENTS (modes_decl));
|
||||
|
||||
crtc = (MetaCrtc) {
|
||||
.crtc_id = crtcs->len + 1,
|
||||
@ -96,9 +104,11 @@ append_monitor (GArray *modes,
|
||||
.scale = scale,
|
||||
};
|
||||
|
||||
output.modes = g_new0 (MetaCrtcMode *, 1);
|
||||
output.modes[0] = &array_last (modes, MetaCrtcMode);
|
||||
output.n_modes = 1;
|
||||
output.modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (modes_decl));
|
||||
for (i = 0; i < G_N_ELEMENTS (modes_decl); i++)
|
||||
output.modes[i] = &g_array_index (modes, MetaCrtcMode,
|
||||
modes->len - (i + 1));
|
||||
output.n_modes = G_N_ELEMENTS (modes_decl);
|
||||
output.possible_crtcs = g_new0 (MetaCrtc *, 1);
|
||||
output.possible_crtcs[0] = &array_last (crtcs, MetaCrtc);
|
||||
output.n_possible_crtcs = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user