Add a FocusApp method to org.gnome.Shell

This method, which accepts a .desktop filename, is used to highlight
a specific application in the overview, for example because it has
just been created or installed.

https://bugzilla.gnome.org/show_bug.cgi?id=654086
This commit is contained in:
Giovanni Campagna
2011-07-09 15:30:42 +02:00
committed by Giovanni Campagna
parent bed653737b
commit 415563dc6e
4 changed files with 63 additions and 9 deletions

View File

@ -13,6 +13,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Hash = imports.misc.hash;
const Main = imports.ui.main;
const Screenshot = imports.ui.screenshot;
const ViewSelector = imports.ui.viewSelector;
const GnomeShellIface = <interface name="org.gnome.Shell">
<method name="Eval">
@ -24,6 +25,9 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
<method name="ShowOSD">
<arg type="a{sv}" direction="in" name="params"/>
</method>
<method name="FocusApp">
<arg type="s" direction="in" name="id"/>
</method>
<method name="GrabAccelerator">
<arg type="s" direction="in" name="accelerator"/>
<arg type="u" direction="in" name="flags"/>
@ -135,6 +139,14 @@ const GnomeShell = new Lang.Class({
Main.osdWindow.show();
},
FocusApp: function(id) {
let overview = Main.overview;
overview.show();
overview.viewSelector.setActivePage(ViewSelector.ViewPage.APPS);
overview.viewSelector.appDisplay.selectApp(id);
},
GrabAcceleratorAsync: function(params, invocation) {
let [accel, flags] = params;
let sender = invocation.get_sender();