Merge lp:~didrocks/unity/fixes-natty-finale into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1150
Proposed branch: lp:~didrocks/unity/fixes-natty-finale
Merge into: lp:unity
Diff against target: 371 lines (+78/-25)
9 files modified
src/BamfLauncherIcon.cpp (+1/-0)
src/Launcher.cpp (+60/-15)
src/Launcher.h (+5/-0)
src/LauncherController.cpp (+1/-0)
src/LauncherIcon.cpp (+2/-5)
src/PlacesSearchBar.cpp (+1/-1)
src/PlacesView.cpp (+4/-4)
src/PluginAdapter.cpp (+3/-0)
src/WindowManager.h (+1/-0)
To merge this branch: bzr merge lp:~didrocks/unity/fixes-natty-finale
Reviewer Review Type Date Requested Status
Gord Allott (community) Approve
Review via email: mp+58171@code.launchpad.net

Description of the change

This branch:
- Fix a wrong state machine with edge reveal
- Remove wrong keynav hilight and quicklist random appearance
- Keep the right icons activated for ws switcher, remove the hack for the trash
- Add an addition g_source_remove crash fix
- Fix another crash on PlacesView::OnResizeFrame
- Fix a wrong state for current focused window when you have few window (or in
  dodge active window)

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/BamfLauncherIcon.cpp'
2--- src/BamfLauncherIcon.cpp 2011-04-15 11:34:42 +0000
3+++ src/BamfLauncherIcon.cpp 2011-04-18 17:43:02 +0000
4@@ -1053,6 +1053,7 @@
5 if (self->_dnd_hovered && bamf_view_is_running (BAMF_VIEW (self->m_App)))
6 self->Spread (CompAction::StateInitEdgeDnd, true);
7
8+ self->_dnd_hover_timer = 0;
9 return false;
10 }
11
12
13=== modified file 'src/Launcher.cpp'
14--- src/Launcher.cpp 2011-04-15 19:15:56 +0000
15+++ src/Launcher.cpp 2011-04-18 17:43:02 +0000
16@@ -282,6 +282,7 @@
17 _on_window_hidden_intellihide_connection = (sigc::connection) PluginAdapter::Default ()->window_hidden.connect (sigc::mem_fun (this, &Launcher::OnWindowMaybeIntellihide));
18 _on_window_resized_intellihide_connection = (sigc::connection) PluginAdapter::Default ()->window_resized.connect (sigc::mem_fun (this, &Launcher::OnWindowMaybeIntellihide));
19 _on_window_moved_intellihide_connection = (sigc::connection) PluginAdapter::Default ()->window_moved.connect (sigc::mem_fun (this, &Launcher::OnWindowMaybeIntellihide));
20+ _on_window_focuschanged_intellihide_connection = (sigc::connection) PluginAdapter::Default ()->window_focus_changed.connect (sigc::mem_fun (this, &Launcher::OnWindowMaybeIntellihideDelayed));
21
22 _on_window_mapped_connection = (sigc::connection) PluginAdapter::Default ()->window_mapped.connect (sigc::mem_fun (this, &Launcher::OnWindowMapped));
23 _on_window_unmapped_connection = (sigc::connection) PluginAdapter::Default ()->window_unmapped.connect (sigc::mem_fun (this, &Launcher::OnWindowUnmapped));
24@@ -296,6 +297,7 @@
25 _on_drag_update_connection = (sigc::connection) adapter->drag_update.connect (sigc::mem_fun (this, &Launcher::OnDragUpdate));
26 _on_drag_finish_connection = (sigc::connection) adapter->drag_finish.connect (sigc::mem_fun (this, &Launcher::OnDragFinish));
27
28+ // FIXME: not used, remove (with Get function) in O
29 m_ActiveTooltipIcon = NULL;
30 m_ActiveMenuIcon = NULL;
31 m_LastSpreadIcon = NULL;
32@@ -391,6 +393,7 @@
33 _hidden = false;
34 _render_drag_window = false;
35 _drag_edge_touching = false;
36+ _keynav_activated = false;
37 _backlight_mode = BACKLIGHT_NORMAL;
38 _last_button_press = 0;
39 _selection_atom = 0;
40@@ -489,8 +492,6 @@
41 g_source_remove (_start_dragicon_handle);
42 if (_ignore_repeat_shortcut_handle)
43 g_source_remove (_ignore_repeat_shortcut_handle);
44- if (_super_show_launcher_handle)
45- g_source_remove (_super_show_launcher_handle);
46 if (_super_hide_launcher_handle)
47 g_source_remove (_super_hide_launcher_handle);
48
49@@ -537,6 +538,9 @@
50
51 if (_on_window_moved_intellihide_connection.connected ())
52 _on_window_moved_intellihide_connection.disconnect ();
53+
54+ if (_on_window_moved_intellihide_connection.connected ())
55+ _on_window_moved_intellihide_connection.disconnect ();
56
57 if (_on_window_mapped_connection.connected ())
58 _on_window_mapped_connection.disconnect ();
59@@ -574,6 +578,8 @@
60 if (_ubus_handles[i] != 0)
61 ubus_server_unregister_interest (ubus, _ubus_handles[i]);
62 }
63+
64+ g_idle_remove_by_data (this);
65
66 delete _hover_machine;
67 delete _hide_machine;
68@@ -701,8 +707,7 @@
69 void
70 Launcher::startKeyNavMode ()
71 {
72- _hide_machine->SetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE, true);
73- _hover_machine->SetQuirk (LauncherHoverMachine::KEY_NAV_ACTIVE, true);
74+ SetStateKeyNav (true);
75 _hide_machine->SetQuirk (LauncherHideMachine::LAST_ACTION_ACTIVATE, false);
76
77 GrabKeyboard ();
78@@ -721,11 +726,12 @@
79 Launcher *self = (Launcher*) data;
80
81 // move focus to key nav mode when activated
82- if (!(self->_hide_machine->GetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE)))
83+ if (!(self->_keynav_activated))
84 return false;
85-
86- if (self->_last_icon_index == -1)
87+
88+ if (self->_last_icon_index == -1) {
89 self->_current_icon_index = 0;
90+ }
91 else
92 self->_current_icon_index = self->_last_icon_index;
93 self->EnsureAnimation ();
94@@ -757,13 +763,12 @@
95 void
96 Launcher::exitKeyNavMode ()
97 {
98- if (!_hide_machine->GetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE))
99+ if (!_keynav_activated)
100 return;
101
102 UnGrabKeyboard ();
103 UnGrabPointer ();
104- _hide_machine->SetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE, false);
105- _hover_machine->SetQuirk (LauncherHoverMachine::KEY_NAV_ACTIVE, false);
106+ SetStateKeyNav (false);
107
108 _current_icon_index = -1;
109 _last_icon_index = _current_icon_index;
110@@ -821,7 +826,7 @@
111 }
112 else
113 {
114- // reset if x=0 and go to the bfb and other corner case
115+ // reset state for some corner case like x=0, show dash (leave event not received)
116 _hide_machine->SetQuirk (LauncherHideMachine::MOUSE_OVER_ACTIVE_EDGE, false);
117 }
118 }
119@@ -830,6 +835,18 @@
120 {
121 _hide_machine->SetQuirk (LauncherHideMachine::MOUSE_OVER_BFB, over_bfb);
122 _hover_machine->SetQuirk (LauncherHoverMachine::MOUSE_OVER_BFB, over_bfb);
123+
124+ // the case where it's x=0 isn't important here as OnBFBUpdate() isn't triggered
125+ if (over_bfb)
126+ _hide_machine->SetQuirk (LauncherHideMachine::MOUSE_OVER_ACTIVE_EDGE, false);
127+}
128+
129+void Launcher::SetStateKeyNav (bool keynav_activated)
130+{
131+ _hide_machine->SetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE, keynav_activated);
132+ _hover_machine->SetQuirk (LauncherHoverMachine::KEY_NAV_ACTIVE, keynav_activated);
133+
134+ _keynav_activated = keynav_activated;
135 }
136
137 bool Launcher::MouseBeyondDragThreshold ()
138@@ -1342,8 +1359,9 @@
139 LauncherModel::iterator it;
140 int i;
141 for (it = _model->begin (), i = 0; it != _model->end (); it++, i++)
142- if (i == _current_icon_index && *it == icon)
143+ if (i == _current_icon_index && *it == icon) {
144 arg.keyboard_nav_hl = true;
145+ }
146 }
147
148 void Launcher::FillRenderArg (LauncherIcon *icon,
149@@ -1644,6 +1662,8 @@
150 g_source_remove (_super_show_launcher_handle);
151 if (_super_show_shortcuts_handle > 0)
152 g_source_remove (_super_show_shortcuts_handle);
153+ _super_show_launcher_handle = 0;
154+ _super_show_shortcuts_handle = 0;
155
156 // it's a tap on super and we didn't use any shortcuts
157 if (TapOnSuper () && !_latest_shortcut)
158@@ -1937,6 +1957,7 @@
159 }
160 }
161
162+// FIXME: remove those 2 for Oneiric
163 void
164 Launcher::OnWindowMaybeIntellihide (guint32 xid)
165 {
166@@ -1945,6 +1966,24 @@
167 }
168
169 void
170+Launcher::OnWindowMaybeIntellihideDelayed (guint32 xid)
171+{
172+ /*
173+ * Delay to let the other window taking the focus first (otherwise focuschanged
174+ * is emmited with the root window focus
175+ */
176+ if (_hidemode != LAUNCHER_HIDE_NEVER)
177+ g_idle_add ((GSourceFunc)CheckWindowOverLauncherSync, this);
178+}
179+
180+gboolean
181+Launcher::CheckWindowOverLauncherSync (Launcher *self)
182+{
183+ self->CheckWindowOverLauncher ();
184+ return FALSE;
185+}
186+
187+void
188 Launcher::OnPluginStateChanged ()
189 {
190 _hide_machine->SetQuirk (LauncherHideMachine::EXPO_ACTIVE, PluginAdapter::Default ()->IsExpoActive ());
191@@ -2067,7 +2106,7 @@
192
193 _hover_machine->SetQuirk (LauncherHoverMachine::LAUNCHER_IN_ACTION, (actionstate != ACTION_NONE));
194
195- if (_hide_machine->GetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE))
196+ if (_keynav_activated)
197 exitKeyNavMode ();
198 }
199
200@@ -2981,7 +3020,7 @@
201
202 void Launcher::RecvMouseDownOutsideArea (int x, int y, unsigned long button_flags, unsigned long key_flags)
203 {
204- if (_hide_machine->GetQuirk (LauncherHideMachine::KEY_NAV_ACTIVE))
205+ if (_keynav_activated)
206 exitKeyNavMode ();
207 }
208
209@@ -3197,6 +3236,13 @@
210
211 LauncherModel::iterator it;
212
213+ /*
214+ * all key events below are related to keynavigation. Make an additional
215+ * check that we are in a keynav mode when we inadvertadly receive the focus
216+ */
217+ if (!_keynav_activated)
218+ return;
219+
220 switch (key_sym)
221 {
222 // up (move selection up or go to global-menu if at top-most icon)
223@@ -3205,7 +3251,6 @@
224 if (_current_icon_index > 0)
225 {
226 int temp_current_icon_index = _current_icon_index;
227-
228 do
229 {
230 temp_current_icon_index --;
231
232=== modified file 'src/Launcher.h'
233--- src/Launcher.h 2011-04-15 19:15:56 +0000
234+++ src/Launcher.h 2011-04-18 17:43:02 +0000
235@@ -236,6 +236,8 @@
236 } RenderArg;
237
238 void OnWindowMaybeIntellihide (guint32 xid);
239+ void OnWindowMaybeIntellihideDelayed (guint32 xid);
240+ static gboolean CheckWindowOverLauncherSync (Launcher *self);
241 void OnWindowMapped (guint32 xid);
242 void OnWindowUnmapped (guint32 xid);
243
244@@ -258,6 +260,7 @@
245
246 void SetStateMouseOverLauncher (bool over_launcher);
247 void SetStateMouseOverBFB (bool over_bfb);
248+ void SetStateKeyNav (bool keynav_activated);
249
250 bool MouseBeyondDragThreshold ();
251
252@@ -421,6 +424,7 @@
253
254 bool _shortcuts_shown;
255 bool _super_pressed;
256+ bool _keynav_activated;
257 guint64 _latest_shortcut;
258
259 BacklightMode _backlight_mode;
260@@ -542,6 +546,7 @@
261 sigc::connection _on_window_hidden_intellihide_connection;
262 sigc::connection _on_window_resized_intellihide_connection;
263 sigc::connection _on_window_moved_intellihide_connection;
264+ sigc::connection _on_window_focuschanged_intellihide_connection;
265 sigc::connection _on_window_mapped_connection;
266 sigc::connection _on_window_unmapped_connection;
267 sigc::connection _on_initiate_spread_connection;
268
269=== modified file 'src/LauncherController.cpp'
270--- src/LauncherController.cpp 2011-04-14 15:04:04 +0000
271+++ src/LauncherController.cpp 2011-04-18 17:43:02 +0000
272@@ -283,6 +283,7 @@
273
274 self->SetupBamf ();
275
276+ self->_bamf_timer_handler_id = 0;
277 return false;
278 }
279
280
281=== modified file 'src/LauncherIcon.cpp'
282--- src/LauncherIcon.cpp 2011-04-14 14:29:40 +0000
283+++ src/LauncherIcon.cpp 2011-04-18 17:43:02 +0000
284@@ -318,12 +318,8 @@
285
286 // FIXME: we need to create some kind of -unity postfix to see if we are looking to the unity-icon-theme
287 // for dedicated unity icons, then remove the postfix and degrade to other icon themes if not found
288- if (((g_strrstr (icon_name, "user-trash") != NULL) ||
289- (g_strcmp0 (icon_name, "workspace-switcher") == 0)) &&
290- IsMonoDefaultTheme ()) {
291+ if ((g_strcmp0 (icon_name, "workspace-switcher") == 0) && IsMonoDefaultTheme ())
292 result = TextureFromSpecificGtkTheme (_unity_theme, icon_name, size, update_glow_colors);
293-
294- }
295
296 if (!result)
297 result = TextureFromSpecificGtkTheme (default_theme, icon_name, size, update_glow_colors, true);
298@@ -671,6 +667,7 @@
299
300 if (_present_time_handle > 0)
301 g_source_remove (_present_time_handle);
302+ _present_time_handle = 0;
303
304 SetQuirk (QUIRK_PRESENTED, false);
305 }
306
307=== modified file 'src/PlacesSearchBar.cpp'
308--- src/PlacesSearchBar.cpp 2011-04-13 15:57:42 +0000
309+++ src/PlacesSearchBar.cpp 2011-04-18 17:43:02 +0000
310@@ -291,6 +291,7 @@
311 PlacesSearchBar::OnLiveSearchTimeout (PlacesSearchBar *self)
312 {
313 self->EmitLiveSearch ();
314+ self->_live_search_timeout = 0;
315
316 return FALSE;
317 }
318@@ -304,7 +305,6 @@
319
320 _entry->SetSearch (_pango_entry->GetText ().c_str (), hints);
321 }
322- _live_search_timeout = 0;
323 }
324
325 void
326
327=== modified file 'src/PlacesView.cpp'
328--- src/PlacesView.cpp 2011-04-15 09:49:41 +0000
329+++ src/PlacesView.cpp 2011-04-18 17:43:02 +0000
330@@ -153,11 +153,11 @@
331 ubus_server_unregister_interest (ubus, _ubus_handles[i]);
332 }
333
334- if (_close_idle != 0)
335- {
336+ if (_close_idle)
337 g_source_remove (_close_idle);
338- _close_idle = 0;
339- }
340+ if (_resize_id)
341+ g_source_remove (_resize_id);
342+
343 delete _home_entry;
344 }
345
346
347=== modified file 'src/PluginAdapter.cpp'
348--- src/PluginAdapter.cpp 2011-04-18 14:56:13 +0000
349+++ src/PluginAdapter.cpp 2011-04-18 17:43:02 +0000
350@@ -169,6 +169,9 @@
351 case CompWindowNotifyReparent:
352 MaximizeIfBigEnough (window);
353 break;
354+ case CompWindowNotifyFocusChange:
355+ WindowManager::window_focus_changed.emit (window->id ());
356+ break;
357 default:
358 break;
359 }
360
361=== modified file 'src/WindowManager.h'
362--- src/WindowManager.h 2011-04-08 17:53:28 +0000
363+++ src/WindowManager.h 2011-04-18 17:43:02 +0000
364@@ -82,6 +82,7 @@
365 sigc::signal<void, guint32> window_hidden;
366 sigc::signal<void, guint32> window_resized;
367 sigc::signal<void, guint32> window_moved;
368+ sigc::signal<void, guint32> window_focus_changed;
369
370 sigc::signal<void> initiate_spread;
371 sigc::signal<void> terminate_spread;