summaryrefslogtreecommitdiff
path: root/plugins
diff options
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp57
-rw-r--r--plugins/unityshell/src/unityshell.h6
-rw-r--r--plugins/unityshell/unityshell.xml.in2
3 files changed, 45 insertions, 20 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 530d9620f..05284b483 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -570,8 +570,8 @@ void UnityScreen::InitAltTabNextWindow()
void UnityScreen::OnInitiateSpread()
{
scale_just_activated_ = super_keypressed_;
- spread_filter_ = std::make_shared<spread::Filter>();
- spread_filter_->text.changed.connect([this] (std::string const& filter) {
+ spread_widgets_ = std::make_shared<spread::Widgets>();
+ spread_widgets_->GetFilter()->text.changed.connect([this] (std::string const& filter) {
if (filter.empty())
{
sScreen->relayoutSlots(CompMatch::emptyMatch);
@@ -579,7 +579,7 @@ void UnityScreen::OnInitiateSpread()
else
{
CompMatch windows_match;
- auto const& filtered_windows = spread_filter_->FilteredWindows();
+ auto const& filtered_windows = spread_widgets_->GetFilter()->FilteredWindows();
for (auto const& swin : sScreen->getWindows())
{
@@ -610,7 +610,7 @@ void UnityScreen::OnInitiateSpread()
void UnityScreen::OnTerminateSpread()
{
- spread_filter_.reset();
+ spread_widgets_.reset();
for (auto const& swin : sScreen->getWindows())
UnityWindow::get(swin->window)->OnTerminateSpread();
@@ -1745,7 +1745,7 @@ void UnityScreen::compizDamageNux(CompRegion const& damage)
auto const& geo = NuxGeometryFromCompRect(r);
wt->PresentWindowsIntersectingGeometryOnThisFrame(geo);
}
-
+
auto const& launchers = launcher_controller_->launchers();
for (auto const& launcher : launchers)
@@ -1857,8 +1857,13 @@ void UnityScreen::handleEvent(XEvent* event)
}
if (wm.IsScaleActive())
{
- if (spread_filter_ && spread_filter_->Visible())
- skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
+ if (spread_widgets_)
+ {
+ auto const& spread_filter = spread_widgets_->GetFilter();
+
+ if (spread_filter && spread_filter->Visible())
+ skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
+ }
if (!skip_other_plugins)
{
@@ -1941,8 +1946,13 @@ void UnityScreen::handleEvent(XEvent* event)
}
else if (wm.IsScaleActive())
{
- if (spread_filter_ && spread_filter_->Visible())
- skip_other_plugins = spread_filter_->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
+ if (spread_widgets_)
+ {
+ auto const& spread_filter = spread_widgets_->GetFilter();
+
+ if (spread_filter && spread_filter->Visible())
+ skip_other_plugins = spread_filter->GetAbsoluteGeometry().IsPointInside(event->xbutton.x_root, event->xbutton.y_root);
+ }
if (!skip_other_plugins)
{
@@ -2018,12 +2028,12 @@ void UnityScreen::handleEvent(XEvent* event)
}
}
- if (spread_filter_ && spread_filter_->Visible())
+ if (spread_widgets_ && spread_widgets_->GetFilter()->Visible())
{
if (key_sym == XK_Escape)
{
skip_other_plugins = true;
- spread_filter_->text = "";
+ spread_widgets_->GetFilter()->text = "";
}
}
@@ -2072,7 +2082,7 @@ void UnityScreen::handleEvent(XEvent* event)
skip_other_plugins = true;
}
- if (spread_filter_ && spread_filter_->Visible())
+ if (spread_widgets_ && spread_widgets_->GetFilter() && spread_widgets_->GetFilter()->Visible())
skip_other_plugins = false;
if (!skip_other_plugins &&
@@ -3013,9 +3023,9 @@ bool UnityWindow::glPaint(const GLWindowPaintAttrib& attrib,
wAttrib.opacity = 0.0;
int old_index = gWindow->glPaintGetCurrentIndex();
gWindow->glPaintSetCurrentIndex(MAXSHORT);
+ deco_win_->Paint(matrix, wAttrib, region, mask);
bool ret = gWindow->glPaint(wAttrib, matrix, region, mask);
gWindow->glPaintSetCurrentIndex(old_index);
- deco_win_->Paint(matrix, wAttrib, region, mask);
return ret;
}
}
@@ -3189,6 +3199,9 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
bool UnityWindow::damageRect(bool initial, CompRect const& rect)
{
+ if (uScreen->lockscreen_controller_->IsLocked() && !CanBypassLockScreen())
+ return true;
+
if (initial)
deco_win_->Update();
@@ -3357,6 +3370,7 @@ void UnityWindow::windowNotify(CompWindowNotify n)
PluginAdapter::Default().UpdateShowDesktopState();
break;
case CompWindowNotifyBeforeDestroy:
+ deco_win_->Undecorate();
being_destroyed.emit();
break;
case CompWindowNotifyMinimize:
@@ -3417,7 +3431,7 @@ void UnityWindow::stateChangeNotify(unsigned int lastState)
uScreen->fullscreen_windows_.remove(window);
}
- deco_win_->Update();
+ deco_win_->UpdateWindowState(lastState);
PluginAdapter::Default().NotifyStateChange(window, window->state(), lastState);
window->stateChangeNotify(lastState);
}
@@ -3459,6 +3473,7 @@ void UnityWindow::moveNotify(int x, int y, bool immediate)
void UnityWindow::resizeNotify(int x, int y, int w, int h)
{
deco_win_->UpdateDecorationPositionDelayed();
+ CleanupCachedTextures();
PluginAdapter::Default().NotifyResized(window, x, y, w, h);
window->resizeNotify(x, y, w, h);
}
@@ -3968,6 +3983,8 @@ void UnityScreen::OnScreenLocked()
// We disable the edge barriers, to avoid blocking the mouse pointer during lockscreen
edge_barriers_->force_disable = true;
+
+ UpdateGesturesSupport();
}
void UnityScreen::OnScreenUnlocked()
@@ -3984,6 +4001,8 @@ void UnityScreen::OnScreenUnlocked()
screen->addAction(&action);
edge_barriers_->force_disable = false;
+
+ UpdateGesturesSupport();
}
void UnityScreen::SaveLockStamp(bool save)
@@ -4192,9 +4211,11 @@ lockscreen::Controller::Ptr UnityScreen::lockscreen_controller()
void UnityScreen::UpdateGesturesSupport()
{
- Settings::Instance().gestures_launcher_drag() ? gestures_sub_launcher_->Activate() : gestures_sub_launcher_->Deactivate();
- Settings::Instance().gestures_dash_tap() ? gestures_sub_dash_->Activate() : gestures_sub_dash_->Deactivate();
- Settings::Instance().gestures_windows_drag_pinch() ? gestures_sub_windows_->Activate() : gestures_sub_windows_->Deactivate();
+ auto& s = Settings::Instance();
+ bool locked = lockscreen_controller_ && lockscreen_controller_->IsLocked();
+ (!locked && s.gestures_launcher_drag()) ? gestures_sub_launcher_->Activate() : gestures_sub_launcher_->Deactivate();
+ (!locked && s.gestures_dash_tap()) ? gestures_sub_dash_->Activate() : gestures_sub_dash_->Deactivate();
+ (!locked && s.gestures_windows_drag_pinch()) ? gestures_sub_windows_->Activate() : gestures_sub_windows_->Deactivate();
}
void UnityScreen::InitGesturesSupport()
@@ -4773,7 +4794,7 @@ void ScreenIntrospection::AddProperties(debug::IntrospectionData& introspection)
Introspectable::IntrospectableList ScreenIntrospection::GetIntrospectableChildren()
{
- IntrospectableList children({uScreen->spread_filter_.get()});
+ IntrospectableList children({uScreen->spread_widgets_ ? uScreen->spread_widgets_->GetFilter().get() : nullptr});
for (auto const& win : screen_->windows())
children.push_back(UnityWindow::get(win));
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 789e18aaf..84c3bdcca 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -56,6 +56,7 @@
#include "DashStyle.h"
#include "EdgeBarrierController.h"
#include "FavoriteStoreGSettings.h"
+#include "InputMonitor.h"
#include "ShortcutController.h"
#include "LauncherController.h"
#include "LockScreenController.h"
@@ -69,7 +70,7 @@
#include "SwitcherController.h"
#include "SessionController.h"
#include "SessionDBusManager.h"
-#include "SpreadFilter.h"
+#include "SpreadWidgets.h"
#include "UBusWrapper.h"
#include "UnityshellPrivate.h"
#include "UnityShowdesktopHandler.h"
@@ -317,6 +318,7 @@ private:
internal::FavoriteStoreGSettings favorite_store_;
ThumbnailGenerator thumbnail_generator_;
lockscreen::Settings lockscreen_settings_;
+ input::Monitor input_monitor_;
/* The window thread should be the last thing removed, as c++ does it in reverse order */
std::unique_ptr<nux::WindowThread> wt;
@@ -340,7 +342,7 @@ private:
ui::EdgeBarrierController::Ptr edge_barriers_;
debug::DebugDBusInterface debugger_;
std::unique_ptr<BGHash> bghash_;
- spread::Filter::Ptr spread_filter_;
+ spread::Widgets::Ptr spread_widgets_;
/* Subscription for gestures that manipulate Unity launcher */
std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_;
diff --git a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in
index ee1469345..1820f27d2 100644
--- a/plugins/unityshell/unityshell.xml.in
+++ b/plugins/unityshell/unityshell.xml.in
@@ -39,6 +39,8 @@
<plugin>compiztoolbox</plugin>
<plugin>scale</plugin>
<plugin>expo</plugin>
+ <plugin>move</plugin>
+ <plugin>resize</plugin>
</requirement>
<conflict>
<plugin>decor</plugin>