summaryrefslogtreecommitdiff
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2014-02-22 06:55:47 +0100
committerAndrea Azzarone <azzaronea@gmail.com>2014-02-22 06:55:47 +0100
commit04b4da47db77cfc275f26e05d920196f15ffe516 (patch)
tree1e638927804b379c482f18e202c01e4e6536cef5
parent7c16339e770bca17c741b862e672bfc5c9382605 (diff)
Correct handle the grab when using the keyboard shortcut to lock the screen.
(bzr r3566.5.444)
-rw-r--r--lockscreen/LockScreenShield.cpp6
-rw-r--r--lockscreen/LockScreenShield.h2
-rw-r--r--panel/PanelView.cpp1
-rw-r--r--plugins/unityshell/src/unityshell.cpp6
4 files changed, 10 insertions, 5 deletions
diff --git a/lockscreen/LockScreenShield.cpp b/lockscreen/LockScreenShield.cpp
index 25f6c03e2..e96778307 100644
--- a/lockscreen/LockScreenShield.cpp
+++ b/lockscreen/LockScreenShield.cpp
@@ -98,8 +98,8 @@ nux::View* Shield::CreatePanel()
auto menu_manager = std::make_shared<menu::Manager>(indicators, gnome_grabber);
// Hackish but ok for the moment. Would be nice to have menus without grab.
- //indicators->on_entry_show_menu.connect(sigc::mem_fun(this, &Shield::OnIndicatorEntryShowMenu));
- //indicators->on_entry_activated.connect(sigc::mem_fun(this, &Shield::OnIndicatorEntryActivated));
+ indicators->on_entry_show_menu.connect(sigc::mem_fun(this, &Shield::OnIndicatorEntryShowMenu));
+ indicators->on_entry_activated.connect(sigc::mem_fun(this, &Shield::OnIndicatorEntryActivated));
panel::PanelView* panel_view = new panel::PanelView(this, menu_manager, /*lockscreen_mode*/ true);
panel_view->SetMaximumHeight(panel::Style::Instance().PanelHeight(monitor_));
@@ -129,7 +129,7 @@ void Shield::OnIndicatorEntryShowMenu(std::string const&, unsigned, int, int, un
UnGrabKeyboard();
}
-void Shield::OnIndicatorEntryActivated(std::string const& entry, nux::Geometry const& geo)
+void Shield::OnIndicatorEntryActivated(std::string const& panel, std::string const& entry, nux::Geometry const& geo)
{
if (entry.empty() and geo.IsNull()) /* on menu closed */
{
diff --git a/lockscreen/LockScreenShield.h b/lockscreen/LockScreenShield.h
index c652a5c9d..c37e6ab0e 100644
--- a/lockscreen/LockScreenShield.h
+++ b/lockscreen/LockScreenShield.h
@@ -56,7 +56,7 @@ private:
nux::View* CreatePromptView();
void OnIndicatorEntryShowMenu(std::string const&, unsigned, int, int, unsigned);
- void OnIndicatorEntryActivated(std::string const& entry, nux::Geometry const& geo);
+ void OnIndicatorEntryActivated(std::string const& panel, std::string const& entry, nux::Geometry const& geo);
session::Manager::Ptr session_manager_;
diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp
index 93bb869fc..d5d678395 100644
--- a/panel/PanelView.cpp
+++ b/panel/PanelView.cpp
@@ -104,6 +104,7 @@ PanelView::PanelView(MockableBaseWindow* parent, menu::Manager::Ptr const& menus
SetCompositionLayout(layout_);
+ tray_ = nullptr;
if (!lockscreen_mode_)
{
tray_ = new PanelTray(monitor_);
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 5a3395d2c..8ce36bd2e 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -2526,7 +2526,11 @@ bool UnityScreen::LockScreenInitiate(CompAction* action,
CompAction::State state,
CompOption::Vector& options)
{
- session_controller_->LockScreen();
+ sources_.AddIdle([this] {
+ session_controller_->LockScreen();
+ return false;
+ });
+
return true;
}