From 71efe9368e7c624d80e7504be3971eb7e74cace2 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 9 Mar 2011 20:12:37 +0100 Subject: alt + F2 to active the new place. Will be nice now to check the place exists Fixes LP: #580295 (bzr r931.5.1) --- src/unityshell.cpp | 15 +++++++++++++++ src/unityshell.h | 13 +++++++++---- unityshell_xml.in | 5 +++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/unityshell.cpp b/src/unityshell.cpp index 47022e7cd..9f093b9a1 100644 --- a/src/unityshell.cpp +++ b/src/unityshell.cpp @@ -253,6 +253,20 @@ UnityScreen::showPanelFirstMenuKeyTerminate (CompAction *action, return false; } +bool +UnityScreen::executeCommand (CompAction *action, + CompAction::State state, + CompOption::Vector &options) +{ + ubus_server_send_message (ubus_server_get_default (), + UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, + g_variant_new ("(sus)", + "/com/canonical/unity/applicationsplace/runner", + 0, + "")); + return false; +} + void UnityScreen::restartLauncherKeyNav () { @@ -756,6 +770,7 @@ UnityScreen::UnityScreen (CompScreen *screen) : optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3)); optionSetKeyboardFocusInitiate (boost::bind (&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3)); //optionSetKeyboardFocusTerminate (boost::bind (&UnityScreen::setKeyboardFocusKeyTerminate, this, _1, _2, _3)); + optionSetExecuteCommandInitiate (boost::bind (&UnityScreen::executeCommand, this, _1, _2, _3)); optionSetPanelFirstMenuInitiate (boost::bind (&UnityScreen::showPanelFirstMenuKeyInitiate, this, _1, _2, _3)); optionSetPanelFirstMenuTerminate(boost::bind (&UnityScreen::showPanelFirstMenuKeyTerminate, this, _1, _2, _3)); diff --git a/src/unityshell.h b/src/unityshell.h index d7abdf89c..7188c4750 100644 --- a/src/unityshell.h +++ b/src/unityshell.h @@ -104,14 +104,19 @@ class UnityScreen : showLauncherKeyTerminate (CompAction *action, CompAction::State state, CompOption::Vector &options); - bool - showPanelFirstMenuKeyInitiate (CompAction *action, - CompAction::State state, - CompOption::Vector &options); + bool + showPanelFirstMenuKeyInitiate (CompAction *action, + CompAction::State state, + CompOption::Vector &options); bool showPanelFirstMenuKeyTerminate (CompAction *action, CompAction::State state, CompOption::Vector &options); + + bool + executeCommand (CompAction* action, + CompAction::State state, + CompOption::Vector& options); bool setKeyboardFocusKeyInitiate (CompAction* action, CompAction::State state, diff --git a/unityshell_xml.in b/unityshell_xml.in index 18b7d1231..ea2a01f08 100644 --- a/unityshell_xml.in +++ b/unityshell_xml.in @@ -72,6 +72,11 @@ <_long>Set the keyboard-focus on the launcher so it can be navigated with the cursor-keys <Alt>F1 +