diff options
| -rw-r--r-- | dash/DashView.cpp | 2 | ||||
| -rw-r--r-- | debian/changelog | 19 | ||||
| -rw-r--r-- | launcher/AbstractLauncherIcon.cpp | 1 | ||||
| -rw-r--r-- | launcher/AbstractLauncherIcon.h | 1 | ||||
| -rw-r--r-- | launcher/ApplicationLauncherIcon.cpp | 28 | ||||
| -rw-r--r-- | launcher/Launcher.cpp | 6 | ||||
| -rw-r--r-- | launcher/Launcher.h | 1 | ||||
| -rw-r--r-- | launcher/LauncherOptions.cpp | 2 | ||||
| -rw-r--r-- | launcher/LauncherOptions.h | 1 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 45 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 2 | ||||
| -rw-r--r-- | plugins/unityshell/unityshell.xml.in | 6 |
12 files changed, 97 insertions, 17 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp index e8451b77d..a2cc68696 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -571,7 +571,7 @@ void DashView::SetupViews() scope_bar_->scope_activated.connect(sigc::mem_fun(this, &DashView::OnScopeBarActivated)); content_layout_->AddView(scope_bar_, 0, nux::MINOR_POSITION_CENTER); - UpdateDashViewSize(); + OnDPIChanged(); } void DashView::OnDPIChanged() diff --git a/debian/changelog b/debian/changelog index 5649c40cd..e6b849b7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +unity (7.1.2+14.04.20140318-0ubuntu1) trusty; urgency=low + + [ Brandon Schaefer ] + * Update the DPI when we setup the view. (LP: #1292268) + * Do not avoid rendering the lockscreen when we have a fullscreen app. + This also removes the old fullscreen + lockscreen fix where we force + painted our selfs on top. (LP: #1291571) + + [ Chris Townsend ] + * Add ability to minimize a single window application when clicking on + the Launcher icon of the application. (LP: #733349) + + [ Andrea Azzarone ] + * Whitelist "onboard" for rendering during lockscreen. (LP: #1291402) + * Do not consider minimized windows for cross fade effect. (LP: + #1291402) + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 18 Mar 2014 23:53:51 +0000 + unity (7.1.2+14.04.20140313-0ubuntu1) trusty; urgency=low [ Brandon Schaefer ] diff --git a/launcher/AbstractLauncherIcon.cpp b/launcher/AbstractLauncherIcon.cpp index 55c398c18..734ace38f 100644 --- a/launcher/AbstractLauncherIcon.cpp +++ b/launcher/AbstractLauncherIcon.cpp @@ -23,6 +23,7 @@ namespace unity { namespace launcher { nux::Property<unsigned> AbstractLauncherIcon::icon_size(48); nux::Property<bool> AbstractLauncherIcon::scroll_inactive_icons(true); + nux::Property<bool> AbstractLauncherIcon::minimize_window_on_click(false); // needed for ungodly stupid reasons NUX_IMPLEMENT_OBJECT_TYPE(AbstractLauncherIcon); diff --git a/launcher/AbstractLauncherIcon.h b/launcher/AbstractLauncherIcon.h index 6cf92b458..fe2600062 100644 --- a/launcher/AbstractLauncherIcon.h +++ b/launcher/AbstractLauncherIcon.h @@ -135,6 +135,7 @@ public: static nux::Property<unsigned> icon_size; static nux::Property<bool> scroll_inactive_icons; + static nux::Property<bool> minimize_window_on_click; nux::Property<std::string> tooltip_text; nux::Property<bool> tooltip_enabled; nux::Property<Position> position; diff --git a/launcher/ApplicationLauncherIcon.cpp b/launcher/ApplicationLauncherIcon.cpp index be7686e48..c80a64f4e 100644 --- a/launcher/ApplicationLauncherIcon.cpp +++ b/launcher/ApplicationLauncherIcon.cpp @@ -393,13 +393,37 @@ void ApplicationLauncherIcon::ActivateLauncherIcon(ActionArg arg) { if (scaleWasActive) // #5 above { - Focus(arg); + if (minimize_window_on_click()) + { + for (auto const& win : GetWindows(WindowFilter::ON_CURRENT_DESKTOP)) + wm.Minimize(win->window_id()); + } + else + { + Focus(arg); + } } else // #2 above { if (arg.source != ActionArg::Source::SWITCHER) { - Spread(true, 0, false); + bool minimized = false; + + if (minimize_window_on_click) + { + WindowList const& windows = GetWindows(WindowFilter::ON_CURRENT_DESKTOP); + + if (windows.size() == 1) + { + wm.Minimize(windows[0]->window_id()); + minimized = true; + } + } + + if (!minimized) + { + Spread(true, 0, false); + } } } } diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index 4bf6e7ff7..512a48574 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -1217,6 +1217,7 @@ void Launcher::UpdateOptions(Options::Ptr options) SetIconSize(options->tile_size, options->icon_size); SetHideMode(options->hide_mode); SetScrollInactiveIcons(options->scroll_inactive_icons); + SetLauncherMinimizeWindow(options->minimize_window_on_click); if (model_) { @@ -1498,6 +1499,11 @@ void Launcher::SetScrollInactiveIcons(bool scroll) AbstractLauncherIcon::scroll_inactive_icons = scroll; } +void Launcher::SetLauncherMinimizeWindow(bool click_to_minimize) +{ + AbstractLauncherIcon::minimize_window_on_click = click_to_minimize; +} + void Launcher::SetIconSize(int tile_size, int icon_size) { ui::IconRenderer::DestroyShortcutTextures(); diff --git a/launcher/Launcher.h b/launcher/Launcher.h index 4e1a9cb61..33fee1f1c 100644 --- a/launcher/Launcher.h +++ b/launcher/Launcher.h @@ -80,6 +80,7 @@ public: AbstractLauncherIcon::Ptr GetSelectedMenuIcon() const; void SetScrollInactiveIcons(bool scroll); + void SetLauncherMinimizeWindow(bool click_to_minimize); void SetIconSize(int tile_size, int icon_size); int GetIconSize() const; diff --git a/launcher/LauncherOptions.cpp b/launcher/LauncherOptions.cpp index 20ef3b303..6a06cf759 100644 --- a/launcher/LauncherOptions.cpp +++ b/launcher/LauncherOptions.cpp @@ -47,6 +47,7 @@ Options::Options() , edge_resist(true) , show_for_all(false) , scroll_inactive_icons(false) + , minimize_window_on_click(false) { auto changed_lambda = [this] { changed_idle_.reset(new glib::Idle(glib::Source::Priority::HIGH)); @@ -72,6 +73,7 @@ Options::Options() urgent_animation.changed.connect(sigc::hide(changed_lambda)); edge_resist.changed.connect(sigc::hide(changed_lambda)); scroll_inactive_icons.changed.connect(sigc::hide(changed_lambda)); + minimize_window_on_click.changed.connect(sigc::hide(changed_lambda)); } } diff --git a/launcher/LauncherOptions.h b/launcher/LauncherOptions.h index 7339f7188..d95b9d2df 100644 --- a/launcher/LauncherOptions.h +++ b/launcher/LauncherOptions.h @@ -103,6 +103,7 @@ public: nux::Property<bool> edge_resist; nux::Property<bool> show_for_all; nux::Property<bool> scroll_inactive_icons; + nux::Property<bool> minimize_window_on_click; sigc::signal<void> option_changed; diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 7dd6bb267..bcc9b7c06 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -380,6 +380,7 @@ UnityScreen::UnityScreen(CompScreen* screen) optionSetLauncherCaptureMouseNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); optionSetScrollInactiveIconsNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); + optionSetLauncherMinimizeWindowNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_NAV, sigc::mem_fun(this, &UnityScreen::OnLauncherStartKeyNav)); @@ -930,7 +931,6 @@ void UnityScreen::DrawPanelUnderDash() bool UnityScreen::forcePaintOnTop() { return !allowWindowPaint || - lockscreen_controller_->IsLocked() || ((switcher_controller_->Visible() || WindowManager::Default().IsExpoActive()) && !fullscreen_windows_.empty () && (!(screen->grabbed () && !screen->otherGrabExist (NULL)))); @@ -2794,7 +2794,9 @@ bool UnityWindow::glPaint(const GLWindowPaintAttrib& attrib, * fully covers the shell on its output. It does not include regular windows * stacked above the shell like DnD icons or Onboard etc. */ - if (G_UNLIKELY(is_nux_window_)) + if (G_UNLIKELY(is_nux_window_) && + (!uScreen->lockscreen_controller_->IsLocked() || + uScreen->lockscreen_controller_->Opacity() != 1.0f)) { if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK) { @@ -2851,8 +2853,9 @@ bool UnityWindow::glPaint(const GLWindowPaintAttrib& attrib, if (uScreen->lockscreen_controller_->IsLocked()) { - if (window->type() != CompWindowTypePopupMenuMask || - !uScreen->lockscreen_controller_->HasOpenMenu()) + if ((window->type() != CompWindowTypePopupMenuMask || + !uScreen->lockscreen_controller_->HasOpenMenu()) && + !window->minimized() && window->resName() != "onboard") { // For some reasons PAINT_WINDOW_NO_CORE_INSTANCE_MASK doesn't work here // (well, it works too much, as it applies to menus too), so we need @@ -3008,6 +3011,9 @@ bool UnityWindow::glDraw(const GLMatrix& matrix, } } + if (uScreen->lockscreen_controller_->IsLocked()) + draw_panel_shadow = DrawPanelShadow::NO; + if (draw_panel_shadow == DrawPanelShadow::BELOW_WINDOW) uScreen->paintPanelShadow(region); @@ -3401,6 +3407,9 @@ void UnityScreen::optionChanged(CompOption* opt, UnityshellOptions::Options num) case UnityshellOptions::ScrollInactiveIcons: launcher_options->scroll_inactive_icons = optionGetScrollInactiveIcons(); break; + case UnityshellOptions::LauncherMinimizeWindow: + launcher_options->minimize_window_on_click = optionGetLauncherMinimizeWindow(); + break; case UnityshellOptions::BackgroundColor: { auto override_color = NuxColorFromCompizColor(optionGetBackgroundColor()); @@ -3709,16 +3718,7 @@ bool UnityScreen::layoutSlotsAndAssignWindows() void UnityScreen::OnDashRealized() { - /* stack any windows named "onboard" above us */ - for (CompWindow *w : screen->windows ()) - { - if (w->resName() == "onboard") - { - Window xid = dash_controller_->window()->GetInputWindowId(); - XSetTransientForHint (screen->dpy(), w->id(), xid); - w->raise (); - } - } + RaiseOSK(); } void UnityScreen::LockscreenRequested() @@ -3734,6 +3734,22 @@ void UnityScreen::LockscreenRequested() } launcher_controller_->ClearTooltips(); + + RaiseOSK(); +} + +void UnityScreen::RaiseOSK() +{ + /* stack any windows named "onboard" above us */ + for (CompWindow *w : screen->windows ()) + { + if (w->resName() == "onboard") + { + Window xid = dash_controller_->window()->GetInputWindowId(); + XSetTransientForHint (screen->dpy(), w->id(), xid); + w->raise (); + } + } } /* Start up the launcher */ @@ -3827,6 +3843,7 @@ void UnityScreen::initLauncher() }); launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons(); + launcher_controller_->options()->minimize_window_on_click = optionGetLauncherMinimizeWindow(); ScheduleRelayout(0); } diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h index 15833e687..4d1c48a7a 100644 --- a/plugins/unityshell/src/unityshell.h +++ b/plugins/unityshell/src/unityshell.h @@ -278,6 +278,8 @@ private: void OnDashRealized (); + void RaiseOSK(); + void OnLauncherStartKeyNav(GVariant* data); void OnLauncherEndKeyNav(GVariant* data); void OnSwitcherDetailChanged(bool detail); diff --git a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in index 86ab214b5..58b382303 100644 --- a/plugins/unityshell/unityshell.xml.in +++ b/plugins/unityshell/unityshell.xml.in @@ -362,6 +362,12 @@ <default>true</default> </option> + <option name="launcher_minimize_window" type="bool"> + <_short>Minimize Single Window Applications (Unsupported)</_short> + <_long>Allows minimizing a single windowed application by clicking on its Launcher icon.</_long> + <default>false</default> + </option> + <option name="edge_responsiveness" type="float"> <_short>Launcher Reveal Edge Responsiveness</_short> <_long>A conglomerate setting that modifies the overall responsiveness of the Launcher reveal.</_long> |
