shellDBus: Export ShowOSD() method on the bus
Export a simple method to trigger an OSD popup. gnome-settings-daemon will use this to replace its own OSD UI. https://bugzilla.gnome.org/show_bug.cgi?id=613543
This commit is contained in:
parent
19533f87e3
commit
90ea27c423
@ -20,6 +20,9 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
|
|||||||
<arg type="b" direction="out" name="success" />
|
<arg type="b" direction="out" name="success" />
|
||||||
<arg type="s" direction="out" name="result" />
|
<arg type="s" direction="out" name="result" />
|
||||||
</method>
|
</method>
|
||||||
|
<method name="ShowOSD">
|
||||||
|
<arg type="a{sv}" direction="in" name="params"/>
|
||||||
|
</method>
|
||||||
<method name="GrabAccelerator">
|
<method name="GrabAccelerator">
|
||||||
<arg type="s" direction="in" name="accelerator"/>
|
<arg type="s" direction="in" name="accelerator"/>
|
||||||
<arg type="u" direction="in" name="flags"/>
|
<arg type="u" direction="in" name="flags"/>
|
||||||
@ -111,6 +114,21 @@ const GnomeShell = new Lang.Class({
|
|||||||
return [success, returnValue];
|
return [success, returnValue];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ShowOSD: function(params) {
|
||||||
|
for (let param in params)
|
||||||
|
params[param] = params[param].deep_unpack();
|
||||||
|
|
||||||
|
let icon = null;
|
||||||
|
if (params['icon'])
|
||||||
|
icon = Gio.Icon.new_for_string(params['icon']);
|
||||||
|
|
||||||
|
Main.osdWindow.setIcon(icon);
|
||||||
|
Main.osdWindow.setLabel(params['label']);
|
||||||
|
Main.osdWindow.setLevel(params['level']);
|
||||||
|
|
||||||
|
Main.osdWindow.show();
|
||||||
|
},
|
||||||
|
|
||||||
GrabAcceleratorAsync: function(params, invocation) {
|
GrabAcceleratorAsync: function(params, invocation) {
|
||||||
let [accel, flags] = params;
|
let [accel, flags] = params;
|
||||||
let sender = invocation.get_sender();
|
let sender = invocation.get_sender();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user