Merge lp:~ojno/unity/minimize-on-click into lp:unity

Proposed by Jonathan French
Status: Rejected
Rejected by: Marco Trevisan (Treviño)
Proposed branch: lp:~ojno/unity/minimize-on-click
Merge into: lp:unity
Diff against target: 125 lines (+22/-29)
2 files modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+19/-27)
plugins/unityshell/src/BamfLauncherIcon.h (+3/-2)
To merge this branch: bzr merge lp:~ojno/unity/minimize-on-click
Reviewer Review Type Date Requested Status
GonzO (community) Needs Resubmitting
Marco Trevisan (Treviño) Disapprove
Review via email: mp+98303@code.launchpad.net

Description of the change

Implements #733349, specifically comment 58's spec - minimize windows as part of the launcher icon click cycle.

I know that bug was marked wontfix, but this *vastly* improves the everyday usability of Unity, and the change is only a few lines. Please reconsider this.

I realise at this point it won't make it into Precise, but please at least un-wontfix the bug. Open source projects should listen to their users, especially when they aren't just blueskying but actually contribute code! ;)

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Sorry, but I must to reject this MP, since this is an unwanted behavior according to design.

review: Disapprove
Revision history for this message
GonzO (gonzo) wrote :

The feature shouldn't be rejected - the design should be reconsidered.

review: Needs Resubmitting
Revision history for this message
Jonathan French (ojno) wrote :

I've created a PPA of this: https://launchpad.net/~ojno/+archive/unity-minimize-on-click

This has been covered here: http://www.webupd8.org/2012/03/unity-with-minimize-on-click-patch.html

Please think about this. If you look at the linked bug, you can see people discover it every few days (for nearly a year now!) and express their incredulity that this basic behaviour is missing from Unity.

Revision history for this message
Vishnu Rao (vishnumrao) wrote :

This is a much needed design change. I vote this up! Minimize on click is intuitive. It maybe a mimicking Windows, but its useful.

Lets try to make Ubuntu different, but lets pick up useful features from other OSes.

Revision history for this message
Aleve Sicofante (sicofante) wrote :

It's also available on OS X as a dock preference (not the default though).

A big THANK YOU to Jonathan and a big boo to the design team, for not listening and not reasoning.

Revision history for this message
zwigno (zwigno) wrote :

Seems like they're just being strict about sticking to the design spec. Let's lobby for a design spec change instead. Anybody know how to do that?

Revision history for this message
dstaubsauger (dickerstaubsauger) wrote :

Meeeh, why can't you add the feature optionally, meaning users would have to turn it on in the settings dialogue? That way everybody will be happy and in the meantime you can ask your design team why they didn't want it.

Revision history for this message
Jonathan French (ojno) wrote :

New version of the PPA released: Restores the previous behaviour when the launcher icon is clicked with the Spread open, and adds a "Minimize" item to the quicklist.

Hopefully this is more likely to be merged, since it now doesn't touch the Spread behaviour at all.

I'm trying to merge this change into this branch, but I'm having trouble, being new to bzr. I'll figure it out soon.

Revision history for this message
Dvanzo (danielvanzo) wrote :

HI!,
I was using this patch without problems, but today unity was updated and can't use it anymore... Any plans to apply this patch to the new unity version??? Unity is almost useless without it for me!!!

Regards,

Daniel

Unmerged revisions

2131. By Jonathan French

Restore the previous behaviour when the launcher icon is clicked with the Spread open; add a Minimize item to the quicklist

2130. By Jonathan French

merge from upstream

2129. By Jonathan French

