diff options
| author | Jacob Edwards <> | 2013-03-05 14:11:25 -0500 |
|---|---|---|
| committer | Jacob Edwards <> | 2013-03-05 14:11:25 -0500 |
| commit | b1a64be9c7b382cdaec1dbc6cbe33cf698e97044 (patch) | |
| tree | cf6da6e8ab11c3ad4d5637092ee35f59f7d617ff /launcher | |
| parent | 34585d9838809fecccf4f61cfb13fda6fdead73e (diff) | |
| parent | d9b110bdecaf4dce8a5d39e632a4a3b7cd0aab8e (diff) | |
Merge trunk
(bzr r3173.1.24)
Diffstat (limited to 'launcher')
| -rw-r--r-- | launcher/BFBLauncherIcon.cpp | 3 | ||||
| -rw-r--r-- | launcher/HudLauncherIcon.cpp | 3 | ||||
| -rw-r--r-- | launcher/Launcher.cpp | 11 | ||||
| -rw-r--r-- | launcher/Launcher.h | 7 | ||||
| -rw-r--r-- | launcher/LauncherController.cpp | 8 | ||||
| -rw-r--r-- | launcher/StandaloneLauncher.cpp | 1 | ||||
| -rw-r--r-- | launcher/XdndCollectionWindowImp.cpp | 19 |
7 files changed, 34 insertions, 18 deletions
diff --git a/launcher/BFBLauncherIcon.cpp b/launcher/BFBLauncherIcon.cpp index a84d71f7b..f7d701020 100644 --- a/launcher/BFBLauncherIcon.cpp +++ b/launcher/BFBLauncherIcon.cpp @@ -58,8 +58,9 @@ void BFBLauncherIcon::OnOverlayShown(GVariant *data, bool visible) unity::glib::String overlay_identity; gboolean can_maximise = FALSE; gint32 overlay_monitor = 0; + int width, height; g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, - &overlay_identity, &can_maximise, &overlay_monitor); + &overlay_identity, &can_maximise, &overlay_monitor, &width, &height); if (overlay_identity.Str() == "dash" && IsVisibleOnMonitor(overlay_monitor)) { diff --git a/launcher/HudLauncherIcon.cpp b/launcher/HudLauncherIcon.cpp index 7fea6c4f7..39fa01a0d 100644 --- a/launcher/HudLauncherIcon.cpp +++ b/launcher/HudLauncherIcon.cpp @@ -89,8 +89,9 @@ void HudLauncherIcon::OnOverlayShown(GVariant* data, bool visible) unity::glib::String overlay_identity; gboolean can_maximise = FALSE; gint32 overlay_monitor = 0; + int width, height; g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, - &overlay_identity, &can_maximise, &overlay_monitor); + &overlay_identity, &can_maximise, &overlay_monitor, &width, &height); // If the hud is open, we show the HUD button if we have a locked launcher if (overlay_identity.Str() == "hud" && diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index 9f1687176..79c8f472f 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -101,7 +101,7 @@ NUX_IMPLEMENT_OBJECT_TYPE(Launcher); const int Launcher::Launcher::ANIM_DURATION_SHORT = 125; -Launcher::Launcher(nux::BaseWindow* parent, +Launcher::Launcher(MockableBaseWindow* parent, NUX_FILE_LINE_DECL) : View(NUX_FILE_LINE_PARAM) #ifdef USE_X11 @@ -1225,8 +1225,9 @@ void Launcher::OnOverlayShown(GVariant* data) unity::glib::String overlay_identity; gboolean can_maximise = FALSE; gint32 overlay_monitor = 0; + int width, height; g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, - &overlay_identity, &can_maximise, &overlay_monitor); + &overlay_identity, &can_maximise, &overlay_monitor, &width, &height); std::string identity(overlay_identity.Str()); LOG_DEBUG(logger) << "Overlay shown: " << identity @@ -1266,8 +1267,9 @@ void Launcher::OnOverlayHidden(GVariant* data) unity::glib::String overlay_identity; gboolean can_maximise = FALSE; gint32 overlay_monitor = 0; + int width, height; g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, - &overlay_identity, &can_maximise, &overlay_monitor); + &overlay_identity, &can_maximise, &overlay_monitor, &width, &height); std::string identity = overlay_identity.Str(); @@ -1331,7 +1333,8 @@ void Launcher::SetHidden(bool hide_launcher) TimeUtil::SetTimeStruct(&_times[TIME_AUTOHIDE], &_times[TIME_AUTOHIDE], ANIM_DURATION_SHORT); - _parent->EnableInputWindow(!hide_launcher, launcher::window_title, false, false); + if (nux::GetWindowThread()->IsEmbeddedWindow()) + _parent->EnableInputWindow(!hide_launcher, launcher::window_title, false, false); if (!hide_launcher && GetActionState() == ACTION_DRAG_EXTERNAL) DndReset(); diff --git a/launcher/Launcher.h b/launcher/Launcher.h index 0f4efb095..ac61275d6 100644 --- a/launcher/Launcher.h +++ b/launcher/Launcher.h @@ -39,6 +39,7 @@ #include "LauncherDragWindow.h" #include "LauncherHideMachine.h" #include "LauncherHoverMachine.h" +#include "unity-shared/MockableBaseWindow.h" #include "unity-shared/UBusWrapper.h" #include "SoftwareCenterLauncherIcon.h" #include "TooltipManager.h" @@ -66,7 +67,7 @@ class Launcher : public unity::debug::Introspectable, NUX_DECLARE_OBJECT_TYPE(Launcher, nux::View); public: - Launcher(nux::BaseWindow* parent, NUX_FILE_LINE_PROTO); + Launcher(MockableBaseWindow* parent, NUX_FILE_LINE_PROTO); nux::Property<Display*> display; nux::Property<int> monitor; @@ -100,7 +101,7 @@ public: BacklightMode GetBacklightMode() const; bool IsBackLightModeToggles() const; - nux::BaseWindow* GetParent() const + MockableBaseWindow* GetParent() const { return _parent; }; @@ -336,7 +337,7 @@ private: bool DndIsSpecialRequest(std::string const& uri) const; LauncherModel::Ptr _model; - nux::BaseWindow* _parent; + MockableBaseWindow* _parent; nux::ObjectPtr<nux::View> _active_tooltip; QuicklistView* _active_quicklist; diff --git a/launcher/LauncherController.cpp b/launcher/LauncherController.cpp index a9cd3fba8..533d9489c 100644 --- a/launcher/LauncherController.cpp +++ b/launcher/LauncherController.cpp @@ -24,7 +24,6 @@ #include <Nux/Nux.h> #include <Nux/HLayout.h> -#include <Nux/BaseWindow.h> #include <NuxCore/Logger.h> #include <UnityCore/DesktopUtilities.h> @@ -314,7 +313,7 @@ void Controller::Impl::OnDndMonitorChanged(int monitor) Launcher* Controller::Impl::CreateLauncher() { - nux::BaseWindow* launcher_window = new nux::BaseWindow(TEXT("LauncherWindow")); + auto* launcher_window = new MockableBaseWindow(TEXT("LauncherWindow")); Launcher* launcher = new Launcher(launcher_window); launcher->options = parent_->options(); @@ -329,7 +328,10 @@ Launcher* Controller::Impl::CreateLauncher() launcher_window->SetLayout(layout); launcher_window->SetBackgroundColor(nux::color::Transparent); launcher_window->ShowWindow(true); - launcher_window->EnableInputWindow(true, launcher::window_title, false, false); + + if (nux::GetWindowThread()->IsEmbeddedWindow()) + launcher_window->EnableInputWindow(true, launcher::window_title, false, false); + launcher_window->InputWindowEnableStruts(parent_->options()->hide_mode == LAUNCHER_HIDE_NEVER); launcher_window->SetEnterFocusInputArea(launcher); diff --git a/launcher/StandaloneLauncher.cpp b/launcher/StandaloneLauncher.cpp index ccc5e11e4..777951f6f 100644 --- a/launcher/StandaloneLauncher.cpp +++ b/launcher/StandaloneLauncher.cpp @@ -64,7 +64,6 @@ private: { SetupBackground(); controller.reset(new launcher::Controller(std::make_shared<XdndManager>())); - controller->launcher().GetParent()->EnableInputWindow(false); UScreen* uscreen = UScreen::GetDefault(); std::vector<nux::Geometry> fake_monitor({nux::Geometry(0, 0, win_size.width, win_size.height)}); diff --git a/launcher/XdndCollectionWindowImp.cpp b/launcher/XdndCollectionWindowImp.cpp index e39f373a7..b98075187 100644 --- a/launcher/XdndCollectionWindowImp.cpp +++ b/launcher/XdndCollectionWindowImp.cpp @@ -40,9 +40,14 @@ public: ShowWindow(true); PushToBack(); - // Hack to create the X Window as soon as possible. - EnableInputWindow(true, "XdndCollectionWindowImp"); - EnableInputWindow(false, "XdndCollectionWindowImp"); + + if (nux::GetWindowThread()->IsEmbeddedWindow()) + { + // Hack to create the X Window as soon as possible. + EnableInputWindow(true, "XdndCollectionWindowImp"); + EnableInputWindow(false, "XdndCollectionWindowImp"); + } + SetDndEnabled(false, true); uscreen->changed.connect(sigc::mem_fun(this, &PrivateWindow::OnScreenChanged)); @@ -100,13 +105,17 @@ void XdndCollectionWindowImp::Collect() // the launcher window and the dash window. Don't forget to call PushToBack as // soon as possible. window_->PushToFront(); - window_->EnableInputWindow(true, "XdndCollectionWindowImp"); + + if (nux::GetWindowThread()->IsEmbeddedWindow()) + window_->EnableInputWindow(true, "XdndCollectionWindowImp"); } void XdndCollectionWindowImp::Deactivate() { window_->PushToBack(); - window_->EnableInputWindow(false, "XdndCollectionWindowImp"); + + if (nux::GetWindowThread()->IsEmbeddedWindow()) + window_->EnableInputWindow(false, "XdndCollectionWindowImp"); } } |
