Hints

This is a unsorted list of hints when developing for phosh

Manager Objects

Phosh uses several manager objects e.g. PhoshBackgroundManager, PhoshMonitorManager, PhoshLockscreenManager to keep track of certain objects (monitors, lock screens, backgrounds) and to trigger events on those when needed. They’re usually created and disposed by PhoshShell. Some of them like PhoshWayland are singletons so you can access them from basically anywhere in the codebase.

Status Information Widgets

Several widgets listen to changes on DBus objects in order to e.g. display the current connectivity - see PhoshConnectivityInfo for an example that monitors network connectivity.

Sometimes it is no longer useful to show the widget (since e.g. the corresponding DBus service went away). In that case the widget should flip a boolean property so the parent container can hide the object via #g_object_bind_property().

Debugging

Since phosh is a GTK application you can use GtkInspector. You can use the GTK_INSPECTOR_DISPLAY enviroment variable to use a different wayland display for the inspector window. This can be useful to have the inspector windows outside of a nested wayland session.