Add an OSD monitor labeler exposed on DBus

This DBus API is intended to be used by gnome-control-center's
displays panel to show monitor labels.

Each output (i.e. hardware monitor) identified by its
org.gnome.Mutter.DisplayConfig API ID has at most one label. On
mirrored setups, all the labels for outputs corresponding to the same
logical monitor (i.e. showing the same contents in the same mode) are
shown together.

At most, only one DBus client at a time is allowed to show labels.

https://bugzilla.gnome.org/show_bug.cgi?id=743744
This commit is contained in:
Rui Matos
2015-01-26 15:52:10 +01:00
parent fb6598ac10
commit 1900468846
5 changed files with 167 additions and 0 deletions

View File

@ -25,6 +25,10 @@ const GnomeShellIface = '<node> \
<method name="ShowOSD"> \
<arg type="a{sv}" direction="in" name="params"/> \
</method> \
<method name="ShowMonitorLabels"> \
<arg type="a{uv}" direction="in" name="params" /> \
</method> \
<method name="HideMonitorLabels" /> \
<method name="FocusApp"> \
<arg type="s" direction="in" name="id"/> \
</method> \
@ -240,6 +244,17 @@ const GnomeShell = new Lang.Class({
this._grabbers.delete(name);
},
ShowMonitorLabelsAsync: function(params, invocation) {
let sender = invocation.get_sender();
let [dict] = params;
Main.osdMonitorLabeler.show(sender, dict);
},
HideMonitorLabelsAsync: function(params, invocation) {
let sender = invocation.get_sender();
Main.osdMonitorLabeler.hide(sender);
},
Mode: global.session_mode,