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 | 692 | 692 | ||
6 | 693 | if (sticky) | 693 | if (sticky) |
7 | 694 | { | 694 | { |
14 | 695 | bamf_view_set_sticky (view, false); | 695 | self->UnStick (); |
9 | 696 | if (bamf_view_is_closed (view)) | ||
10 | 697 | self->Remove (); | ||
11 | 698 | |||
12 | 699 | if (desktop_file && strlen (desktop_file) > 0) | ||
13 | 700 | FavoriteStore::GetDefault ()->RemoveFavorite (desktop_file); | ||
15 | 701 | } | 696 | } |
16 | 702 | else | 697 | else |
17 | 703 | { | 698 | { |
18 | 704 | 699 | ||
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 | 41 | G_CALLBACK (&DeviceLauncherSection::OnMountAdded), | 41 | G_CALLBACK (&DeviceLauncherSection::OnMountAdded), |
24 | 42 | this); | 42 | this); |
25 | 43 | 43 | ||
27 | 44 | g_idle_add ((GSourceFunc)&DeviceLauncherSection::PopulateEntries, this); | 44 | _on_device_populate_entry_id = g_idle_add ((GSourceFunc)&DeviceLauncherSection::PopulateEntries, this); |
28 | 45 | } | 45 | } |
29 | 46 | 46 | ||
30 | 47 | DeviceLauncherSection::~DeviceLauncherSection () | 47 | DeviceLauncherSection::~DeviceLauncherSection () |
31 | @@ -58,6 +58,9 @@ | |||
32 | 58 | g_signal_handler_disconnect ((gpointer) _monitor, | 58 | g_signal_handler_disconnect ((gpointer) _monitor, |
33 | 59 | _on_mount_added_handler_id); | 59 | _on_mount_added_handler_id); |
34 | 60 | 60 | ||
35 | 61 | if (_on_device_populate_entry_id) | ||
36 | 62 | g_source_remove (_on_device_populate_entry_id); | ||
37 | 63 | |||
38 | 61 | g_object_unref (_monitor); | 64 | g_object_unref (_monitor); |
39 | 62 | g_hash_table_unref (_ht); | 65 | g_hash_table_unref (_ht); |
40 | 63 | } | 66 | } |
41 | @@ -81,6 +84,8 @@ | |||
42 | 81 | } | 84 | } |
43 | 82 | 85 | ||
44 | 83 | g_list_free (volumes); | 86 | g_list_free (volumes); |
45 | 87 | |||
46 | 88 | self->_on_device_populate_entry_id = 0; | ||
47 | 84 | 89 | ||
48 | 85 | return false; | 90 | return false; |
49 | 86 | } | 91 | } |
50 | 87 | 92 | ||
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 | 56 | gulong _on_volume_added_handler_id; | 56 | gulong _on_volume_added_handler_id; |
56 | 57 | gulong _on_volume_removed_handler_id; | 57 | gulong _on_volume_removed_handler_id; |
57 | 58 | gulong _on_mount_added_handler_id; | 58 | gulong _on_mount_added_handler_id; |
58 | 59 | gulong _on_device_populate_entry_id; | ||
59 | 59 | }; | 60 | }; |
60 | 60 | 61 | ||
61 | 61 | #endif // _DEVICE_LAUNCHER_SECTION_H_ | 62 | #endif // _DEVICE_LAUNCHER_SECTION_H_ |
62 | 62 | 63 | ||
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 | 357 | _launcher_drag_delta = 0; | 357 | _launcher_drag_delta = 0; |
68 | 358 | _dnd_delta_y = 0; | 358 | _dnd_delta_y = 0; |
69 | 359 | _dnd_delta_x = 0; | 359 | _dnd_delta_x = 0; |
75 | 360 | _autoscroll_handle = 0; | 360 | |
76 | 361 | _redraw_handle = 0; | 361 | _autoscroll_handle = 0; |
77 | 362 | _start_dragicon_handle = 0; | 362 | _super_show_launcher_handle = 0; |
78 | 363 | _focus_keynav_handle = 0; | 363 | _super_hide_launcher_handle = 0; |
79 | 364 | _dnd_check_handle = 0; | 364 | _super_show_shortcuts_handle = 0; |
80 | 365 | _start_dragicon_handle = 0; | ||
81 | 366 | _focus_keynav_handle = 0; | ||
82 | 367 | _dnd_check_handle = 0; | ||
83 | 368 | _ignore_repeat_shortcut_handle = 0; | ||
84 | 369 | |||
85 | 370 | _latest_shortcut = 0; | ||
86 | 371 | _super_pressed = false; | ||
87 | 372 | _shortcuts_shown = false; | ||
88 | 365 | _floating = false; | 373 | _floating = false; |
89 | 366 | _hovered = false; | 374 | _hovered = false; |
90 | 367 | _hidden = false; | 375 | _hidden = false; |
91 | @@ -431,10 +439,23 @@ | |||
92 | 431 | g_bus_unown_name (_dbus_owner); | 439 | g_bus_unown_name (_dbus_owner); |
93 | 432 | 440 | ||
94 | 433 | if (_dnd_check_handle) | 441 | if (_dnd_check_handle) |
95 | 434 | { | ||
96 | 435 | g_source_remove (_dnd_check_handle); | 442 | g_source_remove (_dnd_check_handle); |
99 | 436 | _dnd_check_handle = 0; | 443 | if (_autoscroll_handle) |
100 | 437 | } | 444 | g_source_remove (_autoscroll_handle); |
101 | 445 | if (_focus_keynav_handle) | ||
102 | 446 | g_source_remove (_focus_keynav_handle); | ||
103 | 447 | if (_super_show_launcher_handle) | ||
104 | 448 | g_source_remove (_super_show_launcher_handle); | ||
105 | 449 | if (_super_show_shortcuts_handle) | ||
106 | 450 | g_source_remove (_super_show_shortcuts_handle); | ||
107 | 451 | if (_start_dragicon_handle) | ||
108 | 452 | g_source_remove (_start_dragicon_handle); | ||
109 | 453 | if (_ignore_repeat_shortcut_handle) | ||
110 | 454 | g_source_remove (_ignore_repeat_shortcut_handle); | ||
111 | 455 | if (_super_show_launcher_handle) | ||
112 | 456 | g_source_remove (_super_show_launcher_handle); | ||
113 | 457 | if (_super_hide_launcher_handle) | ||
114 | 458 | g_source_remove (_super_hide_launcher_handle); | ||
115 | 438 | 459 | ||
116 | 439 | // disconnect the huge number of signal-slot callbacks | 460 | // disconnect the huge number of signal-slot callbacks |
117 | 440 | if (_set_hidden_connection.connected ()) | 461 | if (_set_hidden_connection.connected ()) |
118 | @@ -502,6 +523,7 @@ | |||
119 | 502 | 523 | ||
120 | 503 | if (_on_drag_finish_connection.connected ()) | 524 | if (_on_drag_finish_connection.connected ()) |
121 | 504 | _on_drag_finish_connection.disconnect (); | 525 | _on_drag_finish_connection.disconnect (); |
122 | 526 | |||
123 | 505 | } | 527 | } |
124 | 506 | 528 | ||
125 | 507 | /* Introspection */ | 529 | /* Introspection */ |
126 | @@ -526,6 +548,7 @@ | |||
127 | 526 | gchar* fontName = NULL; | 548 | gchar* fontName = NULL; |
128 | 527 | 549 | ||
129 | 528 | double label_pos = double(_icon_size / 3.0f); | 550 | double label_pos = double(_icon_size / 3.0f); |
130 | 551 | double text_size = double(_icon_size / 4.0f); | ||
131 | 529 | double label_x = label_pos; | 552 | double label_x = label_pos; |
132 | 530 | double label_y = label_pos; | 553 | double label_y = label_pos; |
133 | 531 | double label_w = label_pos; | 554 | double label_w = label_pos; |
134 | @@ -543,7 +566,7 @@ | |||
135 | 543 | layout = pango_cairo_create_layout (cr); | 566 | layout = pango_cairo_create_layout (cr); |
136 | 544 | g_object_get (settings, "gtk-font-name", &fontName, NULL); | 567 | g_object_get (settings, "gtk-font-name", &fontName, NULL); |
137 | 545 | desc = pango_font_description_from_string (fontName); | 568 | desc = pango_font_description_from_string (fontName); |
139 | 546 | pango_font_description_set_absolute_size (desc, label_pos * PANGO_SCALE); | 569 | pango_font_description_set_absolute_size (desc, text_size * PANGO_SCALE); |
140 | 547 | pango_layout_set_font_description (layout, desc); | 570 | pango_layout_set_font_description (layout, desc); |
141 | 548 | pango_layout_set_text (layout, &label, 1); | 571 | pango_layout_set_text (layout, &label, 1); |
142 | 549 | pangoCtx = pango_layout_get_context (layout); // is not ref'ed | 572 | pangoCtx = pango_layout_get_context (layout); // is not ref'ed |
143 | @@ -652,6 +675,7 @@ | |||
144 | 652 | NULL); | 675 | NULL); |
145 | 653 | 676 | ||
146 | 654 | self->selection_change.emit (); | 677 | self->selection_change.emit (); |
147 | 678 | self->_focus_keynav_handle = 0; | ||
148 | 655 | 679 | ||
149 | 656 | return false; | 680 | return false; |
150 | 657 | } | 681 | } |
151 | @@ -1479,44 +1503,89 @@ | |||
152 | 1479 | gboolean Launcher::TapOnSuper () | 1503 | gboolean Launcher::TapOnSuper () |
153 | 1480 | { | 1504 | { |
154 | 1481 | struct timespec current; | 1505 | struct timespec current; |
155 | 1482 | bool tap_on_super; | ||
156 | 1483 | bool shortcuts_shown = false; | ||
157 | 1484 | clock_gettime (CLOCK_MONOTONIC, ¤t); | 1506 | clock_gettime (CLOCK_MONOTONIC, ¤t); |
158 | 1485 | 1507 | ||
168 | 1486 | tap_on_super = (TimeDelta (¤t, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION); | 1508 | return (TimeDelta (¤t, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION); |
160 | 1487 | |||
161 | 1488 | if (_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN)) | ||
162 | 1489 | shortcuts_shown = !tap_on_super; | ||
163 | 1490 | |||
164 | 1491 | _hover_machine->SetQuirk (LauncherHoverMachine::SHOTCUT_KEYS_VISIBLE, shortcuts_shown); | ||
165 | 1492 | |||
166 | 1493 | return tap_on_super; | ||
167 | 1494 | |||
169 | 1495 | } | 1509 | } |
170 | 1496 | 1510 | ||
171 | 1497 | /* Launcher Show/Hide logic */ | 1511 | /* Launcher Show/Hide logic */ |
172 | 1498 | 1512 | ||
173 | 1499 | void Launcher::StartKeyShowLauncher () | 1513 | void Launcher::StartKeyShowLauncher () |
174 | 1500 | { | 1514 | { |
176 | 1501 | _hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN, true); | 1515 | _super_pressed = true; |
177 | 1502 | _hide_machine->SetQuirk (LauncherHideMachine::LAST_ACTION_ACTIVATE, false); | 1516 | _hide_machine->SetQuirk (LauncherHideMachine::LAST_ACTION_ACTIVATE, false); |
183 | 1503 | QueueDraw (); | 1517 | |
184 | 1504 | SetTimeStruct (&_times[TIME_TAP_SUPER], NULL, SUPER_TAP_DURATION); | 1518 | SetTimeStruct (&_times[TIME_TAP_SUPER]); |
185 | 1505 | if (_redraw_handle > 0) | 1519 | SetTimeStruct (&_times[TIME_SUPER_PRESSED]); |
186 | 1506 | g_source_remove (_redraw_handle); | 1520 | |
187 | 1507 | _redraw_handle = g_timeout_add (SUPER_TAP_DURATION, &Launcher::DrawLauncherTimeout, this); | 1521 | if (_super_show_launcher_handle > 0) |
188 | 1522 | g_source_remove (_super_show_launcher_handle); | ||
189 | 1523 | _super_show_launcher_handle = g_timeout_add (SUPER_TAP_DURATION, &Launcher::SuperShowLauncherTimeout, this); | ||
190 | 1524 | |||
191 | 1525 | if (_super_show_shortcuts_handle > 0) | ||
192 | 1526 | g_source_remove (_super_show_shortcuts_handle); | ||
193 | 1527 | _super_show_shortcuts_handle = g_timeout_add (SHORTCUTS_SHOWN_DELAY, &Launcher::SuperShowShortcutsTimeout, this); | ||
194 | 1508 | } | 1528 | } |
195 | 1509 | 1529 | ||
196 | 1510 | void Launcher::EndKeyShowLauncher () | 1530 | void Launcher::EndKeyShowLauncher () |
197 | 1511 | { | 1531 | { |
201 | 1512 | 1532 | int remaining_time_before_hide; | |
202 | 1513 | _hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN, false); | 1533 | struct timespec current; |
203 | 1514 | _hover_machine->SetQuirk (LauncherHoverMachine::SHOTCUT_KEYS_VISIBLE, false); | 1534 | clock_gettime (CLOCK_MONOTONIC, ¤t); |
204 | 1535 | |||
205 | 1536 | _hover_machine->SetQuirk (LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, false); | ||
206 | 1537 | _super_pressed = false; | ||
207 | 1538 | _shortcuts_shown = false; | ||
208 | 1515 | QueueDraw (); | 1539 | QueueDraw (); |
213 | 1516 | 1540 | ||
214 | 1517 | // it's a tap on super | 1541 | // remove further show launcher (which can happen when we close the dash with super) |
215 | 1518 | if (TapOnSuper ()) | 1542 | if (_super_show_launcher_handle > 0) |
216 | 1519 | ubus_server_send_message (ubus_server_get_default (), UBUS_DASH_EXTERNAL_ACTIVATION, NULL); | 1543 | g_source_remove (_super_show_launcher_handle); |
217 | 1544 | if (_super_show_shortcuts_handle > 0) | ||
218 | 1545 | g_source_remove (_super_show_shortcuts_handle); | ||
219 | 1546 | |||
220 | 1547 | // it's a tap on super and we didn't use any shortcuts | ||
221 | 1548 | if (TapOnSuper () && !_latest_shortcut) | ||
222 | 1549 | ubus_server_send_message (ubus_server_get_default (), UBUS_DASH_EXTERNAL_ACTIVATION, NULL); | ||
223 | 1550 | |||
224 | 1551 | 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 | 1552 | |||
226 | 1553 | if (_super_hide_launcher_handle > 0) | ||
227 | 1554 | g_source_remove (_super_hide_launcher_handle); | ||
228 | 1555 | _super_hide_launcher_handle = g_timeout_add (remaining_time_before_hide, &Launcher::SuperHideLauncherTimeout, this); | ||
229 | 1556 | } | ||
230 | 1557 | |||
231 | 1558 | gboolean Launcher::SuperHideLauncherTimeout (gpointer data) | ||
232 | 1559 | { | ||
233 | 1560 | Launcher *self = (Launcher*) data; | ||
234 | 1561 | |||
235 | 1562 | self->_hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_SHOW, false); | ||
236 | 1563 | |||
237 | 1564 | self->_super_hide_launcher_handle = 0; | ||
238 | 1565 | return false; | ||
239 | 1566 | } | ||
240 | 1567 | |||
241 | 1568 | gboolean Launcher::SuperShowLauncherTimeout (gpointer data) | ||
242 | 1569 | { | ||
243 | 1570 | Launcher *self = (Launcher*) data; | ||
244 | 1571 | |||
245 | 1572 | self->_hide_machine->SetQuirk (LauncherHideMachine::TRIGGER_BUTTON_SHOW, true); | ||
246 | 1573 | |||
247 | 1574 | self->_super_show_launcher_handle = 0; | ||
248 | 1575 | return false; | ||
249 | 1576 | } | ||
250 | 1577 | |||
251 | 1578 | gboolean Launcher::SuperShowShortcutsTimeout (gpointer data) | ||
252 | 1579 | { | ||
253 | 1580 | Launcher *self = (Launcher*) data; | ||
254 | 1581 | |||
255 | 1582 | self->_shortcuts_shown = true; | ||
256 | 1583 | self->_hover_machine->SetQuirk (LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, true); | ||
257 | 1584 | |||
258 | 1585 | self->QueueDraw (); | ||
259 | 1586 | |||
260 | 1587 | self->_super_show_shortcuts_handle = 0; | ||
261 | 1588 | return false; | ||
262 | 1520 | } | 1589 | } |
263 | 1521 | 1590 | ||
264 | 1522 | void Launcher::OnPlaceViewShown (GVariant *data, void *val) | 1591 | void Launcher::OnPlaceViewShown (GVariant *data, void *val) |
265 | @@ -1647,14 +1716,6 @@ | |||
266 | 1647 | return _mouse_position.y; | 1716 | return _mouse_position.y; |
267 | 1648 | } | 1717 | } |
268 | 1649 | 1718 | ||
269 | 1650 | gboolean Launcher::DrawLauncherTimeout (gpointer data) | ||
270 | 1651 | { | ||
271 | 1652 | Launcher *self = (Launcher*) data; | ||
272 | 1653 | |||
273 | 1654 | self->QueueDraw (); | ||
274 | 1655 | return false; | ||
275 | 1656 | } | ||
276 | 1657 | |||
277 | 1658 | bool | 1719 | bool |
278 | 1659 | Launcher::CheckIntersectWindow (CompWindow *window) | 1720 | Launcher::CheckIntersectWindow (CompWindow *window) |
279 | 1660 | { | 1721 | { |
280 | @@ -1975,6 +2036,7 @@ | |||
281 | 1975 | } | 2036 | } |
282 | 1976 | 2037 | ||
283 | 1977 | self->EnsureAnimation (); | 2038 | self->EnsureAnimation (); |
284 | 2039 | self->_autoscroll_handle = 0; | ||
285 | 1978 | 2040 | ||
286 | 1979 | return TRUE; | 2041 | return TRUE; |
287 | 1980 | } | 2042 | } |
288 | @@ -2514,7 +2576,7 @@ | |||
289 | 2514 | geo); | 2576 | geo); |
290 | 2515 | 2577 | ||
291 | 2516 | /* draw superkey-shortcut label */ | 2578 | /* draw superkey-shortcut label */ |
293 | 2517 | if (_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN) && !TapOnSuper ()) | 2579 | if (_shortcuts_shown) |
294 | 2518 | { | 2580 | { |
295 | 2519 | guint64 shortcut = arg.icon->GetShortcut (); | 2581 | guint64 shortcut = arg.icon->GetShortcut (); |
296 | 2520 | 2582 | ||
297 | @@ -2680,8 +2742,16 @@ | |||
298 | 2680 | Launcher *self = (Launcher*) data; | 2742 | Launcher *self = (Launcher*) data; |
299 | 2681 | 2743 | ||
300 | 2682 | // if we are still waiting… | 2744 | // if we are still waiting… |
302 | 2683 | if (self->GetActionState () == ACTION_NONE) | 2745 | if (self->GetActionState () == ACTION_NONE) { |
303 | 2746 | if (self->_icon_under_mouse) | ||
304 | 2747 | { | ||
305 | 2748 | self->_icon_under_mouse->MouseLeave.emit (); | ||
306 | 2749 | self->_icon_under_mouse->_mouse_inside = false; | ||
307 | 2750 | self->_icon_under_mouse = 0; | ||
308 | 2751 | } | ||
309 | 2684 | self->StartIconDragRequest (self->GetMouseX (), self->GetMouseY ()); | 2752 | self->StartIconDragRequest (self->GetMouseX (), self->GetMouseY ()); |
310 | 2753 | } | ||
311 | 2754 | self->_start_dragicon_handle = 0; | ||
312 | 2685 | return false; | 2755 | return false; |
313 | 2686 | } | 2756 | } |
314 | 2687 | 2757 | ||
315 | @@ -2696,6 +2766,7 @@ | |||
316 | 2696 | StartIconDrag (drag_icon); | 2766 | StartIconDrag (drag_icon); |
317 | 2697 | SetActionState (ACTION_DRAG_ICON); | 2767 | SetActionState (ACTION_DRAG_ICON); |
318 | 2698 | UpdateDragWindowPosition (x, y); | 2768 | UpdateDragWindowPosition (x, y); |
319 | 2769 | EnsureAnimation (); | ||
320 | 2699 | } | 2770 | } |
321 | 2700 | } | 2771 | } |
322 | 2701 | 2772 | ||
323 | @@ -2917,26 +2988,53 @@ | |||
324 | 2917 | EnsureAnimation (); | 2988 | EnsureAnimation (); |
325 | 2918 | } | 2989 | } |
326 | 2919 | 2990 | ||
327 | 2991 | |||
328 | 2992 | gboolean | ||
329 | 2993 | Launcher::ResetRepeatShorcutTimeout (gpointer data) | ||
330 | 2994 | { | ||
331 | 2995 | Launcher *self = (Launcher*) data; | ||
332 | 2996 | |||
333 | 2997 | self->_latest_shortcut = 0; | ||
334 | 2998 | |||
335 | 2999 | self->_ignore_repeat_shortcut_handle = 0; | ||
336 | 3000 | return false; | ||
337 | 3001 | } | ||
338 | 3002 | |||
339 | 2920 | gboolean | 3003 | gboolean |
340 | 2921 | Launcher::CheckSuperShortcutPressed (unsigned int key_sym, | 3004 | Launcher::CheckSuperShortcutPressed (unsigned int key_sym, |
341 | 2922 | unsigned long key_code, | 3005 | unsigned long key_code, |
342 | 2923 | unsigned long key_state) | 3006 | unsigned long key_state) |
343 | 2924 | { | 3007 | { |
345 | 2925 | if (!_hide_machine->GetQuirk (LauncherHideMachine::TRIGGER_BUTTON_DOWN)) | 3008 | if (!_super_pressed) |
346 | 2926 | return false; | 3009 | return false; |
347 | 2927 | 3010 | ||
348 | 2928 | LauncherModel::iterator it; | 3011 | LauncherModel::iterator it; |
349 | 2929 | int i; | ||
350 | 2930 | 3012 | ||
351 | 2931 | // Shortcut to start launcher icons. Only relies on Keycode, ignore modifier | 3013 | // Shortcut to start launcher icons. Only relies on Keycode, ignore modifier |
353 | 2932 | for (it = _model->begin (), i = 0; it != _model->end (); it++, i++) | 3014 | for (it = _model->begin (); it != _model->end (); it++) |
354 | 2933 | { | 3015 | { |
355 | 2934 | if (XKeysymToKeycode (screen->dpy (), (*it)->GetShortcut ()) == key_code) | 3016 | if (XKeysymToKeycode (screen->dpy (), (*it)->GetShortcut ()) == key_code) |
356 | 2935 | { | 3017 | { |
357 | 3018 | /* | ||
358 | 3019 | * start a timeout while repressing the same shortcut will be ignored. | ||
359 | 3020 | * This is because the keypress repeat is handled by Xorg and we have no | ||
360 | 3021 | * way to know if a press is an actual press or just an automated repetition | ||
361 | 3022 | * because the button is hold down. (key release events are sent in both cases) | ||
362 | 3023 | */ | ||
363 | 3024 | if (_ignore_repeat_shortcut_handle > 0) | ||
364 | 3025 | g_source_remove (_ignore_repeat_shortcut_handle); | ||
365 | 3026 | _ignore_repeat_shortcut_handle = g_timeout_add (IGNORE_REPEAT_SHORTCUT_DURATION, &Launcher::ResetRepeatShorcutTimeout, this); | ||
366 | 3027 | |||
367 | 3028 | if (_latest_shortcut == (*it)->GetShortcut ()) | ||
368 | 3029 | return true; | ||
369 | 3030 | |||
370 | 2936 | if (g_ascii_isdigit ((gchar) (*it)->GetShortcut ()) && (key_state & ShiftMask)) | 3031 | if (g_ascii_isdigit ((gchar) (*it)->GetShortcut ()) && (key_state & ShiftMask)) |
371 | 2937 | (*it)->OpenInstance (); | 3032 | (*it)->OpenInstance (); |
372 | 2938 | else | 3033 | else |
373 | 2939 | (*it)->Activate (); | 3034 | (*it)->Activate (); |
374 | 3035 | |||
375 | 3036 | _latest_shortcut = (*it)->GetShortcut (); | ||
376 | 3037 | |||
377 | 2940 | // disable the "tap on super" check | 3038 | // disable the "tap on super" check |
378 | 2941 | _times[TIME_TAP_SUPER].tv_sec = 0; | 3039 | _times[TIME_TAP_SUPER].tv_sec = 0; |
379 | 2942 | _times[TIME_TAP_SUPER].tv_nsec = 0; | 3040 | _times[TIME_TAP_SUPER].tv_nsec = 0; |
380 | 2943 | 3041 | ||
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 | 42 | #define ANIM_DURATION_LONG 350 | 42 | #define ANIM_DURATION_LONG 350 |
386 | 43 | 43 | ||
387 | 44 | #define SUPER_TAP_DURATION 250 | 44 | #define SUPER_TAP_DURATION 250 |
388 | 45 | #define SHORTCUTS_SHOWN_DELAY 750 | ||
389 | 45 | #define START_DRAGICON_DURATION 500 | 46 | #define START_DRAGICON_DURATION 500 |
390 | 47 | #define BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION 1000 | ||
391 | 48 | |||
392 | 49 | #define IGNORE_REPEAT_SHORTCUT_DURATION 250 | ||
393 | 46 | 50 | ||
394 | 47 | #define MAX_SUPERKEY_LABELS 10 | 51 | #define MAX_SUPERKEY_LABELS 10 |
395 | 48 | 52 | ||
396 | @@ -197,6 +201,7 @@ | |||
397 | 197 | TIME_DRAG_EDGE_TOUCH, | 201 | TIME_DRAG_EDGE_TOUCH, |
398 | 198 | TIME_DRAG_OUT, | 202 | TIME_DRAG_OUT, |
399 | 199 | TIME_TAP_SUPER, | 203 | TIME_TAP_SUPER, |
400 | 204 | TIME_SUPER_PRESSED, | ||
401 | 200 | 205 | ||
402 | 201 | TIME_LAST | 206 | TIME_LAST |
403 | 202 | } LauncherActionTimes; | 207 | } LauncherActionTimes; |
404 | @@ -237,10 +242,13 @@ | |||
405 | 237 | void OnPluginStateChanged (); | 242 | void OnPluginStateChanged (); |
406 | 238 | 243 | ||
407 | 239 | static gboolean AnimationTimeout (gpointer data); | 244 | static gboolean AnimationTimeout (gpointer data); |
409 | 240 | static gboolean DrawLauncherTimeout (gpointer data); | 245 | static gboolean SuperShowLauncherTimeout (gpointer data); |
410 | 246 | static gboolean SuperHideLauncherTimeout (gpointer data); | ||
411 | 247 | static gboolean SuperShowShortcutsTimeout (gpointer data); | ||
412 | 241 | static gboolean StrutHack (gpointer data); | 248 | static gboolean StrutHack (gpointer data); |
413 | 242 | static gboolean MoveFocusToKeyNavModeTimeout (gpointer data); | 249 | static gboolean MoveFocusToKeyNavModeTimeout (gpointer data); |
414 | 243 | static gboolean StartIconDragTimeout (gpointer data); | 250 | static gboolean StartIconDragTimeout (gpointer data); |
415 | 251 | static gboolean ResetRepeatShorcutTimeout (gpointer data); | ||
416 | 244 | 252 | ||
417 | 245 | void SetMousePosition (int x, int y); | 253 | void SetMousePosition (int x, int y); |
418 | 246 | 254 | ||
419 | @@ -406,6 +414,10 @@ | |||
420 | 406 | bool _render_drag_window; | 414 | bool _render_drag_window; |
421 | 407 | bool _check_window_over_launcher; | 415 | bool _check_window_over_launcher; |
422 | 408 | 416 | ||
423 | 417 | bool _shortcuts_shown; | ||
424 | 418 | bool _super_pressed; | ||
425 | 419 | guint64 _latest_shortcut; | ||
426 | 420 | |||
427 | 409 | BacklightMode _backlight_mode; | 421 | BacklightMode _backlight_mode; |
428 | 410 | 422 | ||
429 | 411 | float _folded_angle; | 423 | float _folded_angle; |
430 | @@ -461,9 +473,12 @@ | |||
431 | 461 | 473 | ||
432 | 462 | guint _autoscroll_handle; | 474 | guint _autoscroll_handle; |
433 | 463 | guint _focus_keynav_handle; | 475 | guint _focus_keynav_handle; |
435 | 464 | guint _redraw_handle; | 476 | guint _super_show_launcher_handle; |
436 | 477 | guint _super_hide_launcher_handle; | ||
437 | 478 | guint _super_show_shortcuts_handle; | ||
438 | 465 | guint _start_dragicon_handle; | 479 | guint _start_dragicon_handle; |
439 | 466 | guint _dnd_check_handle; | 480 | guint _dnd_check_handle; |
440 | 481 | guint _ignore_repeat_shortcut_handle; | ||
441 | 467 | 482 | ||
442 | 468 | nux::Point2 _mouse_position; | 483 | nux::Point2 _mouse_position; |
443 | 469 | nux::Point2 _bfb_mouse_position; | 484 | nux::Point2 _bfb_mouse_position; |
444 | 470 | 485 | ||
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 | 25 | _quirks = DEFAULT; | 25 | _quirks = DEFAULT; |
450 | 26 | _should_hide = false; | 26 | _should_hide = false; |
451 | 27 | 27 | ||
452 | 28 | _latest_emit_should_hide = false; | ||
453 | 29 | _hide_changed_emit_handle = 0; | ||
454 | 30 | |||
455 | 28 | _hide_delay_handle = 0; | 31 | _hide_delay_handle = 0; |
456 | 29 | _hide_delay_timeout_length = 750; | 32 | _hide_delay_timeout_length = 750; |
457 | 30 | } | 33 | } |
458 | @@ -36,6 +39,11 @@ | |||
459 | 36 | g_source_remove (_hide_delay_handle); | 39 | g_source_remove (_hide_delay_handle); |
460 | 37 | _hide_delay_handle = 0; | 40 | _hide_delay_handle = 0; |
461 | 38 | } | 41 | } |
462 | 42 | if (_hide_changed_emit_handle) | ||
463 | 43 | { | ||
464 | 44 | g_source_remove (_hide_changed_emit_handle); | ||
465 | 45 | _hide_changed_emit_handle = 0; | ||
466 | 46 | } | ||
467 | 39 | } | 47 | } |
468 | 40 | 48 | ||
469 | 41 | void | 49 | void |
470 | @@ -54,7 +62,10 @@ | |||
471 | 54 | else | 62 | else |
472 | 55 | { | 63 | { |
473 | 56 | _should_hide = value; | 64 | _should_hide = value; |
475 | 57 | should_hide_changed.emit (value); | 65 | |
476 | 66 | if (_hide_changed_emit_handle) | ||
477 | 67 | g_source_remove (_hide_changed_emit_handle); | ||
478 | 68 | _hide_changed_emit_handle = g_timeout_add (0, &EmitShouldHideChanged, this); | ||
479 | 58 | } | 69 | } |
480 | 59 | } | 70 | } |
481 | 60 | 71 | ||
482 | @@ -66,7 +77,7 @@ | |||
483 | 66 | QUICKLIST_OPEN = 1 << 4, 16 #VISIBLE_REQUIRED | 77 | QUICKLIST_OPEN = 1 << 4, 16 #VISIBLE_REQUIRED |
484 | 67 | EXTERNAL_DND_ACTIVE = 1 << 5, 32 #VISIBLE_REQUIRED | 78 | EXTERNAL_DND_ACTIVE = 1 << 5, 32 #VISIBLE_REQUIRED |
485 | 68 | INTERNAL_DND_ACTIVE = 1 << 6, 64 #VISIBLE_REQUIRED | 79 | INTERNAL_DND_ACTIVE = 1 << 6, 64 #VISIBLE_REQUIRED |
487 | 69 | TRIGGER_BUTTON_DOWN = 1 << 7, 128 #VISIBLE_REQUIRED | 80 | TRIGGER_BUTTON_SHOW = 1 << 7, 128 #VISIBLE_REQUIRED |
488 | 70 | ANY_WINDOW_UNDER = 1 << 8, 256 | 81 | ANY_WINDOW_UNDER = 1 << 8, 256 |
489 | 71 | ACTIVE_WINDOW_UNDER = 1 << 9, 512 | 82 | ACTIVE_WINDOW_UNDER = 1 << 9, 512 |
490 | 72 | DND_PUSHED_OFF = 1 << 10, 1024 | 83 | DND_PUSHED_OFF = 1 << 10, 1024 |
491 | @@ -81,7 +92,7 @@ | |||
492 | 81 | */ | 92 | */ |
493 | 82 | 93 | ||
494 | 83 | #define VISIBLE_REQUIRED (QUICKLIST_OPEN | EXTERNAL_DND_ACTIVE | \ | 94 | #define VISIBLE_REQUIRED (QUICKLIST_OPEN | EXTERNAL_DND_ACTIVE | \ |
496 | 84 | INTERNAL_DND_ACTIVE | TRIGGER_BUTTON_DOWN | VERTICAL_SLIDE_ACTIVE |\ | 95 | INTERNAL_DND_ACTIVE | TRIGGER_BUTTON_SHOW | VERTICAL_SLIDE_ACTIVE |\ |
497 | 85 | KEY_NAV_ACTIVE | PLACES_VISIBLE | SCALE_ACTIVE | EXPO_ACTIVE |\ | 96 | KEY_NAV_ACTIVE | PLACES_VISIBLE | SCALE_ACTIVE | EXPO_ACTIVE |\ |
498 | 86 | MT_DRAG_OUT) | 97 | MT_DRAG_OUT) |
499 | 87 | 98 | ||
500 | @@ -160,7 +171,7 @@ | |||
501 | 160 | } | 171 | } |
502 | 161 | 172 | ||
503 | 162 | #define SKIP_DELAY_QUIRK (EXTERNAL_DND_ACTIVE | DND_PUSHED_OFF | ACTIVE_WINDOW_UNDER | \ | 173 | #define SKIP_DELAY_QUIRK (EXTERNAL_DND_ACTIVE | DND_PUSHED_OFF | ACTIVE_WINDOW_UNDER | \ |
505 | 163 | ANY_WINDOW_UNDER | EXPO_ACTIVE | SCALE_ACTIVE | MT_DRAG_OUT) | 174 | ANY_WINDOW_UNDER | EXPO_ACTIVE | SCALE_ACTIVE | MT_DRAG_OUT | TRIGGER_BUTTON_SHOW) |
506 | 164 | 175 | ||
507 | 165 | void | 176 | void |
508 | 166 | LauncherHideMachine::SetQuirk (LauncherHideMachine::HideQuirk quirk, bool active) | 177 | LauncherHideMachine::SetQuirk (LauncherHideMachine::HideQuirk quirk, bool active) |
509 | @@ -207,6 +218,21 @@ | |||
510 | 207 | return false; | 218 | return false; |
511 | 208 | } | 219 | } |
512 | 209 | 220 | ||
513 | 221 | gboolean | ||
514 | 222 | LauncherHideMachine::EmitShouldHideChanged (gpointer data) | ||
515 | 223 | { | ||
516 | 224 | LauncherHideMachine *self = static_cast<LauncherHideMachine *> (data); | ||
517 | 225 | |||
518 | 226 | self->_hide_changed_emit_handle = 0; | ||
519 | 227 | if (self->_should_hide == self->_latest_emit_should_hide) | ||
520 | 228 | return false; | ||
521 | 229 | |||
522 | 230 | self->_latest_emit_should_hide = self->_should_hide; | ||
523 | 231 | self->should_hide_changed.emit (self->_should_hide); | ||
524 | 232 | |||
525 | 233 | return false; | ||
526 | 234 | } | ||
527 | 235 | |||
528 | 210 | char* | 236 | char* |
529 | 211 | LauncherHideMachine::DebugHideQuirks () | 237 | LauncherHideMachine::DebugHideQuirks () |
530 | 212 | { | 238 | { |
531 | 213 | 239 | ||
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 | 44 | QUICKLIST_OPEN = 1 << 4, | 44 | QUICKLIST_OPEN = 1 << 4, |
537 | 45 | EXTERNAL_DND_ACTIVE = 1 << 5, | 45 | EXTERNAL_DND_ACTIVE = 1 << 5, |
538 | 46 | INTERNAL_DND_ACTIVE = 1 << 6, | 46 | INTERNAL_DND_ACTIVE = 1 << 6, |
540 | 47 | TRIGGER_BUTTON_DOWN = 1 << 7, | 47 | TRIGGER_BUTTON_SHOW = 1 << 7, |
541 | 48 | ANY_WINDOW_UNDER = 1 << 8, | 48 | ANY_WINDOW_UNDER = 1 << 8, |
542 | 49 | ACTIVE_WINDOW_UNDER = 1 << 9, | 49 | ACTIVE_WINDOW_UNDER = 1 << 9, |
543 | 50 | DND_PUSHED_OFF = 1 << 10, | 50 | DND_PUSHED_OFF = 1 << 10, |
544 | @@ -78,13 +78,16 @@ | |||
545 | 78 | void SetShouldHide (bool value, bool skip_delay); | 78 | void SetShouldHide (bool value, bool skip_delay); |
546 | 79 | 79 | ||
547 | 80 | static gboolean OnHideDelayTimeout (gpointer data); | 80 | static gboolean OnHideDelayTimeout (gpointer data); |
548 | 81 | static gboolean EmitShouldHideChanged (gpointer data); | ||
549 | 81 | 82 | ||
550 | 82 | bool _should_hide; | 83 | bool _should_hide; |
551 | 84 | bool _latest_emit_should_hide; | ||
552 | 83 | HideQuirk _quirks; | 85 | HideQuirk _quirks; |
553 | 84 | HideMode _mode; | 86 | HideMode _mode; |
554 | 85 | unsigned int _hide_delay_timeout_length; | 87 | unsigned int _hide_delay_timeout_length; |
555 | 86 | 88 | ||
556 | 87 | guint _hide_delay_handle; | 89 | guint _hide_delay_handle; |
557 | 90 | guint _hide_changed_emit_handle; | ||
558 | 88 | }; | 91 | }; |
559 | 89 | 92 | ||
560 | 90 | #endif | 93 | #endif |
561 | 91 | 94 | ||
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 | 23 | { | 23 | { |
567 | 24 | _quirks = DEFAULT; | 24 | _quirks = DEFAULT; |
568 | 25 | _should_hover = false; | 25 | _should_hover = false; |
570 | 26 | _pending_should_hover = false; // avoid building a struct in the callback | 26 | _latest_emit_should_hover = false; |
571 | 27 | _hover_changed_emit_handle = 0; | 27 | _hover_changed_emit_handle = 0; |
572 | 28 | 28 | ||
573 | 29 | } | 29 | } |
574 | @@ -42,7 +42,7 @@ | |||
575 | 42 | LAUNCHER_HIDDEN = 1 << 0, 1 | 42 | LAUNCHER_HIDDEN = 1 << 0, 1 |
576 | 43 | MOUSE_OVER_LAUNCHER = 1 << 1, 2 | 43 | MOUSE_OVER_LAUNCHER = 1 << 1, 2 |
577 | 44 | MOUSE_OVER_BFB = 1 << 2, 4 | 44 | MOUSE_OVER_BFB = 1 << 2, 4 |
579 | 45 | SHOTCUT_KEYS_VISIBLE = 1 << 3, 8 | 45 | SHORTCUT_KEYS_VISIBLE = 1 << 3, 8 |
580 | 46 | QUICKLIST_OPEN = 1 << 4, 16 | 46 | QUICKLIST_OPEN = 1 << 4, 16 |
581 | 47 | KEY_NAV_ACTIVE = 1 << 5, 32 | 47 | KEY_NAV_ACTIVE = 1 << 5, 32 |
582 | 48 | LAUNCHER_IN_ACTION = 1 << 6, 64 | 48 | LAUNCHER_IN_ACTION = 1 << 6, 64 |
583 | @@ -60,7 +60,7 @@ | |||
584 | 60 | } | 60 | } |
585 | 61 | 61 | ||
586 | 62 | if (GetQuirk ((HoverQuirk) (MOUSE_OVER_LAUNCHER | MOUSE_OVER_BFB | | 62 | if (GetQuirk ((HoverQuirk) (MOUSE_OVER_LAUNCHER | MOUSE_OVER_BFB | |
588 | 63 | SHOTCUT_KEYS_VISIBLE | KEY_NAV_ACTIVE | | 63 | SHORTCUT_KEYS_VISIBLE | KEY_NAV_ACTIVE | |
589 | 64 | QUICKLIST_OPEN | LAUNCHER_IN_ACTION))) | 64 | QUICKLIST_OPEN | LAUNCHER_IN_ACTION))) |
590 | 65 | should_hover = true; | 65 | should_hover = true; |
591 | 66 | else | 66 | else |
592 | @@ -72,11 +72,11 @@ | |||
593 | 72 | 72 | ||
594 | 73 | void | 73 | void |
595 | 74 | LauncherHoverMachine::SetShouldHover (bool value) | 74 | LauncherHoverMachine::SetShouldHover (bool value) |
597 | 75 | { | 75 | { |
598 | 76 | _should_hover = value; | ||
599 | 77 | |||
600 | 76 | if (_hover_changed_emit_handle) | 78 | if (_hover_changed_emit_handle) |
601 | 77 | g_source_remove (_hover_changed_emit_handle); | 79 | g_source_remove (_hover_changed_emit_handle); |
602 | 78 | |||
603 | 79 | _pending_should_hover = value; | ||
604 | 80 | _hover_changed_emit_handle = g_timeout_add (0, &EmitShouldHoverChanged, this); | 80 | _hover_changed_emit_handle = g_timeout_add (0, &EmitShouldHoverChanged, this); |
605 | 81 | } | 81 | } |
606 | 82 | 82 | ||
607 | @@ -84,14 +84,14 @@ | |||
608 | 84 | LauncherHoverMachine::EmitShouldHoverChanged (gpointer data) | 84 | LauncherHoverMachine::EmitShouldHoverChanged (gpointer data) |
609 | 85 | { | 85 | { |
610 | 86 | LauncherHoverMachine *self = static_cast<LauncherHoverMachine *> (data); | 86 | LauncherHoverMachine *self = static_cast<LauncherHoverMachine *> (data); |
613 | 87 | 87 | ||
614 | 88 | if (self->_should_hover == self->_pending_should_hover) | 88 | self->_hover_changed_emit_handle = 0; |
615 | 89 | if (self->_should_hover == self->_latest_emit_should_hover) | ||
616 | 89 | return false; | 90 | return false; |
617 | 90 | |||
618 | 91 | self->_should_hover = self->_pending_should_hover; | ||
619 | 92 | self->_hover_changed_emit_handle = 0; | ||
620 | 93 | 91 | ||
621 | 92 | self->_latest_emit_should_hover = self->_should_hover; | ||
622 | 94 | self->should_hover_changed.emit (self->_should_hover); | 93 | self->should_hover_changed.emit (self->_should_hover); |
623 | 94 | |||
624 | 95 | return false; | 95 | return false; |
625 | 96 | } | 96 | } |
626 | 97 | 97 | ||
627 | 98 | 98 | ||
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 | 33 | LAUNCHER_HIDDEN = 1 << 0, | 33 | LAUNCHER_HIDDEN = 1 << 0, |
633 | 34 | MOUSE_OVER_LAUNCHER = 1 << 1, | 34 | MOUSE_OVER_LAUNCHER = 1 << 1, |
634 | 35 | MOUSE_OVER_BFB = 1 << 2, | 35 | MOUSE_OVER_BFB = 1 << 2, |
636 | 36 | SHOTCUT_KEYS_VISIBLE = 1 << 3, | 36 | SHORTCUT_KEYS_VISIBLE = 1 << 3, |
637 | 37 | QUICKLIST_OPEN = 1 << 4, | 37 | QUICKLIST_OPEN = 1 << 4, |
638 | 38 | KEY_NAV_ACTIVE = 1 << 5, | 38 | KEY_NAV_ACTIVE = 1 << 5, |
639 | 39 | LAUNCHER_IN_ACTION = 1 << 6, | 39 | LAUNCHER_IN_ACTION = 1 << 6, |
640 | @@ -56,7 +56,7 @@ | |||
641 | 56 | static gboolean EmitShouldHoverChanged (gpointer data); | 56 | static gboolean EmitShouldHoverChanged (gpointer data); |
642 | 57 | 57 | ||
643 | 58 | bool _should_hover; | 58 | bool _should_hover; |
645 | 59 | bool _pending_should_hover; | 59 | bool _latest_emit_should_hover; |
646 | 60 | HoverQuirk _quirks; | 60 | HoverQuirk _quirks; |
647 | 61 | 61 | ||
648 | 62 | guint _hover_changed_emit_handle; | 62 | guint _hover_changed_emit_handle; |
649 | 63 | 63 | ||
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 | 24 | PanelTray::PanelTray () | 24 | PanelTray::PanelTray () |
655 | 25 | : _n_children (0), | 25 | : _n_children (0), |
656 | 26 | _last_x (0), | 26 | _last_x (0), |
660 | 27 | _last_y (0), | 27 | _last_y (0) |
658 | 28 | _idle_add_sync_handler (0), | ||
659 | 29 | _idle_remove_sync_handler (0) | ||
661 | 30 | { | 28 | { |
662 | 31 | _settings = g_settings_new (SETTINGS_NAME); | 29 | _settings = g_settings_new (SETTINGS_NAME); |
663 | 32 | _whitelist = g_settings_get_strv (_settings, "systray-whitelist"); | 30 | _whitelist = g_settings_get_strv (_settings, "systray-whitelist"); |
664 | @@ -66,10 +64,7 @@ | |||
665 | 66 | { | 64 | { |
666 | 67 | if (_tray_expose_id) | 65 | if (_tray_expose_id) |
667 | 68 | g_signal_handler_disconnect (_window, _tray_expose_id); | 66 | g_signal_handler_disconnect (_window, _tray_expose_id); |
672 | 69 | if (_idle_remove_sync_handler) | 67 | g_idle_remove_by_data (this); |
669 | 70 | g_source_remove (_idle_remove_sync_handler); | ||
670 | 71 | if (_idle_add_sync_handler) | ||
671 | 72 | g_source_remove (_idle_add_sync_handler); | ||
673 | 73 | 68 | ||
674 | 74 | g_strfreev (_whitelist); | 69 | g_strfreev (_whitelist); |
675 | 75 | g_object_unref (_settings); | 70 | g_object_unref (_settings); |
676 | @@ -145,7 +140,7 @@ | |||
677 | 145 | na_tray_child_set_composited (icon, TRUE); | 140 | na_tray_child_set_composited (icon, TRUE); |
678 | 146 | 141 | ||
679 | 147 | self->_n_children++; | 142 | self->_n_children++; |
681 | 148 | self->_idle_add_sync_handler = g_idle_add ((GSourceFunc)IdleSync, self); | 143 | g_idle_add ((GSourceFunc)IdleSync, self); |
682 | 149 | } | 144 | } |
683 | 150 | 145 | ||
684 | 151 | g_debug ("TrayChild %s: %s %s %s", | 146 | g_debug ("TrayChild %s: %s %s %s", |
685 | @@ -164,7 +159,7 @@ | |||
686 | 164 | void | 159 | void |
687 | 165 | PanelTray::OnTrayIconRemoved (NaTrayManager *manager, NaTrayChild *child, PanelTray *self) | 160 | PanelTray::OnTrayIconRemoved (NaTrayManager *manager, NaTrayChild *child, PanelTray *self) |
688 | 166 | { | 161 | { |
690 | 167 | self->_idle_remove_sync_handler = g_idle_add ((GSourceFunc)IdleSync, self); | 162 | g_idle_add ((GSourceFunc)IdleSync, self); |
691 | 168 | self->_n_children--; | 163 | self->_n_children--; |
692 | 169 | } | 164 | } |
693 | 170 | 165 | ||
694 | 171 | 166 | ||
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 | 71 | int _last_y; | 71 | int _last_y; |
700 | 72 | 72 | ||
701 | 73 | gulong _tray_expose_id; | 73 | gulong _tray_expose_id; |
702 | 74 | guint _idle_add_sync_handler; | ||
703 | 75 | guint _idle_remove_sync_handler; | ||
704 | 76 | }; | 74 | }; |
705 | 77 | #endif | 75 | #endif |
706 | 78 | 76 | ||
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 | 123 | { | 123 | { |
712 | 124 | if (_visible) | 124 | if (_visible) |
713 | 125 | return; | 125 | return; |
714 | 126 | |||
715 | 127 | if (PluginAdapter::Default ()->IsExpoActive () || PluginAdapter::Default ()->IsScaleActive ()) | ||
716 | 128 | return; | ||
717 | 126 | 129 | ||
718 | 127 | if (PluginAdapter::Default ()->IsScreenGrabbed ()) | 130 | if (PluginAdapter::Default ()->IsScreenGrabbed ()) |
719 | 128 | { | 131 | { |
720 | 129 | 132 | ||
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 | 36 | 36 | ||
726 | 37 | PlacesResultsController::~PlacesResultsController () | 37 | PlacesResultsController::~PlacesResultsController () |
727 | 38 | { | 38 | { |
728 | 39 | if (_make_things_look_nice_id) | ||
729 | 40 | g_source_remove (_make_things_look_nice_id); | ||
730 | 39 | _results_view->UnReference (); | 41 | _results_view->UnReference (); |
731 | 40 | } | 42 | } |
732 | 41 | 43 |
+1 approve