summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-08-31 10:21:02 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-08-31 10:21:02 -0300
commit4582bbdae6b09e951de548797c00423a838ceb6a (patch)
tree2b637f0c861da0a89a8ee5a3bdf9f96f5e1ac0a0 /plugins
parent7d2ec28833df246c0810c90f8e846769308bc6bc (diff)
parentec134eff401b69f80e0e80793d43bac28e01bcc0 (diff)
Merged mainline.
(bzr r2571.5.16)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/WindowMinimizeSpeedController.cpp108
-rw-r--r--plugins/unityshell/src/WindowMinimizeSpeedController.h57
-rw-r--r--plugins/unityshell/src/unityshell.cpp275
-rw-r--r--plugins/unityshell/src/unityshell.h7
-rw-r--r--plugins/unityshell/unityshell.xml.in20
5 files changed, 407 insertions, 60 deletions
diff --git a/plugins/unityshell/src/WindowMinimizeSpeedController.cpp b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
new file mode 100644
index 000000000..66f28d8fc
--- /dev/null
+++ b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
@@ -0,0 +1,108 @@
+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
+/* Compiz unity plugin
+ * unity.h
+ *
+ * Copyright (c) 2010-11 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Your own copyright notice would go above. You are free to choose whatever
+ * licence you want, just take note that some compiz code is GPL and you will
+ * not be able to re-use it if you want to use a different licence.
+ */
+
+#include <gio/gio.h>
+#include <NuxCore/Logger.h>
+
+#include "WindowMinimizeSpeedController.h"
+
+namespace
+{
+
+nux::logging::Logger logger ("unity.WindowMinimizeSpeedController");
+
+namespace local
+{
+const std::string UNITY_SCHEMA = "com.canonical.Unity";
+}
+}
+
+WindowMinimizeSpeedController::WindowMinimizeSpeedController()
+ : _settings(g_settings_new(local::UNITY_SCHEMA.c_str()))
+ , _minimize_count(g_settings_get_int(_settings, "minimize-count"))
+ , _minimize_speed_threshold(g_settings_get_int(_settings, "minimize-speed-threshold"))
+ , _minimize_slow_duration(g_settings_get_int(_settings, "minimize-slow-duration"))
+ , _minimize_fast_duration(g_settings_get_int(_settings, "minimize-fast-duration"))
+{
+ _minimize_count_changed.Connect(_settings, "changed::minimize-count",
+ [&] (GSettings*, gchar* name) {
+ _minimize_count = g_settings_get_int(_settings, name);
+ SetDuration();
+ });
+ _minimize_speed_threshold_changed.Connect(_settings, "changed::minimize-speed-threshold",
+ [&] (GSettings*, gchar* name) {
+ _minimize_speed_threshold = g_settings_get_int(_settings, name);
+ SetDuration();
+ });
+ _minimize_fast_duration_changed.Connect(_settings, "changed::minimize-fast-duration",
+ [&] (GSettings*, gchar* name) {
+ _minimize_fast_duration = g_settings_get_int(_settings, name);
+ SetDuration();
+ });
+ _minimize_slow_duration_changed.Connect(_settings, "changed::minimize-slow-duration",
+ [&] (GSettings*, gchar* name) {
+ _minimize_slow_duration = g_settings_get_int(_settings, name);
+ SetDuration();
+ });
+}
+
+void WindowMinimizeSpeedController::UpdateCount()
+{
+ if (_minimize_count < _minimize_speed_threshold) {
+ _minimize_count += 1;
+ g_settings_set_int(_settings, "minimize-count", _minimize_count);
+ }
+}
+
+int WindowMinimizeSpeedController::getDuration()
+{
+ return mDuration;
+}
+
+void WindowMinimizeSpeedController::SetDuration()
+{
+ /* Perform some sanity checks on the configuration values */
+ if (_minimize_fast_duration > _minimize_slow_duration)
+ {
+ LOG_WARN(logger) << "Configuration mismatch: minimize-fast-duration ("
+ << _minimize_fast_duration
+ << ") is longer than minimize-slow-duration ("
+ << _minimize_slow_duration << "). Not changing speed.";
+ return;
+ }
+
+ if (_minimize_count < 0)
+ _minimize_count = 0;
+ if (_minimize_count > _minimize_speed_threshold)
+ _minimize_count = _minimize_speed_threshold;
+
+ /* Adjust the speed so that it gets linearly closer to maximum speed as we
+ approach the threshold */
+ int speed_range = _minimize_slow_duration - _minimize_fast_duration;
+ float position = (_minimize_speed_threshold <= 0) ? 1.0 :
+ static_cast<float>(_minimize_count) / _minimize_speed_threshold;
+ int duration = _minimize_slow_duration - std::ceil(position * speed_range);
+
+ if (duration != mDuration) {
+ mDuration = duration;
+ DurationChanged.emit();
+ }
+}
diff --git a/plugins/unityshell/src/WindowMinimizeSpeedController.h b/plugins/unityshell/src/WindowMinimizeSpeedController.h
new file mode 100644
index 000000000..49bcbad14
--- /dev/null
+++ b/plugins/unityshell/src/WindowMinimizeSpeedController.h
@@ -0,0 +1,57 @@
+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
+/* Compiz unity plugin
+ * unity.h
+ *
+ * Copyright (c) 2010-11 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Your own copyright notice would go above. You are free to choose whatever
+ * licence you want, just take note that some compiz code is GPL and you will
+ * not be able to re-use it if you want to use a different licence.
+ */
+
+#ifndef WINDOWMINIMIZESPEEDCONTROLLER_H
+#define WINDOWMINIMIZESPEEDCONTROLLER_H
+
+#include <core/core.h>
+#include <UnityCore/GLibWrapper.h>
+#include <UnityCore/GLibSignal.h>
+#include <sigc++/sigc++.h>
+
+typedef struct _GSettings GSettings;
+
+using namespace unity;
+
+class WindowMinimizeSpeedController
+{
+public:
+ WindowMinimizeSpeedController();
+ void UpdateCount();
+ int getDuration();
+ sigc::signal<void> DurationChanged;
+
+private:
+ void SetDuration();
+
+ glib::Object<GSettings> _settings;
+ int _minimize_count;
+ int _minimize_speed_threshold;
+ int _minimize_slow_duration;
+ int _minimize_fast_duration;
+ glib::Signal<void, GSettings*, gchar* > _minimize_count_changed;
+ glib::Signal<void, GSettings*, gchar* > _minimize_speed_threshold_changed;
+ glib::Signal<void, GSettings*, gchar* > _minimize_slow_duration_changed;
+ glib::Signal<void, GSettings*, gchar* > _minimize_fast_duration_changed;
+ int mDuration;
+};
+
+#endif // WINDOWMINIMIZESPEEDCONTROLLER_H
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index f2a78e217..640fd3654 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -29,7 +29,6 @@
#include "Launcher.h"
#include "LauncherIcon.h"
#include "LauncherController.h"
-#include "DevicesSettings.h"
#include "PluginAdapter.h"
#include "QuicklistManager.h"
#include "StartupNotifyService.h"
@@ -165,6 +164,7 @@ UnityScreen::UnityScreen(CompScreen* screen)
, paint_panel_(false)
, scale_just_activated_(false)
, highlighted_window_(0)
+ , minimize_speed_controller(new WindowMinimizeSpeedController())
{
Timer timer;
#ifndef USE_GLES
@@ -317,7 +317,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
optionSetIconSizeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetAutohideAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetDashBlurExperimentalNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
- optionSetDevicesOptionNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetShortcutOverlayNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetShowDesktopIconNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetShowLauncherInitiate(boost::bind(&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
@@ -422,6 +421,10 @@ UnityScreen::UnityScreen(CompScreen* screen)
}
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged));
+
+ minimize_speed_controller->DurationChanged.connect(
+ sigc::mem_fun(this, &UnityScreen::OnMinimizeDurationChanged)
+ );
}
UnityScreen::~UnityScreen()
@@ -2601,6 +2604,40 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
}
void
+UnityScreen::OnMinimizeDurationChanged ()
+{
+ /* Update the compiz plugin setting with the new computed speed so that it
+ * will be used in the following minimizations */
+ CompPlugin *p = CompPlugin::find("animation");
+ if (p)
+ {
+ CompOption::Vector &opts = p->vTable->getOptions();
+
+ for (CompOption &o : opts)
+ {
+ if (o.name () == std::string ("minimize_durations"))
+ {
+ /* minimize_durations is a list value, but minimize applies only to
+ * normal windows, so there's always one value */
+ CompOption::Value& value = o.value();
+ CompOption::Value::Vector& list = value.list();
+ CompOption::Value::Vector::iterator i = list.begin();
+ if (i != list.end()) {
+ i->set(minimize_speed_controller->getDuration());
+ }
+ value.set(list);
+ screen->setOptionForPlugin(p->vTable->name().c_str(),
+ o.name().c_str(), value);
+ break;
+ }
+ }
+ }
+ else {
+ LOG_WARN(logger) << "Animation plugin not found. Can't set minimize speed.";
+ }
+}
+
+void
UnityWindow::minimize ()
{
if (!window->managed ())
@@ -2716,6 +2753,11 @@ void UnityWindow::windowNotify(CompWindowNotify n)
case CompWindowNotifyBeforeDestroy:
being_destroyed.emit();
break;
+ case CompWindowNotifyMinimize:
+ /* Updating the count in dconf will trigger a "changed" signal to which
+ * the method setting the new animation speed is attached */
+ UnityScreen::get(screen)->minimize_speed_controller->UpdateCount();
+ break;
default:
break;
}
@@ -2984,9 +3026,6 @@ void UnityScreen::optionChanged(CompOption* opt, UnityshellOptions::Options num)
case UnityshellOptions::AutomaximizeValue:
PluginAdapter::Default()->SetCoverageAreaBeforeAutomaximize(optionGetAutomaximizeValue() / 100.0f);
break;
- case UnityshellOptions::DevicesOption:
- unity::DevicesSettings::GetDefault().SetDevicesOption((unity::DevicesSettings::DevicesOption) optionGetDevicesOption());
- break;
case UnityshellOptions::AltTabTimeout:
switcher_controller_->detail_on_timeout = optionGetAltTabTimeout();
case UnityshellOptions::AltTabBiasViewport:
@@ -3182,59 +3221,217 @@ void UnityScreen::InitHints()
// Launcher...
std::string const launcher(_("Launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" (Press)"), _("Open Launcher, displays shortcuts."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher" ));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", "", _("Open Launcher keyboard navigation mode."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "keyboard_focus"));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", "", _("Switch applications via Launcher."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "launcher_switcher_forward"));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" + 1 to 9"), _("Same as clicking on a Launcher icon."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" + Shift + 1 to 9"), _("Open new window of the app."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", " + T", _("Open the Trash."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" (Hold)"),
+ _("Opens the Launcher, displays shortcuts."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher" ));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", "",
+ _("Opens Launcher keyboard navigation mode."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "keyboard_focus"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", "",
+ _("Switches applications via the Launcher."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "launcher_switcher_forward"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" + 1 to 9"),
+ _("Same as clicking on a Launcher icon."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", _(" + Shift + 1 to 9"),
+ _("Opens a new window in the app."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(launcher, "", " + T",
+ _("Opens the Trash."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
// Dash...
std::string const dash( _("Dash"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", _(" (Tap)"), _("Open the Dash Home."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + A", _("Open the Dash App Lens."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + F", _("Open the Dash Files Lens."), shortcut::COMPIZ_KEY_OPTION,"unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + M", _("Open the Dash Music Lens."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + V", _("Open the Dash Video Lens."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_launcher"));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "", _("Switches between Lenses."), shortcut::HARDCODED_OPTION, _("Ctrl + Tab")));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "", _("Moves the focus."), shortcut::HARDCODED_OPTION, _("Cursor Keys")));
- hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "", _("Open currently focused item."), shortcut::HARDCODED_OPTION, _("Enter & Return")));
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", _(" (Tap)"),
+ _("Opens the Dash Home."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + A",
+ _("Opens the Dash App Lens."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + F",
+ _("Opens the Dash Files Lens."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + M",
+ _("Opens the Dash Music Lens."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", " + V",
+ _("Opens the Dash Video Lens."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_launcher"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "",
+ _("Switches between Lenses."),
+ shortcut::HARDCODED_OPTION,
+ _("Ctrl + Tab")));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "",
+ _("Moves the focus."),
+ shortcut::HARDCODED_OPTION,
+ _("Arrow Keys")));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(dash, "", "",
+ _("Opens the currently focused item."),
+ shortcut::HARDCODED_OPTION,
+ _("Enter")));
// Menu Bar
std::string const menubar(_("HUD & Menu Bar"));
- hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", _(" (Tap)"), _("Open the HUD."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "show_hud"));
- hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", _(" (Press)"), _("Reveals application menu."), shortcut::HARDCODED_OPTION, "Alt"));
- hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", "", _("Opens the indicator menu."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "panel_first_menu"));
- hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", "", _("Moves focus between indicators."), shortcut::HARDCODED_OPTION, _("Cursor Left or Right")));
+ hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", _(" (Tap)"),
+ _("Opens the HUD."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "show_hud"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", " (Hold)",
+ _("Reveals the application menu."),
+ shortcut::HARDCODED_OPTION,
+ "Alt"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", "",
+ _("Opens the indicator menu."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "panel_first_menu"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(menubar, "", "",
+ _("Moves focus between indicators."),
+ shortcut::HARDCODED_OPTION,
+ _("Cursor Left or Right")));
// Switching
std::string const switching(_("Switching"));
- hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "", _("Switch between applications."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "alt_tab_forward"));
- hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "", _("Switch windows of current application."), shortcut::COMPIZ_KEY_OPTION, "unityshell", "alt_tab_next_window"));
- hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "", _("Moves the focus."), shortcut::HARDCODED_OPTION, _("Cursor Left or Right")));
+ hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Switches between applications."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "alt_tab_forward"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Switches windows of current applications."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "unityshell",
+ "alt_tab_next_window"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Moves the focus."),
+ shortcut::HARDCODED_OPTION,
+ _("Cursor Left or Right")));
// Workspaces
std::string const workspaces(_("Workspaces"));
- hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", "", _("Spread workspaces."), shortcut::COMPIZ_KEY_OPTION, "expo", "expo_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", _(" + Cursor Keys"), _("Switch workspaces."), shortcut::COMPIZ_METAKEY_OPTION, "wall", "left_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", _(" + Cursor Keys"), _("Move focused window to different workspace."), shortcut::COMPIZ_METAKEY_OPTION, "wall", "left_window_key"));
+ hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", "",
+ _("Switches between workspaces."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "expo",
+ "expo_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", _(" + Arrow Keys"),
+ _("Switches workspaces."),
+ shortcut::COMPIZ_METAKEY_OPTION,
+ "wall",
+ "left_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(workspaces, "", _(" + Arrow Keys"),
+ _("Moves focused window to another workspace."),
+ shortcut::COMPIZ_METAKEY_OPTION,
+ "wall",
+ "left_window_key"));
+
// Windows
std::string const windows(_("Windows"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Spreads all windows in the current workspace."), shortcut::COMPIZ_KEY_OPTION, "scale", "initiate_all_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Minimises all windows."), shortcut::COMPIZ_KEY_OPTION, "core", "show_desktop_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Maximises the current window."), shortcut::COMPIZ_KEY_OPTION, "core", "maximize_window_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Restores or minimises current window."), shortcut::COMPIZ_KEY_OPTION, "core", "unmaximize_window_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" or Right"), _("Semi-maximises current window."), shortcut::COMPIZ_KEY_OPTION, "grid", "put_left_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Closes current window."), shortcut::COMPIZ_KEY_OPTION, "core", "close_window_key"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Opens window accessibility menu."), shortcut::HARDCODED_OPTION, _("Alt + Space")));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "", _("Places window in corresponding positions."), shortcut::HARDCODED_OPTION, _("Ctrl + Alt + Num")));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" Drag"), _("Move window."), shortcut::COMPIZ_MOUSE_OPTION, "move", "initiate_button"));
- hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" Drag"), _("Resize window."), shortcut::COMPIZ_MOUSE_OPTION, "resize", "initiate_button"));
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Spreads all windows in the current workspace."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "scale",
+ "initiate_all_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Minimises all windows."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "core",
+ "show_desktop_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Maximises the current window."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "core",
+ "maximize_window_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Restores or minimises the current window."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "core",
+ "unmaximize_window_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" or Right"),
+ _("Semi-maximise the current window."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "grid",
+ "put_left_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Closes the current window."),
+ shortcut::COMPIZ_KEY_OPTION,
+ "core",
+ "close_window_key"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Opens the window accessibility menu."),
+ shortcut::HARDCODED_OPTION,
+ _("Alt + Space")));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", "",
+ _("Places the window in corresponding position."),
+ shortcut::HARDCODED_OPTION,
+ _("Ctrl + Alt + Num")));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" Drag"),
+ _("Moves the window."),
+ shortcut::COMPIZ_MOUSE_OPTION,
+ "move",
+ "initiate_button"));
+
+ hints_.push_back(std::make_shared<shortcut::Hint>(windows, "", _(" Drag"),
+ _("Resizes the window."),
+ shortcut::COMPIZ_MOUSE_OPTION,
+ "resize",
+ "initiate_button"));
}
void UnityScreen::InitGesturesSupport()
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 99374258c..b9bea314a 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -66,6 +66,8 @@
#include "HudController.h"
#include "ThumbnailGenerator.h"
+#include "WindowMinimizeSpeedController.h"
+
namespace unity
{
@@ -192,6 +194,8 @@ public:
void SetUpAndShowSwitcher(switcher::ShowMode show_mode = switcher::ShowMode::CURRENT_VIEWPORT);
+ void OnMinimizeDurationChanged();
+
switcher::Controller::Ptr switcher_controller();
launcher::Controller::Ptr launcher_controller();
@@ -245,7 +249,7 @@ private:
void OnPanelStyleChanged();
void InitGesturesSupport();
-
+
nux::animation::TickSource tick_source_;
nux::animation::AnimationController animation_controller_;
@@ -345,6 +349,7 @@ private:
Window highlighted_window_;
+ WindowMinimizeSpeedController* minimize_speed_controller;
friend class UnityWindow;
};
diff --git a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in
index 1f0dab978..98571394a 100644
--- a/plugins/unityshell/unityshell.xml.in
+++ b/plugins/unityshell/unityshell.xml.in
@@ -394,26 +394,6 @@
<default>75</default>
</option>
- <option name="devices_option" type="int">
- <_short>Show Devices</_short>
- <_long>Show devices in the launcher</_long>
- <min>0</min>
- <max>2</max>
- <default>1</default>
- <desc>
- <value>0</value>
- <_name>Never</_name>
- </desc>
- <desc>
- <value>1</value>
- <_name>Only Mounted</_name>
- </desc>
- <desc>
- <value>2</value>
- <_name>Always</_name>
- </desc>
- </option>
-
<option name="shortcut_overlay" type="bool">
<_short>Enable Shortcut Hints Overlay</_short>
<_long>Enable Shortcut Hints Overlay</_long>