ApplyConfiguration dbus method not implemented?

Hello people,

I am trying to set up two displays to be mirrored with dbus. My initial thought is that we can achieve mirror displays by having two monitors have the same CRTC. I have attempted the following:

gdbus call --session \ --dest org.gnome.Mutter.DisplayConfig \ --object-path /org/gnome/Mutter/DisplayConfig \ --method org.gnome.Mutter.DisplayConfig.ApplyConfiguration \ "<serial>" false "[(<crtc_id>, <mode_id>, <x>, <y>, <transform>, [<output_ids>], {})]" "[]"
where output_ids are the output ids of my two monitors. Those data can be obtained through the GetResources method.

And the example input is:

gdbus call --session \ --dest org.gnome.Mutter.DisplayConfig \ --object-path /org/gnome/Mutter/DisplayConfig \ --method org.gnome.Mutter.DisplayConfig.ApplyConfiguration \ "62" false "[(0, 181, 0, 0, 0, [0, 1], {})]" "[]"

After executing the method, I received the error

org.freedesktop.DBus.Error.UnknownMethod: Method ApplyConfiguration is not implemented on interface org.gnome.Mutter.DisplayConfig

This is odd because I can find ApplyConfiguration through d-feet, however, trying to execute the method through d-feet also gives me the not implemented error.

I experimented on different distros with different gnome versions, but the error remains.

Am I missing something? Is my approach with ApplyConfiguration attempting to apply the same CRTC to two outputs valid?

That method is apparently not used anymore: Remove old monitor configuration system (e8a62861) · Commits · GNOME / mutter · GitLab

Hmm… I am not sure, in that commit it says it just remove the experimental tag for the dbus interface.

Also in org.gnome.Mutter.DisplayConfig.xml it appears that ApplyConfiguration is still there.

As far as I understand it, the ApplyConfiguration method was part of the old low level configuration system which dealt with CRTCs directly. That’s what has been removed in the commit I linked. Specifically it removes the implementation, which is the reason why you get the not implemented message. Not sure why it was not removed from the dbus interface file.

I see. Can we set up mirror displays with dbus then? My current understanding is that mirror display can be accomplished if two monitors have the same logical monitor setting (x, y, scale, transform, mode). I am not sure if I am getting this correctly.

Can we set up mirror displays with dbus then?

Given that gnome-control-center uses this interface and is able to set up mirroring, I would assume so. You could run that and monitor the dbus traffic to see what exactly it does.

1 Like

By monitoring the dbus traffic with bustle I discovered that ApplyMonitorsConfig is the dbus method used to set up the mirror display. Something like this works:

(uint32 67, uint32 2, [(0, 0, 1.0, uint32 0, true, [('HDMI-1', '1920x1080@60.000', {'underscanning': <false>}), ('eDP-1', '1920x1080@60.008', {'underscanning': <false>})])], @a{sv} {})

Of course, one should run GetCurrentState first to obtain the actual data first.