Add window minimize to launcher icon click actions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
--- plugins/unityshell/src/BamfLauncherIcon.cpp 2012-03-16 01:48:22 +0000
+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2012-03-19 23:17:20 +0000
@@ -231,10 +231,11 @@
231231
232 /* Behaviour:232 /* Behaviour:
233 * 1) Nothing running, or nothing visible -> launch application233 * 1) Nothing running, or nothing visible -> launch application
234 * 2) Running and active -> spread application234 * 2a) Running and active with more than one window -> spread application
235 * 2b) Running and active with only one window -> minimize application
235 * 3) Running and not active -> focus application236 * 3) Running and not active -> focus application
236 * 4) Spread is active and different icon pressed -> change spread237 * 4) Spread is active and different icon pressed -> change spread
237 * 5) Spread is active -> Spread de-activated, and fall through238 * 5) Spread is active -> minimize application
238 */239 */
239240
240 if (!IsRunning() || (IsRunning() && !user_visible)) // #1 above241 if (!IsRunning() || (IsRunning() && !user_visible)) // #1 above
@@ -257,13 +258,17 @@
257 if (scaleWasActive) // #5 above258 if (scaleWasActive) // #5 above
258 {259 {
259 WindowManager::Default()->TerminateScale();260 WindowManager::Default()->TerminateScale();
260 Focus(arg);261 Minimize(Windows(true));
261 }262 }
262 else // #2 above263 else // #2 above
263 {264 {
264 if (arg.source != ActionArg::SWITCHER)265 if (arg.source != ActionArg::SWITCHER)
265 {266 {
266 Spread(true, 0, false);267 std::vector<Window> windowList = Windows(true);
268 if (windowList.size() == 1) // #2b above
269 Minimize(windowList);
270 else // #2a above
271 Spread(windowList, 0, false);
267 }272 }
268 }273 }
269 }274 }
@@ -274,7 +279,7 @@
274 WindowManager::Default()->TerminateScale();279 WindowManager::Default()->TerminateScale();
275 Focus(arg);280 Focus(arg);
276 if (arg.source != ActionArg::SWITCHER)281 if (arg.source != ActionArg::SWITCHER)
277 Spread(true, 0, false);282 Spread(Windows(true), 0, false);
278 }283 }
279 else // #3 above284 else // #3 above
280 {285 {
@@ -287,7 +292,7 @@
287 ubus_server_send_message(ubus_server_get_default(), UBUS_LAUNCHER_ACTION_DONE, nullptr);292 ubus_server_send_message(ubus_server_get_default(), UBUS_LAUNCHER_ACTION_DONE, nullptr);
288}293}
289294
290std::vector<Window> BamfLauncherIcon::Windows()295std::vector<Window> BamfLauncherIcon::Windows(bool current_desktop)
291{296{
292 std::vector<Window> results;297 std::vector<Window> results;
293 GList* children, *l;298 GList* children, *l;
@@ -301,7 +306,7 @@
301306
302 Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));307 Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
303308
304 if (wm->IsWindowMapped(xid))309 if (wm->IsWindowMapped(xid) && (!current_desktop || wm->IsWindowOnCurrentDesktop(xid)))
305 {310 {
306 results.push_back(xid);311 results.push_back(xid);
307 }312 }
@@ -609,30 +614,17 @@
609 }614 }
610}615}
611616
612bool BamfLauncherIcon::Spread(bool current_desktop, int state, bool force)617bool BamfLauncherIcon::Spread(std::vector<Window> windowList, int state, bool force)
613{618{
614 GList* children, *l;
615 children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));
616 WindowManager* wm = WindowManager::Default();
617
618 std::vector<Window> windowList;
619 for (l = children; l; l = l->next)
620 {
621 if (!BAMF_IS_WINDOW(l->data))
622 continue;
623
624 Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
625
626 if (!current_desktop || (current_desktop && wm->IsWindowOnCurrentDesktop(xid)))
627 {
628 windowList.push_back(xid);
629 }
630 }
631
632 g_list_free(children);
633 return WindowManager::Default()->ScaleWindowGroup(windowList, state, force);619 return WindowManager::Default()->ScaleWindowGroup(windowList, state, force);
634}620}
635621
622void BamfLauncherIcon::Minimize(std::vector<Window> windowList)
623{
624 for (unsigned int i = 0; i < windowList.size(); i++)
625 WindowManager::Default()->Minimize(windowList[i]);
626}
627
636void BamfLauncherIcon::EnsureWindowState()628void BamfLauncherIcon::EnsureWindowState()
637{629{
638 GList* children, *l;630 GList* children, *l;
639631
=== modified file 'plugins/unityshell/src/BamfLauncherIcon.h'
--- plugins/unityshell/src/BamfLauncherIcon.h 2012-02-12 10:43:11 +0000
+++ plugins/unityshell/src/BamfLauncherIcon.h 2012-03-19 23:17:20 +0000
@@ -60,7 +60,7 @@
60 virtual bool ShowInSwitcher(bool current);60 virtual bool ShowInSwitcher(bool current);
61 virtual unsigned long long SwitcherPriority();61 virtual unsigned long long SwitcherPriority();
6262
63 std::vector<Window> Windows();63 std::vector<Window> Windows(bool current_desktop = false);
64 std::vector<Window> WindowsForMonitor(int monitor);64 std::vector<Window> WindowsForMonitor(int monitor);
65 std::string NameForWindow(Window window);65 std::string NameForWindow(Window window);
6666
@@ -96,7 +96,8 @@
9696
97 void OpenInstanceWithUris(std::set<std::string> uris);97 void OpenInstanceWithUris(std::set<std::string> uris);
98 void Focus(ActionArg arg);98 void Focus(ActionArg arg);
99 bool Spread(bool current_desktop, int state, bool force);99 bool Spread(std::vector<Window>, int state, bool force);
100 void Minimize(std::vector<Window> current_desktop);
100101
101 void OnWindowMinimized(guint32 xid);102 void OnWindowMinimized(guint32 xid);
102 void OnWindowMoved(guint32 xid);103 void OnWindowMoved(guint32 xid);