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.
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?
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.
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.
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: