Merge lp:~marcobiscaro2112/unity/fixes-733349 into lp:unity

Proposed by Marco Biscaro
Status: Superseded
Proposed branch: lp:~marcobiscaro2112/unity/fixes-733349
Merge into: lp:unity
Diff against target: 228 lines (+89/-11)
7 files modified
src/BamfLauncherIcon.cpp (+49/-5)
src/BamfLauncherIcon.h (+2/-0)
src/Launcher.cpp (+14/-0)
src/Launcher.h (+5/-0)
src/LauncherIcon.cpp (+0/-3)
src/unityshell.cpp (+4/-2)
unityshell.xml.in (+15/-1)
To merge this branch: bzr merge lp:~marcobiscaro2112/unity/fixes-733349
Reviewer Review Type Date Requested Status
Mirco Müller (community) Disapprove
Review via email: mp+61473@code.launchpad.net

Description of the change

Implementation of what was discussed here: https://bugs.launchpad.net/ayatana-design/+bug/733349/comments/58

This option is disabled by default, and can be enabled through ccsm.

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

While the code looks ok, compiles and works as advertised, it will not be approved - thus merged into trunk - as long as the design and user-interaction discussion does not agree with this. At least this is something that can be considered to be part of a future user-testing session and see how this behaviour is received compared to the current one.

On a general note... adding numerous options, which divert from the default, causes the introduction of code-paths note exercised as much as others (default) ones. Thus code-rot is a potential danger here... where options could cause unknown/undiscovered side-effects, because they just have not been tested as much.

Revision history for this message
Mirco Müller (macslow) :
review: Disapprove
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

I understand this point of view, but disagree in this case.

At moment, there are 78 people which manifested as affected by this bug. And I'm sure that are many more. If we add this functionality now, there is a lot of time to people test it before oneiric (and even more time before the next LTS).

Otherwise, if we keep this thought in mind, unity will not evolve: it will not turn better, it will not turn more customizable, it will not turn more familiar. And it's this that users expect. :)

Please, consider this.

Revision history for this message
Magnes (magnesus2) wrote :

Where is the "the design and user-interaction discussion" and how can we participate? Why people that are affected by this bug are not part of it? Why are you trowing out ready solution that doesn't break anything and is turned off by default?

1189. By Marco Biscaro

Reverted changes

1190. By Marco Biscaro

Merge with trunk

1191. By Marco Biscaro

Implementing minimization when launcher icon is clicked (LP: #733349).

Reference: https://bugs.launchpad.net/ayatana-design/+bug/733349/comments/58

Unmerged revisions

1191. By Marco Biscaro

Implementing minimization when launcher icon is clicked (LP: #733349).

Reference: https://bugs.launchpad.net/ayatana-design/+bug/733349/comments/58

1190. By Marco Biscaro

Merge with trunk

1189. By Marco Biscaro

Reverted changes

1188. By Marco Biscaro

Implementing minimization when launcher icon is clicked (LP: #733349).

Reference: https://bugs.launchpad.net/ayatana-design/+bug/733349/comments/58

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/BamfLauncherIcon.cpp'
--- src/BamfLauncherIcon.cpp 2011-04-18 17:56:31 +0000
+++ src/BamfLauncherIcon.cpp 2011-05-18 20:41:09 +0000
@@ -65,10 +65,10 @@
6565
66 /* Behaviour:66 /* Behaviour:
67 * 1) Nothing running -> launch application67 * 1) Nothing running -> launch application
68 * 2) Running and active -> spread application68 * 2) Running and active -> spread application or minimize if enabled and there is only one window
69 * 3) Running and not active -> focus application69 * 3) Running and not active -> focus application
70 * 4) Spread is active and different icon pressed -> change spread70 * 4) Spread is active and different icon pressed -> change spread
71 * 5) Spread is active -> Spread de-activated, and fall through71 * 5) Spread is active -> Spread de-activated, and minimize all windows, if enabled
72 */72 */
7373
74 if (!running) // #1 above74 if (!running) // #1 above
@@ -81,8 +81,17 @@
81 }81 }
82 else if (scaleWasActive)82 else if (scaleWasActive)
83 {83 {
84 if (active || // #5 above84 if (active) // #5 above
85 !Spread (0, false)) // #4 above85 {
86 PluginAdapter::Default ()->TerminateScale ();
87 _launcher->SetLastSpreadIcon (NULL);
88
89 if (_launcher->GetMinimizeAll ()) // minimize all, if it is active
90 {
91 MinimizeAllWindows ();
92 }
93 }
94 else if (!Spread (0, false)) // #4 above
86 {95 {
87 PluginAdapter::Default ()->TerminateScale ();96 PluginAdapter::Default ()->TerminateScale ();
88 Focus ();97 Focus ();
@@ -95,7 +104,19 @@
95 }104 }
96 else if (active && !scaleWasActive) // #2 above105 else if (active && !scaleWasActive) // #2 above
97 {106 {
98 Spread (0, false);107 GList *children;
108
109 children = bamf_view_get_children (BAMF_VIEW (m_App));
110 if (g_list_length (children) > 1) // if there is more than 1 window, open spread view
111 {
112 Spread (0, false);
113 }
114 else if (_launcher->GetMinimizeAll ()) // minimize the only window, if it is active
115 {
116 MinimizeAllWindows ();
117 }
118
119 g_list_free (children);
99 }120 }
100121
101 ubus_server_send_message (ubus_server_get_default (), UBUS_LAUNCHER_ACTION_DONE, NULL);122 ubus_server_send_message (ubus_server_get_default (), UBUS_LAUNCHER_ACTION_DONE, NULL);
@@ -1102,3 +1123,26 @@
1102 break;1123 break;
1103 }1124 }
1104}1125}
1126
1127void
1128BamfLauncherIcon::MinimizeAllWindows ()
1129{
1130 GList *children, *l;
1131 BamfView *view;
1132
1133 children = bamf_view_get_children (BAMF_VIEW (m_App));
1134
1135 for (l = children; l; l = l->next)
1136 {
1137 view = (BamfView *) l->data;
1138
1139 if (BAMF_IS_WINDOW (view))
1140 {
1141 guint32 xid = bamf_window_get_xid (BAMF_WINDOW (view));
1142
1143 WindowManager::Default ()->Minimize (xid);
1144 }
1145 }
1146
1147 g_list_free (children);
1148}
11051149
=== modified file 'src/BamfLauncherIcon.h'
--- src/BamfLauncherIcon.h 2011-04-07 21:46:48 +0000
+++ src/BamfLauncherIcon.h 2011-05-18 20:41:09 +0000
@@ -121,6 +121,8 @@
121 gpointer data);121 gpointer data);
122122
123 static gboolean OnDndHoveredTimeout (gpointer data);123 static gboolean OnDndHoveredTimeout (gpointer data);
124
125 void MinimizeAllWindows ();
124};126};
125127
126#endif // BAMFLAUNCHERICON_H128#endif // BAMFLAUNCHERICON_H
127129
=== modified file 'src/Launcher.cpp'
--- src/Launcher.cpp 2011-05-17 04:06:05 +0000
+++ src/Launcher.cpp 2011-05-18 20:41:09 +0000
@@ -471,6 +471,8 @@
471 SettingsChanged (_settings, (gchar *)"shows-on-edge", this);471 SettingsChanged (_settings, (gchar *)"shows-on-edge", this);
472472
473 SetDndEnabled (false, true);473 SetDndEnabled (false, true);
474
475 _minimize_all = false;
474}476}
475477
476Launcher::~Launcher()478Launcher::~Launcher()
@@ -4248,3 +4250,15 @@
4248{4250{
4249 g_debug ("Lost the name %s on the session bus\n", name);4251 g_debug ("Lost the name %s on the session bus\n", name);
4250}4252}
4253
4254bool
4255Launcher::GetMinimizeAll ()
4256{
4257 return _minimize_all;
4258}
4259
4260void
4261Launcher::SetMinimizeAll (bool minimize_all)
4262{
4263 _minimize_all = minimize_all;
4264}
42514265
=== modified file 'src/Launcher.h'
--- src/Launcher.h 2011-04-20 03:59:36 +0000
+++ src/Launcher.h 2011-05-18 20:41:09 +0000
@@ -175,6 +175,9 @@
175 sigc::signal<void, LauncherIcon *> launcher_removerequest;175 sigc::signal<void, LauncherIcon *> launcher_removerequest;
176 sigc::signal<void> selection_change;176 sigc::signal<void> selection_change;
177 sigc::signal<void> hidden_changed;177 sigc::signal<void> hidden_changed;
178
179 bool GetMinimizeAll ();
180 void SetMinimizeAll (bool minimizeAll);
178protected:181protected:
179 // Introspectable methods182 // Introspectable methods
180 const gchar* GetName ();183 const gchar* GetName ();
@@ -560,6 +563,8 @@
560 guint32 _settings_changed_id;563 guint32 _settings_changed_id;
561564
562 guint _ubus_handles[5];565 guint _ubus_handles[5];
566
567 bool _minimize_all;
563};568};
564569
565#endif // LAUNCHER_H570#endif // LAUNCHER_H
566571
=== modified file 'src/LauncherIcon.cpp'
--- src/LauncherIcon.cpp 2011-05-13 03:33:19 +0000
+++ src/LauncherIcon.cpp 2011-05-18 20:41:09 +0000
@@ -189,9 +189,6 @@
189void189void
190LauncherIcon::Activate ()190LauncherIcon::Activate ()
191{191{
192 if (PluginAdapter::Default ()->IsScaleActive())
193 PluginAdapter::Default ()->TerminateScale ();
194
195 ActivateLauncherIcon ();192 ActivateLauncherIcon ();
196}193}
197194
198195
=== modified file 'src/unityshell.cpp'
--- src/unityshell.cpp 2011-05-04 13:18:37 +0000
+++ src/unityshell.cpp 2011-05-18 20:41:09 +0000
@@ -754,15 +754,16 @@
754 panelController->SetBFBSize (optionGetIconSize()+18);754 panelController->SetBFBSize (optionGetIconSize()+18);
755 launcher->SetIconSize (optionGetIconSize()+6, optionGetIconSize());755 launcher->SetIconSize (optionGetIconSize()+6, optionGetIconSize());
756 PlacesController::SetLauncherSize (optionGetIconSize()+18);756 PlacesController::SetLauncherSize (optionGetIconSize()+18);
757
758 break;757 break;
759 case UnityshellOptions::AutohideAnimation:758 case UnityshellOptions::AutohideAnimation:
760 launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ());759 launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ());
761 break;760 break;
762
763 case UnityshellOptions::DashBlurExperimental:761 case UnityshellOptions::DashBlurExperimental:
764 PlacesSettings::GetDefault ()->SetDashBlurType ((PlacesSettings::DashBlurType)optionGetDashBlurExperimental ());762 PlacesSettings::GetDefault ()->SetDashBlurType ((PlacesSettings::DashBlurType)optionGetDashBlurExperimental ());
765 break;763 break;
764 case UnityshellOptions::LauncherMinimizeAll:
765 launcher->SetMinimizeAll (optionGetLauncherMinimizeAll ());
766 break;
766 default:767 default:
767 break;768 break;
768 }769 }
@@ -936,6 +937,7 @@
936 optionSetPanelFirstMenuInitiate (boost::bind (&UnityScreen::showPanelFirstMenuKeyInitiate, this, _1, _2, _3));937 optionSetPanelFirstMenuInitiate (boost::bind (&UnityScreen::showPanelFirstMenuKeyInitiate, this, _1, _2, _3));
937 optionSetPanelFirstMenuTerminate(boost::bind (&UnityScreen::showPanelFirstMenuKeyTerminate, this, _1, _2, _3));938 optionSetPanelFirstMenuTerminate(boost::bind (&UnityScreen::showPanelFirstMenuKeyTerminate, this, _1, _2, _3));
938 optionSetLauncherRevealEdgeInitiate (boost::bind (&UnityScreen::launcherRevealEdgeInitiate, this, _1, _2, _3));939 optionSetLauncherRevealEdgeInitiate (boost::bind (&UnityScreen::launcherRevealEdgeInitiate, this, _1, _2, _3));
940 optionSetLauncherMinimizeAllNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
939941
940 for (unsigned int i = 0; i < G_N_ELEMENTS (_ubus_handles); i++)942 for (unsigned int i = 0; i < G_N_ELEMENTS (_ubus_handles); i++)
941 _ubus_handles[i] = 0;943 _ubus_handles[i] = 0;
942944
=== modified file 'unityshell.xml.in'
--- unityshell.xml.in 2011-04-11 08:01:24 +0000
+++ unityshell.xml.in 2011-05-18 20:41:09 +0000
@@ -187,7 +187,6 @@
187 <_name>Fade and Slide</_name>187 <_name>Fade and Slide</_name>
188 </desc>188 </desc>
189 </option>189 </option>
190
191 <option name="dash_blur_experimental" type="int">190 <option name="dash_blur_experimental" type="int">
192 <_short>Dash Blur</_short>191 <_short>Dash Blur</_short>
193 <_long>Type of blur in the Dash</_long>192 <_long>Type of blur in the Dash</_long>
@@ -203,6 +202,21 @@
203 <_name>Static Blur</_name>202 <_name>Static Blur</_name>
204 </desc>203 </desc>
205 </option>204 </option>
205 <option name="launcher_minimize_all" type="int">
206 <_short>Minimize all</_short>
207 <_long>Minimize all windows of the application when the launcher icon is clicked.</_long>
208 <min>0</min>
209 <max>1</max>
210 <default>0</default>
211 <desc>
212 <value>0</value>
213 <_name>Do not minimize</_name>
214 </desc>
215 <desc>
216 <value>1</value>
217 <_name>Minimize all</_name>
218 </desc>
219 </option>
206 </group>220 </group>
207 </options>221 </options>
208 </plugin>222 </plugin>