diff --git a/js/ui/osdMonitorLabeler.js b/js/ui/osdMonitorLabeler.js index 90682bdf0..83a79278d 100644 --- a/js/ui/osdMonitorLabeler.js +++ b/js/ui/osdMonitorLabeler.js @@ -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) { if (!this._untrackClient(client)) return; diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 14dba7292..9259f8488 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -28,6 +28,9 @@ const GnomeShellIface = ' \ \ \ \ + \ + \ + \ \ \ \ @@ -250,6 +253,12 @@ const GnomeShell = new Lang.Class({ 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) { let sender = invocation.get_sender(); Main.osdMonitorLabeler.hide(sender);