diff options
| -rw-r--r-- | launcher/LauncherController.cpp | 7 | ||||
| -rw-r--r-- | unity-shared/UScreen.cpp | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/launcher/LauncherController.cpp b/launcher/LauncherController.cpp index 9997ff2b2..86d8ba20c 100644 --- a/launcher/LauncherController.cpp +++ b/launcher/LauncherController.cpp @@ -1253,10 +1253,15 @@ void Controller::HandleLauncherKeyRelease(bool was_tap, int when) bool Controller::HandleLauncherKeyEvent(unsigned long key_state, unsigned int key_sym, Time timestamp) { + Display* display = nux::GetGraphicsDisplay()->GetX11Display(); + // Turn the key_sym back to a keycode, this turns keypad key_sym to the correct top row key_code + unsigned int key_code = XKeysymToKeycode(display, key_sym); + // Shortcut to start launcher icons. Only relies on Keycode, ignore modifier for (auto const& icon : *pimpl->model_) { - if (icon->GetShortcut() == key_sym) + unsigned int shortcut_code = XKeysymToKeycode(display, icon->GetShortcut()); + if (shortcut_code == key_code) { if ((key_state & nux::KEY_MODIFIER_SHIFT) && icon->GetIconType() == AbstractLauncherIcon::IconType::APPLICATION) diff --git a/unity-shared/UScreen.cpp b/unity-shared/UScreen.cpp index 4a2ad6701..dcd3311f4 100644 --- a/unity-shared/UScreen.cpp +++ b/unity-shared/UScreen.cpp @@ -28,14 +28,19 @@ UScreen* UScreen::default_screen_ = nullptr; UScreen::UScreen() : primary_(0) , screen_(gdk_screen_get_default(), glib::AddRef()) - , proxy_("org.freedesktop.UPower", - "/org/freedesktop/UPower", - "org.freedesktop.UPower", + , proxy_("org.freedesktop.login1", + "/org/freedesktop/login1", + "org.freedesktop.login1.Manager", G_BUS_TYPE_SYSTEM) { size_changed_signal_.Connect(screen_, "size-changed", sigc::mem_fun(this, &UScreen::Changed)); monitors_changed_signal_.Connect(screen_, "monitors-changed", sigc::mem_fun(this, &UScreen::Changed)); - proxy_.Connect("Resuming", [this] (GVariant* data) { resuming.emit(); }); + proxy_.Connect("PrepareForSleep", [this] (GVariant* data) { + bool val; + g_variant_get(data, "(b)", &val); + if (!val) + resuming.emit(); + }); Refresh(); } |
