summaryrefslogtreecommitdiff
path: root/panel
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-07-09 13:21:08 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-07-09 13:21:08 +0200
commitce0bcacee41d6a64e9a4710ac0dcb26d34eaa648 (patch)
tree7667124054ea1f99e2acc83249624a8ea1da844d /panel
parent9c22b436748dc5c05906f7f94da2b3b979352b31 (diff)
parent6a7ca90d7cf2e10c6993121289bc180e0e91a20d (diff)
Merge with trunk
(bzr r2364.10.5)
Diffstat (limited to 'panel')
-rw-r--r--panel/CMakeLists.txt7
-rw-r--r--panel/PanelController.cpp19
-rw-r--r--panel/PanelController.h1
-rw-r--r--panel/PanelIndicatorEntryView.h2
-rw-r--r--panel/PanelTitlebarGrabAreaView.cpp6
-rw-r--r--panel/PanelView.cpp8
-rw-r--r--panel/PanelView.h2
-rw-r--r--panel/WindowButtons.cpp10
8 files changed, 41 insertions, 14 deletions
diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt
index 6e3c68eea..fc30d76f3 100644
--- a/panel/CMakeLists.txt
+++ b/panel/CMakeLists.txt
@@ -10,13 +10,14 @@ set (CFLAGS
"-I${CMAKE_CURRENT_BINARY_DIR}"
)
-if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
set (CFLAGS ${CFLAGS} "-fPIC")
-endif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+endif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
add_definitions (${CFLAGS})
-set (LIBS ${CACHED_UNITY_DEPS_LIBRARIES} "-lunity-core-${UNITY_API_VERSION} -lm -lGL -lGLU")
+set (LIBS ${CACHED_UNITY_DEPS_LIBRARIES} ${UNITY_STANDALONE_LADD})
+
link_libraries (${LIBS})
set (LIB_PATHS ${CACHED_UNITY_DEPS_LIBRARY_DIRS})
diff --git a/panel/PanelController.cpp b/panel/PanelController.cpp
index 19873554f..460a61ee8 100644
--- a/panel/PanelController.cpp
+++ b/panel/PanelController.cpp
@@ -33,6 +33,8 @@ namespace unity
namespace panel
{
+const char window_title[] = "unity-panel";
+
namespace
{
nux::logging::Logger logger("unity.panel");
@@ -47,6 +49,7 @@ public:
void QueueRedraw();
std::vector<Window> GetTrayXids() const;
+ std::vector<nux::View*> GetPanelViews() const;
std::vector<nux::Geometry> GetGeometries() const;
// NOTE: nux::Property maybe?
@@ -104,6 +107,15 @@ std::vector<Window> Controller::Impl::GetTrayXids() const
return xids;
}
+std::vector<nux::View*> Controller::Impl::GetPanelViews() const
+{
+ std::vector<nux::View*> views;
+ views.reserve(windows_.size());
+ for (auto window: windows_)
+ views.push_back(ViewForWindow(window));
+ return views;
+}
+
std::vector<nux::Geometry> Controller::Impl::GetGeometries() const
{
std::vector<nux::Geometry> geometries;
@@ -243,7 +255,7 @@ void Controller::Impl::OnScreenChanged(unsigned int primary_monitor,
window->SetConfigureNotifyCallback(&Impl::WindowConfigureCallback, window.GetPointer());
window->SetBackgroundColor(nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
window->ShowWindow(true);
- window->EnableInputWindow(true, "panel", false, false);
+ window->EnableInputWindow(true, panel::window_title, false, false);
window->InputWindowEnableStruts(true);
window->SetGeometry(geo);
window->SetMinMaxSize(geo.width, geo.height);
@@ -323,6 +335,11 @@ std::vector<Window> Controller::GetTrayXids() const
return pimpl->GetTrayXids();
}
+std::vector<nux::View*> Controller::GetPanelViews() const
+{
+ return pimpl->GetPanelViews();
+}
+
std::vector<nux::Geometry> Controller::GetGeometries() const
{
return pimpl->GetGeometries();
diff --git a/panel/PanelController.h b/panel/PanelController.h
index 282d232eb..2c8a9c1bc 100644
--- a/panel/PanelController.h
+++ b/panel/PanelController.h
@@ -41,6 +41,7 @@ public:
void QueueRedraw();
std::vector<Window> GetTrayXids() const;
+ std::vector<nux::View*> GetPanelViews() const;
std::vector<nux::Geometry> GetGeometries() const;
// NOTE: nux::Property maybe?
diff --git a/panel/PanelIndicatorEntryView.h b/panel/PanelIndicatorEntryView.h
index 949e8681c..dcf3dd5a0 100644
--- a/panel/PanelIndicatorEntryView.h
+++ b/panel/PanelIndicatorEntryView.h
@@ -23,7 +23,7 @@
#include <Nux/TextureArea.h>
#include <Nux/View.h>
-#include <NuxImage/CairoGraphics.h>
+#include <NuxGraphics/CairoGraphics.h>
#include <NuxGraphics/GraphicsEngine.h>
#include <UnityCore/IndicatorEntry.h>
diff --git a/panel/PanelTitlebarGrabAreaView.cpp b/panel/PanelTitlebarGrabAreaView.cpp
index d200792d8..b072d4b05 100644
--- a/panel/PanelTitlebarGrabAreaView.cpp
+++ b/panel/PanelTitlebarGrabAreaView.cpp
@@ -31,8 +31,10 @@ namespace unity
{
namespace
{
- unsigned int MOUSE_DOWN_TIMEOUT = 150;
- unsigned int MOUSE_MOVEMENT_TOLERANCE = 4;
+
+const int MOUSE_DOWN_TIMEOUT = 150;
+const int MOUSE_MOVEMENT_TOLERANCE = 4;
+
}
PanelTitlebarGrabArea::PanelTitlebarGrabArea()
diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp
index 3ced1322f..85d8250ad 100644
--- a/panel/PanelView.cpp
+++ b/panel/PanelView.cpp
@@ -24,8 +24,8 @@
#include <Nux/Layout.h>
#include <Nux/WindowCompositor.h>
-#include <NuxImage/CairoGraphics.h>
-#include <NuxImage/ImageSurface.h>
+#include <NuxGraphics/CairoGraphics.h>
+#include <NuxGraphics/ImageSurface.h>
#include <NuxCore/Logger.h>
#include <UnityCore/GLibWrapper.h>
@@ -168,6 +168,7 @@ void PanelView::OnOverlayHidden(GVariant* data)
_active_overlay = "";
_menu_view->OverlayHidden();
_indicators->OverlayHidden();
+ SetAcceptKeyNavFocusOnMouseDown(true);
ForceUpdateBackground();
}
}
@@ -187,6 +188,7 @@ void PanelView::OnOverlayShown(GVariant* data)
_overlay_is_open = true;
_indicators->OverlayShown();
_menu_view->OverlayShown();
+ SetAcceptKeyNavFocusOnMouseDown(false);
ForceUpdateBackground();
}
}
@@ -233,7 +235,7 @@ PanelView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
}
else
{
- _bg_blur_texture = _bg_effect_helper.GetRegion(blur_geo);
+ _bg_blur_texture = _bg_effect_helper.GetRegion(blur_geo);
}
if (_bg_blur_texture.IsValid() && (_overlay_is_open || _opacity != 1.0f))
diff --git a/panel/PanelView.h b/panel/PanelView.h
index 8f45ec884..9dac92ea1 100644
--- a/panel/PanelView.h
+++ b/panel/PanelView.h
@@ -26,7 +26,7 @@
#include <Nux/View.h>
#include <Nux/TextureArea.h>
#include <NuxGraphics/GraphicsEngine.h>
-#include <NuxImage/CairoGraphics.h>
+#include <NuxGraphics/CairoGraphics.h>
#include <gdk/gdkx.h>
#include <UnityCore/DBusIndicators.h>
diff --git a/panel/WindowButtons.cpp b/panel/WindowButtons.cpp
index 26f087c39..2f2c149dd 100644
--- a/panel/WindowButtons.cpp
+++ b/panel/WindowButtons.cpp
@@ -46,6 +46,7 @@ public:
, _overlay_is_open(false)
, _opacity(1.0f)
{
+ SetAcceptKeyNavFocusOnMouseDown(false);
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &WindowButton::LoadImages));
LoadImages();
}
@@ -506,7 +507,7 @@ void WindowButtons::OnOverlayShown(GVariant* data)
glib::String overlay_identity;
gboolean can_maximise = FALSE;
gint32 overlay_monitor = 0;
- g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
+ g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
&overlay_identity, &can_maximise, &overlay_monitor);
if (overlay_monitor != monitor_)
@@ -539,6 +540,9 @@ void WindowButtons::OnOverlayShown(GVariant* data)
if (button->GetType() == panel::WindowButtonType::MAXIMIZE)
maximize_button = button;
+ if (button->GetType() == panel::WindowButtonType::MINIMIZE)
+ button->SetEnabled(false);
+
button->SetOverlayOpen(true);
}
}
@@ -574,7 +578,7 @@ void WindowButtons::OnOverlayHidden(GVariant* data)
glib::String overlay_identity;
gboolean can_maximise = FALSE;
gint32 overlay_monitor = 0;
- g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
+ g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
&overlay_identity, &can_maximise, &overlay_monitor);
if (overlay_monitor != monitor_)
@@ -681,7 +685,7 @@ void WindowButtons::OnDashSettingsUpdated()
restore_button->SetVisible(!maximizable);
maximize_button->SetVisible(maximizable);
- QueueDraw();
+ QueueRelayout();
}
}
}