mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 10:50:15 -10:00
Mutter's org.gnome.Mutter.DisplayConfig is used by every threaded Linux and BSD build, through libdbus loaded at run time, and nothing that calls into it waits on the bus. One worker for the process connects, subscribes to MonitorsChanged and publishes Mutter's state, reading it again after every change; it waits in poll() on the bus socket and a wake pipe. The resolution list and availability are answered from the published state under a lock the worker takes only to swap it, so the menu, the refresh-rate check and the runloop's autoswitch no longer make a D-Bus round trip. A switch is checked against that state at once - a size or rate the head does not list is refused without asking Mutter - and applied by the worker against the state Mutter reports then, with the serial, layout and carried-over settings as before. Until the worker has answered, or where Mutter is not there, callers keep their own behaviour. dispserv_wl and dispserv_x11 ask for Mutter at each call rather than once at init. The runtime libdbus table gains the container, append, match and dispatch entry points this needs, checked against libdbus's headers by samples/frontend/dbus_runtime. samples/gfx/mutter_displayconfig builds on the loader and waits for the worker where it used to get a synchronous answer, and its mock announces MonitorsChanged as Mutter does.