Add ShowMonitorLabels2 D-Bus API
Add a new D-Bus method for setting the monitor labels. This new method takes connector names instead of output ids for associating with actual monitors. https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
parent
082bc20bb9
commit
4cd4678194
@ -120,6 +120,25 @@ const OsdMonitorLabeler = new Lang.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
show2: function(client, params) {
|
||||||
|
if (!this._trackClient(client))
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._reset();
|
||||||
|
|
||||||
|
for (let connector in params) {
|
||||||
|
let monitor = this._monitorManager.get_monitor_for_connector(connector);
|
||||||
|
if (monitor == -1)
|
||||||
|
continue;
|
||||||
|
this._monitorLabels.get(monitor).push(params[connector].deep_unpack());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let [monitor, labels] of this._monitorLabels.entries()) {
|
||||||
|
labels.sort();
|
||||||
|
this._osdLabels.push(new OsdMonitorLabel(monitor, labels.join(' ')));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
hide: function(client) {
|
hide: function(client) {
|
||||||
if (!this._untrackClient(client))
|
if (!this._untrackClient(client))
|
||||||
return;
|
return;
|
||||||
|
@ -28,6 +28,9 @@ const GnomeShellIface = '<node> \
|
|||||||
<method name="ShowMonitorLabels"> \
|
<method name="ShowMonitorLabels"> \
|
||||||
<arg type="a{uv}" direction="in" name="params" /> \
|
<arg type="a{uv}" direction="in" name="params" /> \
|
||||||
</method> \
|
</method> \
|
||||||
|
<method name="ShowMonitorLabels2"> \
|
||||||
|
<arg type="a{sv}" direction="in" name="params" /> \
|
||||||
|
</method> \
|
||||||
<method name="HideMonitorLabels" /> \
|
<method name="HideMonitorLabels" /> \
|
||||||
<method name="FocusApp"> \
|
<method name="FocusApp"> \
|
||||||
<arg type="s" direction="in" name="id"/> \
|
<arg type="s" direction="in" name="id"/> \
|
||||||
@ -250,6 +253,12 @@ const GnomeShell = new Lang.Class({
|
|||||||
Main.osdMonitorLabeler.show(sender, dict);
|
Main.osdMonitorLabeler.show(sender, dict);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ShowMonitorLabels2Async: function(params, invocation) {
|
||||||
|
let sender = invocation.get_sender();
|
||||||
|
let [dict] = params;
|
||||||
|
Main.osdMonitorLabeler.show2(sender, dict);
|
||||||
|
},
|
||||||
|
|
||||||
HideMonitorLabelsAsync: function(params, invocation) {
|
HideMonitorLabelsAsync: function(params, invocation) {
|
||||||
let sender = invocation.get_sender();
|
let sender = invocation.get_sender();
|
||||||
Main.osdMonitorLabeler.hide(sender);
|
Main.osdMonitorLabeler.hide(sender);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user