Merge lp:~didrocks/unity/launcher-fix-of-the-week-04-04-11 into lp:unity
- launcher-fix-of-the-week-04-04-11
- Merge into trunk
Proposed by
Didier Roche-Tolomelli
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1075 | ||||
Proposed branch: | lp:~didrocks/unity/launcher-fix-of-the-week-04-04-11 | ||||
Merge into: | lp:unity | ||||
Diff against target: |
731 lines (+225/-84) 13 files modified
src/BamfLauncherIcon.cpp (+1/-6) src/DeviceLauncherSection.cpp (+6/-1) src/DeviceLauncherSection.h (+1/-0) src/Launcher.cpp (+144/-46) src/Launcher.h (+17/-2) src/LauncherHideMachine.cpp (+30/-4) src/LauncherHideMachine.h (+4/-1) src/LauncherHoverMachine.cpp (+11/-11) src/LauncherHoverMachine.h (+2/-2) src/PanelTray.cpp (+4/-9) src/PanelTray.h (+0/-2) src/PlacesController.cpp (+3/-0) src/PlacesResultsController.cpp (+2/-0) |
||||
To merge this branch: | bzr merge lp:~didrocks/unity/launcher-fix-of-the-week-04-04-11 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Review via email: mp+56415@code.launchpad.net |
Commit message
Description of the change
This branch:
- fix an issue with repeated key (LP: #750535)
- reduce shortcuts label size and change some super behaviour (LP: #747812)
- additional cleanage (signals and code)
- prevents false positive "bring the dash" positive even when we are in scale
mode (not directly handled by unity) (LP: #751102)
- Avoid spamming the launcher with state change when the state is finally the
same. (Launcher and Hover machine). That will hopefully fix the "click
through" bug when the Launcher wrongly stay visible (half of bug LP: #744325)
- move the position of the icon on timeout drag. Fix a potential crasher as well
(LP: #751196)
To post a comment you must log in.
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-02 08:36:07 +0000 |
3 | +++ src/BamfLauncherIcon.cpp 2011-04-05 17:30:38 +0000 |
4 | @@ -692,12 +692,7 @@ |
5 | |
6 | if (sticky) |
7 | { |
8 | - bamf_view_set_sticky (view, false); |
9 | - if (bamf_view_is_closed (view)) |
10 | - self->Remove (); |
11 | - |
12 | - if (desktop_file && strlen (desktop_file) > 0) |
13 | - FavoriteStore::GetDefault ()->RemoveFavorite (desktop_file); |
14 | + self->UnStick (); |
15 | } |
16 | else |
17 | { |
18 | |
19 | === modified file 'src/DeviceLauncherSection.cpp' |
20 | --- src/DeviceLauncherSection.cpp 2011-03-29 14:36:45 +0000 |
21 | +++ src/DeviceLauncherSection.cpp 2011-04-05 17:30:38 +0000 |
22 | @@ -41,7 +41,7 @@ |
23 | G_CALLBACK (&DeviceLauncherSection::OnMountAdded), |
24 | this); |
25 | |
26 | - g_idle_add ((GSourceFunc)&DeviceLauncherSection::PopulateEntries, this); |
27 | + _on_device_populate_entry_id = g_idle_add ((GSourceFunc)&DeviceLauncherSection::PopulateEntries, this); |
28 | } |
29 | |
30 | DeviceLauncherSection::~DeviceLauncherSection () |
31 | @@ -58,6 +58,9 @@ |
32 | g_signal_handler_disconnect ((gpointer) _monitor, |
33 | _on_mount_added_handler_id); |
34 | |
35 | + if (_on_device_populate_entry_id) |
36 | + g_source_remove (_on_device_populate_entry_id); |
37 | + |
38 | g_object_unref (_monitor); |
39 | g_hash_table_unref (_ht); |
40 | } |
41 | @@ -81,6 +84,8 @@ |
42 | } |
43 | |
44 | g_list_free (volumes); |
45 | + |
46 | + self->_on_device_populate_entry_id = 0; |
47 | |
48 | return false; |
49 | } |
50 | |
51 | === modified file 'src/DeviceLauncherSection.h' |
52 | --- src/DeviceLauncherSection.h 2011-03-29 14:36:45 +0000 |
53 | +++ src/DeviceLauncherSection.h 2011-04-05 17:30:38 +0000 |
54 | @@ -56,6 +56,7 @@ |
55 | gulong _on_volume_added_handler_id; |
56 | gulong _on_volume_removed_handler_id; |
57 | gulong _on_mount_added_handler_id; |
58 | + gulong _on_device_populate_entry_id; |
59 | }; |
60 | |
61 | #endif // _DEVICE_LAUNCHER_SECTION_H_ |
62 | |
63 | === modified file 'src/Launcher.cpp' |
64 | --- src/Launcher.cpp 2011-04-03 06:20:39 +0000 |
65 | +++ src/Launcher.cpp 2011-04-05 17:30:38 +0000 |
66 | @@ -357,11 +357,19 @@ |
67 | _launcher_drag_delta = 0; |
68 | _dnd_delta_y = 0; |
69 | _dnd_delta_x = 0; |
70 | - _autoscroll_handle = 0; |
71 | - _redraw_handle = 0; |
72 | - _start_dragicon_handle = 0; |
73 | - _focus_keynav_handle = 0; |
74 | - _dnd_check_handle = 0; |
75 | + |
76 | + _autoscroll_handle = 0; |
77 | + _super_show_launcher_handle = 0; |
78 | + _super_hide_launcher_handle = 0; |
79 | + _super_show_shortcuts_handle = 0; |
80 | + _start_dragicon_handle = 0; |
81 | + _focus_keynav_handle = 0; |
82 | + _dnd_check_handle = 0; |
83 | + _ignore_repeat_shortcut_handle = 0; |
84 | + |
85 | + _latest_shortcut = 0; |
86 | + _super_pressed = false; |
87 | + _shortcuts_shown = false; |
88 | _floating = false; |
89 | _hovered = false; |
90 | _hidden = false; |
91 | @@ -431,10 +439,23 @@ |
92 | g_bus_unown_name (_dbus_owner); |
93 | |
94 | if (_dnd_check_handle) |
95 | - { |
96 | g_source_remove (_dnd_check_handle); |
97 | - _dnd_check_handle = 0; |
98 | - } |
99 | + if (_autoscroll_handle) |
100 | + g_source_remove (_autoscroll_handle); |
101 | + if (_focus_keynav_handle) |
102 | + g_source_remove (_focus_keynav_handle); |
103 | + if (_super_show_launcher_handle) |
104 | + g_source_remove (_super_show_launcher_handle); |
105 | + if (_super_show_shortcuts_handle) |
106 | + g_source_remove (_super_show_shortcuts_handle); |
107 | + if (_start_dragicon_handle) |
108 | + g_source_remove (_start_dragicon_handle); |
109 | + if (_ignore_repeat_shortcut_handle) |
110 | + g_source_remove (_ignore_repeat_shortcut_handle); |
111 | + if (_super_show_launcher_handle) |
112 | + g_source_remove (_super_show_launcher_handle); |
113 | + if (_super_hide_launcher_handle) |
114 | + g_source_remove (_super_hide_launcher_handle); |
115 | |
116 | // disconnect the huge number of signal-slot callbacks |
117 | if (_set_hidden_connection.connected ()) |
118 | @@ -502,6 +523,7 @@ |
119 | |
120 | if (_on_drag_finish_connection.connected ()) |
121 | _on_drag_finish_connection.disconnect (); |
122 | + |
123 | } |
124 | |
125 | /* Introspection */ |
126 | @@ -526,6 +548,7 @@ |
127 | gchar* fontName = NULL; |
128 | |
129 | double label_pos = double(_icon_size / 3.0f); |
130 | + double text_size = double(_icon_size / 4.0f); |
131 | double label_x = label_pos; |
132 | double label_y = label_pos; |
133 | double label_w = label_pos; |
134 | @@ -543,7 +566,7 @@ |
135 | layout = pango_cairo_create_layout (cr); |
136 | g_object_get (settings, "gtk-font-name", &fontName, NULL); |
137 | desc = pango_font_description_from_string (fontName); |
138 | - pango_font_description_set_absolute_size (desc, label_pos * PANGO_SCALE); |
139 | + pango_font_description_set_absolute_size (desc, text_size * PANGO_SCALE); |
140 | pango_layout_set_font_description (layout, desc); |
141 | pango_layout_set_text (layout, &label, 1); |
142 | pangoCtx = pango_layout_get_context (layout); // is not ref'ed |
143 | @@ -652,6 +675,7 @@ |
144 | NULL); |
145 | |
146 | self->selection_change.emit (); |
147 | + self->_focus_keynav_handle = 0; |
148 | |
149 | return false; |
150 | } |
151 | @@ -1479,44 +1503,89 @@ |
152 | gboolean Launcher::TapOnSuper () |
153 | { |
154 | struct timespec current; |
155 | - bool tap_on_super; |
156 | - bool shortcuts_shown = false; |
157 | clock_gettime (CLOCK_MONOTONIC, ¤t); |
158 | |
159 | - tap_on_super = (TimeDelta (¤t, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION); |
160 | - |
161 | - if (_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN)) |
162 | - shortcuts_shown = !tap_on_super; |
163 | - |
164 | - _hover_machine->SetQuirk (LauncherHoverMachine::SHOTCUT_KEYS_VISIBLE, shortcuts_shown); |
165 | - |
166 | - return tap_on_super; |
167 | - |
168 | + return (TimeDelta (¤t, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION); |
169 | } |
170 | |
171 | /* Launcher Show/Hide logic */ |
172 | |
173 | void Launcher::StartKeyShowLauncher () |
174 | { |
175 | - _hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN, true); |
176 | + _super_pressed = true; |
177 | _hide_machine->SetQuirk (LauncherHideMachine::LAST_ACTION_ACTIVATE, false); |
178 | - QueueDraw (); |
179 | - SetTimeStruct (&_times[TIME_TAP_SUPER], NULL, SUPER_TAP_DURATION); |
180 | - if (_redraw_handle > 0) |
181 | - g_source_remove (_redraw_handle); |
182 | - _redraw_handle = g_timeout_add (SUPER_TAP_DURATION, &Launcher::DrawLauncherTimeout, this); |
183 | + |
184 | + SetTimeStruct (&_times[TIME_TAP_SUPER]); |
185 | + SetTimeStruct (&_times[TIME_SUPER_PRESSED]); |
186 | + |
187 | + if (_super_show_launcher_handle > 0) |
188 | + g_source_remove (_super_show_launcher_handle); |
189 | + _super_show_launcher_handle = g_timeout_add (SUPER_TAP_DURATION, &Launcher::SuperShowLauncherTimeout, this); |
190 | + |
191 | + if (_super_show_shortcuts_handle > 0) |
192 | + g_source_remove (_super_show_shortcuts_handle); |
193 | + _super_show_shortcuts_handle = g_timeout_add (SHORTCUTS_SHOWN_DELAY, &Launcher::SuperShowShortcutsTimeout, this); |
194 | } |
195 | |
196 | void Launcher::EndKeyShowLauncher () |
197 | { |
198 | - |
199 | - _hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN, false); |
200 | - _hover_machine->SetQuirk (LauncherHoverMachine::SHOTCUT_KEYS_VISIBLE, false); |
201 | + int remaining_time_before_hide; |
202 | + struct timespec current; |
203 | + clock_gettime (CLOCK_MONOTONIC, ¤t); |
204 | + |
205 | + _hover_machine->SetQuirk (LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, false); |
206 | + _super_pressed = false; |
207 | + _shortcuts_shown = false; |
208 | QueueDraw (); |
209 | - |
210 | - // it's a tap on super |
211 | - if (TapOnSuper ()) |
212 | - ubus_server_send_message (ubus_server_get_default (), UBUS_DASH_EXTERNAL_ACTIVATION, NULL); |
213 | + |
214 | + // remove further show launcher (which can happen when we close the dash with super) |
215 | + if (_super_show_launcher_handle > 0) |
216 | + g_source_remove (_super_show_launcher_handle); |
217 | + if (_super_show_shortcuts_handle > 0) |
218 | + g_source_remove (_super_show_shortcuts_handle); |
219 | + |
220 | + // it's a tap on super and we didn't use any shortcuts |
221 | + if (TapOnSuper () && !_latest_shortcut) |
222 | + ubus_server_send_message (ubus_server_get_default (), UBUS_DASH_EXTERNAL_ACTIVATION, NULL); |
223 | + |
224 | + remaining_time_before_hide = BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION - CLAMP ((int) (TimeDelta (¤t, &_times[TIME_SUPER_PRESSED])), 0, BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION); |
225 | + |
226 | + if (_super_hide_launcher_handle > 0) |
227 | + g_source_remove (_super_hide_launcher_handle); |
228 | + _super_hide_launcher_handle = g_timeout_add (remaining_time_before_hide, &Launcher::SuperHideLauncherTimeout, this); |
229 | +} |
230 | + |
231 | +gboolean Launcher::SuperHideLauncherTimeout (gpointer data) |
232 | +{ |
233 | + Launcher *self = (Launcher*) data; |
234 | + |
235 | + self->_hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_SHOW, false); |
236 | + |
237 | + self->_super_hide_launcher_handle = 0; |
238 | + return false; |
239 | +} |
240 | + |
241 | +gboolean Launcher::SuperShowLauncherTimeout (gpointer data) |
242 | +{ |
243 | + Launcher *self = (Launcher*) data; |
244 | + |
245 | + self->_hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_SHOW, true); |
246 | + |
247 | + self->_super_show_launcher_handle = 0; |
248 | + return false; |
249 | +} |
250 | + |
251 | +gboolean Launcher::SuperShowShortcutsTimeout (gpointer data) |
252 | +{ |
253 | + Launcher *self = (Launcher*) data; |
254 | + |
255 | + self->_shortcuts_shown = true; |
256 | + self->_hover_machine->SetQuirk (LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, true); |
257 | + |
258 | + self->QueueDraw (); |
259 | + |
260 | + self->_super_show_shortcuts_handle = 0; |
261 | + return false; |
262 | } |
263 | |
264 | void Launcher::OnPlaceViewShown (GVariant *data, void *val) |
265 | @@ -1647,14 +1716,6 @@ |
266 | return _mouse_position.y; |
267 | } |
268 | |
269 | -gboolean Launcher::DrawLauncherTimeout (gpointer data) |
270 | -{ |
271 | - Launcher *self = (Launcher*) data; |
272 | - |
273 | - self->QueueDraw (); |
274 | - return false; |
275 | -} |
276 | - |
277 | bool |
278 | Launcher::CheckIntersectWindow (CompWindow *window) |
279 | { |
280 | @@ -1975,6 +2036,7 @@ |
281 | } |
282 | |
283 | self->EnsureAnimation (); |
284 | + self->_autoscroll_handle = 0; |
285 | |
286 | return TRUE; |
287 | } |
288 | @@ -2514,7 +2576,7 @@ |
289 | geo); |
290 | |
291 | /* draw superkey-shortcut label */ |
292 | - if (_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN) && !TapOnSuper ()) |
293 | + if (_shortcuts_shown) |
294 | { |
295 | guint64 shortcut = arg.icon->GetShortcut (); |
296 | |
297 | @@ -2680,8 +2742,16 @@ |
298 | Launcher *self = (Launcher*) data; |
299 | |
300 | // if we are still waiting… |
301 | - if (self->GetActionState () == ACTION_NONE) |
302 | + if (self->GetActionState () == ACTION_NONE) { |
303 | + if (self->_icon_under_mouse) |
304 | + { |
305 | + self->_icon_under_mouse->MouseLeave.emit (); |
306 | + self->_icon_under_mouse->_mouse_inside = false; |
307 | + self->_icon_under_mouse = 0; |
308 | + } |
309 | self->StartIconDragRequest (self->GetMouseX (), self->GetMouseY ()); |
310 | + } |
311 | + self->_start_dragicon_handle = 0; |
312 | return false; |
313 | } |
314 | |
315 | @@ -2696,6 +2766,7 @@ |
316 | StartIconDrag (drag_icon); |
317 | SetActionState (ACTION_DRAG_ICON); |
318 | UpdateDragWindowPosition (x, y); |
319 | + EnsureAnimation (); |
320 | } |
321 | } |
322 | |
323 | @@ -2917,26 +2988,53 @@ |
324 | EnsureAnimation (); |
325 | } |
326 | |
327 | + |
328 | +gboolean |
329 | +Launcher::ResetRepeatShorcutTimeout (gpointer data) |
330 | +{ |
331 | + Launcher *self = (Launcher*) data; |
332 | + |
333 | + self->_latest_shortcut = 0; |
334 | + |
335 | + self->_ignore_repeat_shortcut_handle = 0; |
336 | + return false; |
337 | +} |
338 | + |
339 | gboolean |
340 | Launcher::CheckSuperShortcutPressed (unsigned int key_sym, |
341 | unsigned long key_code, |
342 | unsigned long key_state) |
343 | { |
344 | - if (!_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN)) |
345 | + if (!_super_pressed) |
346 | return false; |
347 | |
348 | LauncherModel::iterator it; |
349 | - int i; |
350 | |
351 | // Shortcut to start launcher icons. Only relies on Keycode, ignore modifier |
352 | - for (it = _model->begin (), i = 0; it != _model->end (); it++, i++) |
353 | + for (it = _model->begin (); it != _model->end (); it++) |
354 | { |
355 | if (XKeysymToKeycode (screen->dpy (), (*it)->GetShortcut ()) == key_code) |
356 | { |
357 | + /* |
358 | + * start a timeout while repressing the same shortcut will be ignored. |
359 | + * This is because the keypress repeat is handled by Xorg and we have no |
360 | + * way to know if a press is an actual press or just an automated repetition |
361 | + * because the button is hold down. (key release events are sent in both cases) |
362 | + */ |
363 | + if (_ignore_repeat_shortcut_handle > 0) |
364 | + g_source_remove (_ignore_repeat_shortcut_handle); |
365 | + _ignore_repeat_shortcut_handle = g_timeout_add (IGNORE_REPEAT_SHORTCUT_DURATION, &Launcher::ResetRepeatShorcutTimeout, this); |
366 | + |
367 | + if (_latest_shortcut == (*it)->GetShortcut ()) |
368 | + return true; |
369 | + |
370 | if (g_ascii_isdigit ((gchar) (*it)->GetShortcut ()) && (key_state & ShiftMask)) |
371 | (*it)->OpenInstance (); |
372 | else |
373 | (*it)->Activate (); |
374 | + |
375 | + _latest_shortcut = (*it)->GetShortcut (); |
376 | + |
377 | // disable the "tap on super" check |
378 | _times[TIME_TAP_SUPER].tv_sec = 0; |
379 | _times[TIME_TAP_SUPER].tv_nsec = 0; |
380 | |
381 | === modified file 'src/Launcher.h' |
382 | --- src/Launcher.h 2011-04-03 06:20:39 +0000 |
383 | +++ src/Launcher.h 2011-04-05 17:30:38 +0000 |
384 | @@ -42,7 +42,11 @@ |
385 | #define ANIM_DURATION_LONG 350 |
386 | |
387 | #define SUPER_TAP_DURATION 250 |
388 | +#define SHORTCUTS_SHOWN_DELAY 750 |
389 | #define START_DRAGICON_DURATION 500 |
390 | +#define BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION 1000 |
391 | + |
392 | +#define IGNORE_REPEAT_SHORTCUT_DURATION 250 |
393 | |
394 | #define MAX_SUPERKEY_LABELS 10 |
395 | |
396 | @@ -197,6 +201,7 @@ |
397 | TIME_DRAG_EDGE_TOUCH, |
398 | TIME_DRAG_OUT, |
399 | TIME_TAP_SUPER, |
400 | + TIME_SUPER_PRESSED, |
401 | |
402 | TIME_LAST |
403 | } LauncherActionTimes; |
404 | @@ -237,10 +242,13 @@ |
405 | void OnPluginStateChanged (); |
406 | |
407 | static gboolean AnimationTimeout (gpointer data); |
408 | - static gboolean DrawLauncherTimeout (gpointer data); |
409 | + static gboolean SuperShowLauncherTimeout (gpointer data); |
410 | + static gboolean SuperHideLauncherTimeout (gpointer data); |
411 | + static gboolean SuperShowShortcutsTimeout (gpointer data); |
412 | static gboolean StrutHack (gpointer data); |
413 | static gboolean MoveFocusToKeyNavModeTimeout (gpointer data); |
414 | static gboolean StartIconDragTimeout (gpointer data); |
415 | + static gboolean ResetRepeatShorcutTimeout (gpointer data); |
416 | |
417 | void SetMousePosition (int x, int y); |
418 | |
419 | @@ -406,6 +414,10 @@ |
420 | bool _render_drag_window; |
421 | bool _check_window_over_launcher; |
422 | |
423 | + bool _shortcuts_shown; |
424 | + bool _super_pressed; |
425 | + guint64 _latest_shortcut; |
426 | + |
427 | BacklightMode _backlight_mode; |
428 | |
429 | float _folded_angle; |
430 | @@ -461,9 +473,12 @@ |
431 | |
432 | guint _autoscroll_handle; |
433 | guint _focus_keynav_handle; |
434 | - guint _redraw_handle; |
435 | + guint _super_show_launcher_handle; |
436 | + guint _super_hide_launcher_handle; |
437 | + guint _super_show_shortcuts_handle; |
438 | guint _start_dragicon_handle; |
439 | guint _dnd_check_handle; |
440 | + guint _ignore_repeat_shortcut_handle; |
441 | |
442 | nux::Point2 _mouse_position; |
443 | nux::Point2 _bfb_mouse_position; |
444 | |
445 | === modified file 'src/LauncherHideMachine.cpp' |
446 | --- src/LauncherHideMachine.cpp 2011-03-30 10:16:11 +0000 |
447 | +++ src/LauncherHideMachine.cpp 2011-04-05 17:30:38 +0000 |
448 | @@ -25,6 +25,9 @@ |
449 | _quirks = DEFAULT; |
450 | _should_hide = false; |
451 | |
452 | + _latest_emit_should_hide = false; |
453 | + _hide_changed_emit_handle = 0; |
454 | + |
455 | _hide_delay_handle = 0; |
456 | _hide_delay_timeout_length = 750; |
457 | } |
458 | @@ -36,6 +39,11 @@ |
459 | g_source_remove (_hide_delay_handle); |
460 | _hide_delay_handle = 0; |
461 | } |
462 | + if (_hide_changed_emit_handle) |
463 | + { |
464 | + g_source_remove (_hide_changed_emit_handle); |
465 | + _hide_changed_emit_handle = 0; |
466 | + } |
467 | } |
468 | |
469 | void |
470 | @@ -54,7 +62,10 @@ |
471 | else |
472 | { |
473 | _should_hide = value; |
474 | - should_hide_changed.emit (value); |
475 | + |
476 | + if (_hide_changed_emit_handle) |
477 | + g_source_remove (_hide_changed_emit_handle); |
478 | + _hide_changed_emit_handle = g_timeout_add (0, &EmitShouldHideChanged, this); |
479 | } |
480 | } |
481 | |
482 | @@ -66,7 +77,7 @@ |
483 | QUICKLIST_OPEN = 1 << 4, 16 #VISIBLE_REQUIRED |
484 | EXTERNAL_DND_ACTIVE = 1 << 5, 32 #VISIBLE_REQUIRED |
485 | INTERNAL_DND_ACTIVE = 1 << 6, 64 #VISIBLE_REQUIRED |
486 | - TRIGGER_BUTTON_DOWN = 1 << 7, 128 #VISIBLE_REQUIRED |
487 | + TRIGGER_BUTTON_SHOW = 1 << 7, 128 #VISIBLE_REQUIRED |
488 | ANY_WINDOW_UNDER = 1 << 8, 256 |
489 | ACTIVE_WINDOW_UNDER = 1 << 9, 512 |
490 | DND_PUSHED_OFF = 1 << 10, 1024 |
491 | @@ -81,7 +92,7 @@ |
492 | */ |
493 | |
494 | #define VISIBLE_REQUIRED (QUICKLIST_OPEN | EXTERNAL_DND_ACTIVE | \ |
495 | -INTERNAL_DND_ACTIVE | TRIGGER_BUTTON_DOWN | VERTICAL_SLIDE_ACTIVE |\ |
496 | +INTERNAL_DND_ACTIVE | TRIGGER_BUTTON_SHOW | VERTICAL_SLIDE_ACTIVE |\ |
497 | KEY_NAV_ACTIVE | PLACES_VISIBLE | SCALE_ACTIVE | EXPO_ACTIVE |\ |
498 | MT_DRAG_OUT) |
499 | |
500 | @@ -160,7 +171,7 @@ |
501 | } |
502 | |
503 | #define SKIP_DELAY_QUIRK (EXTERNAL_DND_ACTIVE | DND_PUSHED_OFF | ACTIVE_WINDOW_UNDER | \ |
504 | -ANY_WINDOW_UNDER | EXPO_ACTIVE | SCALE_ACTIVE | MT_DRAG_OUT) |
505 | +ANY_WINDOW_UNDER | EXPO_ACTIVE | SCALE_ACTIVE | MT_DRAG_OUT | TRIGGER_BUTTON_SHOW) |
506 | |
507 | void |
508 | LauncherHideMachine::SetQuirk (LauncherHideMachine::HideQuirk quirk, bool active) |
509 | @@ -207,6 +218,21 @@ |
510 | return false; |
511 | } |
512 | |
513 | +gboolean |
514 | +LauncherHideMachine::EmitShouldHideChanged (gpointer data) |
515 | +{ |
516 | + LauncherHideMachine *self = static_cast<LauncherHideMachine *> (data); |
517 | + |
518 | + self->_hide_changed_emit_handle = 0; |
519 | + if (self->_should_hide == self->_latest_emit_should_hide) |
520 | + return false; |
521 | + |
522 | + self->_latest_emit_should_hide = self->_should_hide; |
523 | + self->should_hide_changed.emit (self->_should_hide); |
524 | + |
525 | + return false; |
526 | +} |
527 | + |
528 | char* |
529 | LauncherHideMachine::DebugHideQuirks () |
530 | { |
531 | |
532 | === modified file 'src/LauncherHideMachine.h' |
533 | --- src/LauncherHideMachine.h 2011-03-30 10:16:11 +0000 |
534 | +++ src/LauncherHideMachine.h 2011-04-05 17:30:38 +0000 |
535 | @@ -44,7 +44,7 @@ |
536 | QUICKLIST_OPEN = 1 << 4, |
537 | EXTERNAL_DND_ACTIVE = 1 << 5, |
538 | INTERNAL_DND_ACTIVE = 1 << 6, |
539 | - TRIGGER_BUTTON_DOWN = 1 << 7, |
540 | + TRIGGER_BUTTON_SHOW = 1 << 7, |
541 | ANY_WINDOW_UNDER = 1 << 8, |
542 | ACTIVE_WINDOW_UNDER = 1 << 9, |
543 | DND_PUSHED_OFF = 1 << 10, |
544 | @@ -78,13 +78,16 @@ |
545 | void SetShouldHide (bool value, bool skip_delay); |
546 | |
547 | static gboolean OnHideDelayTimeout (gpointer data); |
548 | + static gboolean EmitShouldHideChanged (gpointer data); |
549 | |
550 | bool _should_hide; |
551 | + bool _latest_emit_should_hide; |
552 | HideQuirk _quirks; |
553 | HideMode _mode; |
554 | unsigned int _hide_delay_timeout_length; |
555 | |
556 | guint _hide_delay_handle; |
557 | + guint _hide_changed_emit_handle; |
558 | }; |
559 | |
560 | #endif |
561 | |
562 | === modified file 'src/LauncherHoverMachine.cpp' |
563 | --- src/LauncherHoverMachine.cpp 2011-03-30 10:16:11 +0000 |
564 | +++ src/LauncherHoverMachine.cpp 2011-04-05 17:30:38 +0000 |
565 | @@ -23,7 +23,7 @@ |
566 | { |
567 | _quirks = DEFAULT; |
568 | _should_hover = false; |
569 | - _pending_should_hover = false; // avoid building a struct in the callback |
570 | + _latest_emit_should_hover = false; |
571 | _hover_changed_emit_handle = 0; |
572 | |
573 | } |
574 | @@ -42,7 +42,7 @@ |
575 | LAUNCHER_HIDDEN = 1 << 0, 1 |
576 | MOUSE_OVER_LAUNCHER = 1 << 1, 2 |
577 | MOUSE_OVER_BFB = 1 << 2, 4 |
578 | - SHOTCUT_KEYS_VISIBLE = 1 << 3, 8 |
579 | + SHORTCUT_KEYS_VISIBLE = 1 << 3, 8 |
580 | QUICKLIST_OPEN = 1 << 4, 16 |
581 | KEY_NAV_ACTIVE = 1 << 5, 32 |
582 | LAUNCHER_IN_ACTION = 1 << 6, 64 |
583 | @@ -60,7 +60,7 @@ |
584 | } |
585 | |
586 | if (GetQuirk ((HoverQuirk) (MOUSE_OVER_LAUNCHER | MOUSE_OVER_BFB | |
587 | - SHOTCUT_KEYS_VISIBLE | KEY_NAV_ACTIVE | |
588 | + SHORTCUT_KEYS_VISIBLE | KEY_NAV_ACTIVE | |
589 | QUICKLIST_OPEN | LAUNCHER_IN_ACTION))) |
590 | should_hover = true; |
591 | else |
592 | @@ -72,11 +72,11 @@ |
593 | |
594 | void |
595 | LauncherHoverMachine::SetShouldHover (bool value) |
596 | -{ |
597 | +{ |
598 | + _should_hover = value; |
599 | + |
600 | if (_hover_changed_emit_handle) |
601 | g_source_remove (_hover_changed_emit_handle); |
602 | - |
603 | - _pending_should_hover = value; |
604 | _hover_changed_emit_handle = g_timeout_add (0, &EmitShouldHoverChanged, this); |
605 | } |
606 | |
607 | @@ -84,14 +84,14 @@ |
608 | LauncherHoverMachine::EmitShouldHoverChanged (gpointer data) |
609 | { |
610 | LauncherHoverMachine *self = static_cast<LauncherHoverMachine *> (data); |
611 | - |
612 | - if (self->_should_hover == self->_pending_should_hover) |
613 | + |
614 | + self->_hover_changed_emit_handle = 0; |
615 | + if (self->_should_hover == self->_latest_emit_should_hover) |
616 | return false; |
617 | - |
618 | - self->_should_hover = self->_pending_should_hover; |
619 | - self->_hover_changed_emit_handle = 0; |
620 | |
621 | + self->_latest_emit_should_hover = self->_should_hover; |
622 | self->should_hover_changed.emit (self->_should_hover); |
623 | + |
624 | return false; |
625 | } |
626 | |
627 | |
628 | === modified file 'src/LauncherHoverMachine.h' |
629 | --- src/LauncherHoverMachine.h 2011-03-30 10:16:11 +0000 |
630 | +++ src/LauncherHoverMachine.h 2011-04-05 17:30:38 +0000 |
631 | @@ -33,7 +33,7 @@ |
632 | LAUNCHER_HIDDEN = 1 << 0, |
633 | MOUSE_OVER_LAUNCHER = 1 << 1, |
634 | MOUSE_OVER_BFB = 1 << 2, |
635 | - SHOTCUT_KEYS_VISIBLE = 1 << 3, |
636 | + SHORTCUT_KEYS_VISIBLE = 1 << 3, |
637 | QUICKLIST_OPEN = 1 << 4, |
638 | KEY_NAV_ACTIVE = 1 << 5, |
639 | LAUNCHER_IN_ACTION = 1 << 6, |
640 | @@ -56,7 +56,7 @@ |
641 | static gboolean EmitShouldHoverChanged (gpointer data); |
642 | |
643 | bool _should_hover; |
644 | - bool _pending_should_hover; |
645 | + bool _latest_emit_should_hover; |
646 | HoverQuirk _quirks; |
647 | |
648 | guint _hover_changed_emit_handle; |
649 | |
650 | === modified file 'src/PanelTray.cpp' |
651 | --- src/PanelTray.cpp 2011-03-29 12:23:52 +0000 |
652 | +++ src/PanelTray.cpp 2011-04-05 17:30:38 +0000 |
653 | @@ -24,9 +24,7 @@ |
654 | PanelTray::PanelTray () |
655 | : _n_children (0), |
656 | _last_x (0), |
657 | - _last_y (0), |
658 | - _idle_add_sync_handler (0), |
659 | - _idle_remove_sync_handler (0) |
660 | + _last_y (0) |
661 | { |
662 | _settings = g_settings_new (SETTINGS_NAME); |
663 | _whitelist = g_settings_get_strv (_settings, "systray-whitelist"); |
664 | @@ -66,10 +64,7 @@ |
665 | { |
666 | if (_tray_expose_id) |
667 | g_signal_handler_disconnect (_window, _tray_expose_id); |
668 | - if (_idle_remove_sync_handler) |
669 | - g_source_remove (_idle_remove_sync_handler); |
670 | - if (_idle_add_sync_handler) |
671 | - g_source_remove (_idle_add_sync_handler); |
672 | + g_idle_remove_by_data (this); |
673 | |
674 | g_strfreev (_whitelist); |
675 | g_object_unref (_settings); |
676 | @@ -145,7 +140,7 @@ |
677 | na_tray_child_set_composited (icon, TRUE); |
678 | |
679 | self->_n_children++; |
680 | - self->_idle_add_sync_handler = g_idle_add ((GSourceFunc)IdleSync, self); |
681 | + g_idle_add ((GSourceFunc)IdleSync, self); |
682 | } |
683 | |
684 | g_debug ("TrayChild %s: %s %s %s", |
685 | @@ -164,7 +159,7 @@ |
686 | void |
687 | PanelTray::OnTrayIconRemoved (NaTrayManager *manager, NaTrayChild *child, PanelTray *self) |
688 | { |
689 | - self->_idle_remove_sync_handler = g_idle_add ((GSourceFunc)IdleSync, self); |
690 | + g_idle_add ((GSourceFunc)IdleSync, self); |
691 | self->_n_children--; |
692 | } |
693 | |
694 | |
695 | === modified file 'src/PanelTray.h' |
696 | --- src/PanelTray.h 2011-03-29 12:23:52 +0000 |
697 | +++ src/PanelTray.h 2011-04-05 17:30:38 +0000 |
698 | @@ -71,7 +71,5 @@ |
699 | int _last_y; |
700 | |
701 | gulong _tray_expose_id; |
702 | - guint _idle_add_sync_handler; |
703 | - guint _idle_remove_sync_handler; |
704 | }; |
705 | #endif |
706 | |
707 | === modified file 'src/PlacesController.cpp' |
708 | --- src/PlacesController.cpp 2011-03-24 00:35:26 +0000 |
709 | +++ src/PlacesController.cpp 2011-04-05 17:30:38 +0000 |
710 | @@ -123,6 +123,9 @@ |
711 | { |
712 | if (_visible) |
713 | return; |
714 | + |
715 | + if (PluginAdapter::Default ()->IsExpoActive () || PluginAdapter::Default ()->IsScaleActive ()) |
716 | + return; |
717 | |
718 | if (PluginAdapter::Default ()->IsScreenGrabbed ()) |
719 | { |
720 | |
721 | === modified file 'src/PlacesResultsController.cpp' |
722 | --- src/PlacesResultsController.cpp 2011-03-13 21:50:20 +0000 |
723 | +++ src/PlacesResultsController.cpp 2011-04-05 17:30:38 +0000 |
724 | @@ -36,6 +36,8 @@ |
725 | |
726 | PlacesResultsController::~PlacesResultsController () |
727 | { |
728 | + if (_make_things_look_nice_id) |
729 | + g_source_remove (_make_things_look_nice_id); |
730 | _results_view->UnReference (); |
731 | } |
732 |
+1 approve