ShellDBus: add ShowApplications method

Add a method to control the visibility of the applications view.
This can used by gnome-settings-daemon for special keys in
certain keyboards.

https://bugzilla.gnome.org/show_bug.cgi?id=698743
This commit is contained in:
Giovanni Campagna 2013-04-24 19:32:41 +02:00 committed by Giovanni Campagna
parent 415563dc6e
commit 9c814d1584
2 changed files with 11 additions and 4 deletions

View File

@ -28,6 +28,7 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
<method name="FocusApp"> <method name="FocusApp">
<arg type="s" direction="in" name="id"/> <arg type="s" direction="in" name="id"/>
</method> </method>
<method name="ShowApplications" />
<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"/>
@ -140,11 +141,12 @@ const GnomeShell = new Lang.Class({
}, },
FocusApp: function(id) { FocusApp: function(id) {
let overview = Main.overview; this.ShowApplications();
Main.overview.viewSelector.appDisplay.selectApp(id);
},
overview.show(); ShowApplications: function() {
overview.viewSelector.setActivePage(ViewSelector.ViewPage.APPS); Main.overview.viewSelector.showApps();
overview.viewSelector.appDisplay.selectApp(id);
}, },
GrabAcceleratorAsync: function(params, invocation) { GrabAcceleratorAsync: function(params, invocation) {

View File

@ -165,6 +165,11 @@ const ViewSelector = new Lang.Class({
this._showAppsButton.checked = !this._showAppsButton.checked; this._showAppsButton.checked = !this._showAppsButton.checked;
}, },
showApps: function() {
Main.overview.show();
this._showAppsButton.checked = true;
},
show: function() { show: function() {
this._activePage = this._workspacesPage; this._activePage = this._workspacesPage;