Merge lp:~unity-team/unity/unity.sprint-fixes into lp:unity
- unity.sprint-fixes
- Merge into trunk
Proposed by
Gord Allott
Status: | Superseded |
---|---|
Proposed branch: | lp:~unity-team/unity/unity.sprint-fixes |
Merge into: | lp:unity |
Diff against target: |
676 lines (+198/-161) (has conflicts) 9 files modified
targets/mutter/expose-manager.vala (+3/-47) targets/mutter/plugin.vala (+1/-32) unity-private/launcher/application-controller.vala (+62/-39) unity-private/launcher/launcher-child.vala (+10/-0) unity-private/launcher/quicklist-controller.vala (+8/-1) unity-private/launcher/scroller-controller.vala (+71/-39) unity-private/launcher/scroller-view.vala (+32/-2) unity-private/launcher/scrollerchild-controller.vala (+3/-0) unity/icon-postprocessor.vala (+8/-1) Text conflict in unity-private/launcher/application-controller.vala |
To merge this branch: | bzr merge lp:~unity-team/unity/unity.sprint-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+30617@code.launchpad.net |
This proposal has been superseded by a proposal from 2010-07-22.
Commit message
Description of the change
bunch of fixes from the sprint
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 'targets/mutter/expose-manager.vala' | |||
2 | --- targets/mutter/expose-manager.vala 2010-07-19 09:12:30 +0000 | |||
3 | +++ targets/mutter/expose-manager.vala 2010-07-22 14:56:07 +0000 | |||
4 | @@ -48,7 +48,7 @@ | |||
5 | 48 | unhovered_opacity = 255; | 48 | unhovered_opacity = 255; |
6 | 49 | 49 | ||
7 | 50 | this.source = source; | 50 | this.source = source; |
9 | 51 | 51 | ||
10 | 52 | if (source is Mutter.Window) | 52 | if (source is Mutter.Window) |
11 | 53 | clone = new Clutter.Clone ((source as Mutter.Window).get_texture ()); | 53 | clone = new Clutter.Clone ((source as Mutter.Window).get_texture ()); |
12 | 54 | else | 54 | else |
13 | @@ -117,7 +117,6 @@ | |||
14 | 117 | 117 | ||
15 | 118 | private ExposeClone? last_selected_clone = null; | 118 | private ExposeClone? last_selected_clone = null; |
16 | 119 | 119 | ||
17 | 120 | private bool menu_in_hover_close_state = false; | ||
18 | 121 | 120 | ||
19 | 122 | public ExposeManager (Plugin plugin, Launcher.Launcher launcher) | 121 | public ExposeManager (Plugin plugin, Launcher.Launcher launcher) |
20 | 123 | { | 122 | { |
21 | @@ -137,12 +136,6 @@ | |||
22 | 137 | 136 | ||
23 | 138 | public void start_expose (SList<Clutter.Actor> windows) | 137 | public void start_expose (SList<Clutter.Actor> windows) |
24 | 139 | { | 138 | { |
25 | 140 | var controller = Launcher.QuicklistController.get_current_menu (); | ||
26 | 141 | if (controller.is_menu_open ()) | ||
27 | 142 | { | ||
28 | 143 | controller.get_view ().destroy.connect (this.end_expose); | ||
29 | 144 | this.menu_in_hover_close_state = controller.get_view ().get_close_on_leave (); | ||
30 | 145 | } | ||
31 | 146 | exposed_windows = new List<ExposeClone> (); | 139 | exposed_windows = new List<ExposeClone> (); |
32 | 147 | 140 | ||
33 | 148 | if (expose_group != null) | 141 | if (expose_group != null) |
34 | @@ -175,26 +168,6 @@ | |||
35 | 175 | clone.unhovered_opacity = unhovered_opacity; | 168 | clone.unhovered_opacity = unhovered_opacity; |
36 | 176 | clone.opacity = unhovered_opacity; | 169 | clone.opacity = unhovered_opacity; |
37 | 177 | clone.darken = darken; | 170 | clone.darken = darken; |
38 | 178 | |||
39 | 179 | clone.enter_event.connect (() => { | ||
40 | 180 | var ql_controller = Launcher.QuicklistController.get_current_menu (); | ||
41 | 181 | if (ql_controller.state == Launcher.QuicklistControllerState.MENU | ||
42 | 182 | && this.menu_in_hover_close_state) | ||
43 | 183 | { | ||
44 | 184 | ql_controller.get_view ().set_close_on_leave (false); | ||
45 | 185 | } | ||
46 | 186 | return false; | ||
47 | 187 | }); | ||
48 | 188 | |||
49 | 189 | clone.leave_event.connect (() => { | ||
50 | 190 | var ql_controller = Launcher.QuicklistController.get_current_menu (); | ||
51 | 191 | if (ql_controller.state == Launcher.QuicklistControllerState.MENU | ||
52 | 192 | && this.menu_in_hover_close_state) | ||
53 | 193 | { | ||
54 | 194 | ql_controller.get_view ().set_close_on_leave (true); | ||
55 | 195 | } | ||
56 | 196 | return false; | ||
57 | 197 | }); | ||
58 | 198 | } | 171 | } |
59 | 199 | 172 | ||
60 | 200 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); | 173 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); |
61 | @@ -223,13 +196,6 @@ | |||
62 | 223 | { | 196 | { |
63 | 224 | if (!expose_showing) | 197 | if (!expose_showing) |
64 | 225 | return; | 198 | return; |
65 | 226 | |||
66 | 227 | var controller = Launcher.QuicklistController.get_current_menu (); | ||
67 | 228 | if (controller.is_menu_open ()) | ||
68 | 229 | { | ||
69 | 230 | controller.get_view ().destroy.disconnect (this.end_expose); | ||
70 | 231 | controller.state = Launcher.QuicklistControllerState.CLOSED; | ||
71 | 232 | } | ||
72 | 233 | 199 | ||
73 | 234 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); | 200 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); |
74 | 235 | foreach (Mutter.Window window in mutter_windows) | 201 | foreach (Mutter.Window window in mutter_windows) |
75 | @@ -524,23 +490,13 @@ | |||
76 | 524 | if (event.type == Clutter.EventType.ENTER || event.type == Clutter.EventType.LEAVE) | 490 | if (event.type == Clutter.EventType.ENTER || event.type == Clutter.EventType.LEAVE) |
77 | 525 | return false; | 491 | return false; |
78 | 526 | 492 | ||
79 | 527 | bool event_over_menu = false; | ||
80 | 528 | 493 | ||
81 | 529 | float x, y; | 494 | float x, y; |
82 | 530 | event.get_coords (out x, out y); | 495 | event.get_coords (out x, out y); |
83 | 531 | 496 | ||
84 | 532 | unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y); | 497 | unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y); |
85 | 533 | 498 | ||
96 | 534 | Clutter.Actor? menu = null; | 499 | if (event.type == Clutter.EventType.BUTTON_PRESS) |
87 | 535 | if (Unity.Launcher.QuicklistController.get_current_menu ().is_menu_open ()) | ||
88 | 536 | menu = Unity.Launcher.QuicklistController.get_current_menu ().get_view (); | ||
89 | 537 | if (menu != null) | ||
90 | 538 | { | ||
91 | 539 | if (x > menu.x && x < menu.x + menu.width && y > menu.y && y < menu.y + menu.height) | ||
92 | 540 | event_over_menu = true; | ||
93 | 541 | } | ||
94 | 542 | |||
95 | 543 | if (event.type == Clutter.EventType.BUTTON_PRESS && !event_over_menu) | ||
97 | 544 | pick_window (event, actor); | 500 | pick_window (event, actor); |
98 | 545 | 501 | ||
99 | 546 | if (coverflow) | 502 | if (coverflow) |
100 | @@ -548,7 +504,7 @@ | |||
101 | 548 | else | 504 | else |
102 | 549 | handle_event_expose (event, actor); | 505 | handle_event_expose (event, actor); |
103 | 550 | 506 | ||
105 | 551 | return !event_over_menu; | 507 | return true; |
106 | 552 | } | 508 | } |
107 | 553 | } | 509 | } |
108 | 554 | } | 510 | } |
109 | 555 | 511 | ||
110 | === modified file 'targets/mutter/plugin.vala' | |||
111 | --- targets/mutter/plugin.vala 2010-07-16 08:43:18 +0000 | |||
112 | +++ targets/mutter/plugin.vala 2010-07-22 14:56:07 +0000 | |||
113 | @@ -308,7 +308,6 @@ | |||
114 | 308 | 308 | ||
115 | 309 | private void on_focus_window_fullscreen_changed () | 309 | private void on_focus_window_fullscreen_changed () |
116 | 310 | { | 310 | { |
117 | 311 | warning ("FOCUS WINDOW FULLSCREEN CHANGED"); | ||
118 | 312 | check_fullscreen_obstruction (); | 311 | check_fullscreen_obstruction (); |
119 | 313 | } | 312 | } |
120 | 314 | 313 | ||
121 | @@ -466,32 +465,6 @@ | |||
122 | 466 | /* | 465 | /* |
123 | 467 | * SHELL IMPLEMENTATION | 466 | * SHELL IMPLEMENTATION |
124 | 468 | */ | 467 | */ |
125 | 469 | |||
126 | 470 | /* | ||
127 | 471 | public void show_window_picker () | ||
128 | 472 | { | ||
129 | 473 | this.show_unity (); | ||
130 | 474 | return; | ||
131 | 475 | } | ||
132 | 476 | |||
133 | 477 | if (expose_manager.expose_showing == true) | ||
134 | 478 | { | ||
135 | 479 | this.dexpose_windows (); | ||
136 | 480 | return; | ||
137 | 481 | } | ||
138 | 482 | |||
139 | 483 | GLib.SList <Clutter.Actor> windows = null; | ||
140 | 484 | |||
141 | 485 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); | ||
142 | 486 | foreach (Mutter.Window window in mutter_windows) | ||
143 | 487 | { | ||
144 | 488 | windows.append (window as Clutter.Actor); | ||
145 | 489 | } | ||
146 | 490 | |||
147 | 491 | this.expose_windows (windows, 80); | ||
148 | 492 | } | ||
149 | 493 | */ | ||
150 | 494 | |||
151 | 495 | public Clutter.Stage get_stage () | 468 | public Clutter.Stage get_stage () |
152 | 496 | { | 469 | { |
153 | 497 | return this.stage; | 470 | return this.stage; |
154 | @@ -539,7 +512,7 @@ | |||
155 | 539 | 512 | ||
156 | 540 | public void stop_expose () | 513 | public void stop_expose () |
157 | 541 | { | 514 | { |
159 | 542 | dexpose_windows (); | 515 | expose_manager.end_expose (); |
160 | 543 | } | 516 | } |
161 | 544 | 517 | ||
162 | 545 | public void show_window (uint32 xid) | 518 | public void show_window (uint32 xid) |
163 | @@ -585,10 +558,6 @@ | |||
164 | 585 | expose_manager.start_expose (windows); | 558 | expose_manager.start_expose (windows); |
165 | 586 | } | 559 | } |
166 | 587 | 560 | ||
167 | 588 | public void dexpose_windows () | ||
168 | 589 | { | ||
169 | 590 | expose_manager.end_expose (); | ||
170 | 591 | } | ||
171 | 592 | 561 | ||
172 | 593 | public void hide_unity () | 562 | public void hide_unity () |
173 | 594 | { | 563 | { |
174 | 595 | 564 | ||
175 | === modified file 'unity-private/launcher/application-controller.vala' | |||
176 | --- unity-private/launcher/application-controller.vala 2010-07-22 09:06:10 +0000 | |||
177 | +++ unity-private/launcher/application-controller.vala 2010-07-22 14:56:07 +0000 | |||
178 | @@ -63,20 +63,12 @@ | |||
179 | 63 | favorites.favorite_added.connect (on_favorite_added); | 63 | favorites.favorite_added.connect (on_favorite_added); |
180 | 64 | favorites.favorite_removed.connect (on_favorite_removed); | 64 | favorites.favorite_removed.connect (on_favorite_removed); |
181 | 65 | 65 | ||
184 | 66 | // we need to figure out if we are a favorite | 66 | // we need to figure out if we are a favoritem |
185 | 67 | is_favorite = true; | 67 | |
186 | 68 | is_favorite = is_sticky (); | ||
187 | 68 | child.pin_type = PinType.UNPINNED; | 69 | child.pin_type = PinType.UNPINNED; |
199 | 69 | foreach (string uid in favorites.get_favorites ()) | 70 | if (is_sticky ()) |
200 | 70 | { | 71 | child.pin_type = PinType.PINNED; |
190 | 71 | if (favorites.get_string (uid, "desktop_file") == desktop_file) | ||
191 | 72 | { | ||
192 | 73 | is_favorite = true; | ||
193 | 74 | child.pin_type = PinType.PINNED; | ||
194 | 75 | break; | ||
195 | 76 | } | ||
196 | 77 | } | ||
197 | 78 | |||
198 | 79 | notify["menu"].connect (on_notify_menu); | ||
201 | 80 | } | 72 | } |
202 | 81 | 73 | ||
203 | 82 | public override QuicklistController get_menu_controller () | 74 | public override QuicklistController get_menu_controller () |
204 | @@ -85,28 +77,19 @@ | |||
205 | 85 | return new_menu; | 77 | return new_menu; |
206 | 86 | } | 78 | } |
207 | 87 | 79 | ||
208 | 88 | private void on_notify_menu () | ||
209 | 89 | { | ||
210 | 90 | menu.notify["state"].connect (() => { | ||
211 | 91 | if (menu.state == QuicklistControllerState.MENU) | ||
212 | 92 | { | ||
213 | 93 | Unity.global_shell.expose_xids (app.get_xids ()); | ||
214 | 94 | } | ||
215 | 95 | else | ||
216 | 96 | { | ||
217 | 97 | Unity.global_shell.stop_expose (); | ||
218 | 98 | } | ||
219 | 99 | }); | ||
220 | 100 | } | ||
221 | 101 | |||
222 | 102 | public void set_sticky (bool is_sticky = true) | 80 | public void set_sticky (bool is_sticky = true) |
223 | 103 | { | 81 | { |
224 | 104 | if (desktop_file == "" || desktop_file == null) | 82 | if (desktop_file == "" || desktop_file == null) |
225 | 105 | return; | 83 | return; |
227 | 106 | //string uid = "app-" + Path.get_basename (desktop_file); | 84 | |
228 | 107 | var favorites = Unity.Favorites.get_default (); | 85 | var favorites = Unity.Favorites.get_default (); |
229 | 108 | 86 | ||
230 | 109 | string uid = favorites.find_uid_for_desktop_file (desktop_file); | 87 | string uid = favorites.find_uid_for_desktop_file (desktop_file); |
231 | 88 | if (uid == "" || uid == null) | ||
232 | 89 | { | ||
233 | 90 | var filepath = desktop_file.split ("/"); | ||
234 | 91 | uid = "app-" + filepath[filepath.length - 1]; | ||
235 | 92 | } | ||
236 | 110 | 93 | ||
237 | 111 | if (is_sticky) | 94 | if (is_sticky) |
238 | 112 | { | 95 | { |
239 | @@ -127,10 +110,10 @@ | |||
240 | 127 | 110 | ||
241 | 128 | var favorites = Unity.Favorites.get_default (); | 111 | var favorites = Unity.Favorites.get_default (); |
242 | 129 | string uid = favorites.find_uid_for_desktop_file (desktop_file); | 112 | string uid = favorites.find_uid_for_desktop_file (desktop_file); |
244 | 130 | if (uid != null && uid != "") | 113 | if (uid == null || uid == "") |
245 | 114 | return false; | ||
246 | 115 | else | ||
247 | 131 | return true; | 116 | return true; |
248 | 132 | else | ||
249 | 133 | return false; | ||
250 | 134 | } | 117 | } |
251 | 135 | 118 | ||
252 | 136 | public void close_windows () | 119 | public void close_windows () |
253 | @@ -188,15 +171,17 @@ | |||
254 | 188 | } | 171 | } |
255 | 189 | } | 172 | } |
256 | 190 | 173 | ||
257 | 174 | /* | ||
258 | 175 | private get_menu_for_client (ScrollerChildController.menu_cb callback, Dbusmenu.Client client) | ||
259 | 176 | { | ||
260 | 177 | |||
261 | 178 | } | ||
262 | 179 | */ | ||
263 | 180 | |||
264 | 191 | public override void get_menu_actions (ScrollerChildController.menu_cb callback) | 181 | public override void get_menu_actions (ScrollerChildController.menu_cb callback) |
265 | 192 | { | 182 | { |
266 | 193 | 183 | ||
267 | 194 | // first check to see if we have a cached client, if we do, just re-use that | 184 | // first check to see if we have a cached client, if we do, just re-use that |
268 | 195 | if (menu_client is Dbusmenu.Client && cached_menu is Dbusmenu.Menuitem) | ||
269 | 196 | { | ||
270 | 197 | callback (cached_menu); | ||
271 | 198 | } | ||
272 | 199 | |||
273 | 200 | // check for a menu from bamf | 185 | // check for a menu from bamf |
274 | 201 | if (app is Bamf.Application) | 186 | if (app is Bamf.Application) |
275 | 202 | { | 187 | { |
276 | @@ -279,14 +264,38 @@ | |||
277 | 279 | Dbusmenu.Menuitem root = new Dbusmenu.Menuitem (); | 264 | Dbusmenu.Menuitem root = new Dbusmenu.Menuitem (); |
278 | 280 | root.set_root (true); | 265 | root.set_root (true); |
279 | 281 | 266 | ||
281 | 282 | if (desktop_file != null) | 267 | if (desktop_file != null && desktop_file != "") |
282 | 283 | { | 268 | { |
283 | 284 | Dbusmenu.Menuitem pinning_item = new Dbusmenu.Menuitem (); | 269 | Dbusmenu.Menuitem pinning_item = new Dbusmenu.Menuitem (); |
284 | 270 | <<<<<<< TREE | ||
285 | 285 | if (is_sticky ()) | 271 | if (is_sticky ()) |
286 | 286 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Remove from launcher")); | 272 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Remove from launcher")); |
287 | 273 | ======= | ||
288 | 274 | if (is_sticky () && app is Bamf.Application) | ||
289 | 275 | { | ||
290 | 276 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Keep in Launcher"); | ||
291 | 277 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_CHECK); | ||
292 | 278 | pinning_item.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED); | ||
293 | 279 | } | ||
294 | 280 | else if (is_sticky ()) | ||
295 | 281 | { | ||
296 | 282 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Remove from launcher"); | ||
297 | 283 | } | ||
298 | 284 | >>>>>>> MERGE-SOURCE | ||
299 | 287 | else | 285 | else |
300 | 286 | <<<<<<< TREE | ||
301 | 288 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Add to launcher")); | 287 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Add to launcher")); |
302 | 289 | 288 | ||
303 | 289 | ======= | ||
304 | 290 | { | ||
305 | 291 | if (app is Bamf.Application) | ||
306 | 292 | { | ||
307 | 293 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Keep in Launcher"); | ||
308 | 294 | pinning_item.property_set (Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_CHECK); | ||
309 | 295 | pinning_item.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_UNCHECKED); | ||
310 | 296 | } | ||
311 | 297 | } | ||
312 | 298 | >>>>>>> MERGE-SOURCE | ||
313 | 290 | pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true); | 299 | pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true); |
314 | 291 | pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true); | 300 | pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true); |
315 | 292 | pinning_item.item_activated.connect ((timestamp) => { | 301 | pinning_item.item_activated.connect ((timestamp) => { |
316 | @@ -299,7 +308,11 @@ | |||
317 | 299 | if (app is Bamf.Application) | 308 | if (app is Bamf.Application) |
318 | 300 | { | 309 | { |
319 | 301 | Dbusmenu.Menuitem app_item = new Dbusmenu.Menuitem (); | 310 | Dbusmenu.Menuitem app_item = new Dbusmenu.Menuitem (); |
320 | 311 | <<<<<<< TREE | ||
321 | 302 | app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Quit")); | 312 | app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Quit")); |
322 | 313 | ======= | ||
323 | 314 | app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Quit"); | ||
324 | 315 | >>>>>>> MERGE-SOURCE | ||
325 | 303 | app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true); | 316 | app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true); |
326 | 304 | app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true); | 317 | app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true); |
327 | 305 | 318 | ||
328 | @@ -317,6 +330,8 @@ | |||
329 | 317 | } | 330 | } |
330 | 318 | 331 | ||
331 | 319 | private static int order_app_windows (void* a, void* b) | 332 | private static int order_app_windows (void* a, void* b) |
332 | 333 | requires (a is Bamf.Window) | ||
333 | 334 | requires (b is Bamf.Window) | ||
334 | 320 | { | 335 | { |
335 | 321 | if ((b as Bamf.Window).last_active () > (a as Bamf.Window).last_active ()) | 336 | if ((b as Bamf.Window).last_active () > (a as Bamf.Window).last_active ()) |
336 | 322 | { | 337 | { |
337 | @@ -337,7 +352,12 @@ | |||
338 | 337 | 352 | ||
339 | 338 | if (app is Bamf.Application) | 353 | if (app is Bamf.Application) |
340 | 339 | { | 354 | { |
342 | 340 | if (app.is_running ()) | 355 | if (app.is_active ()) |
343 | 356 | { | ||
344 | 357 | Array<uint32> xids = app.get_xids (); | ||
345 | 358 | global_shell.expose_xids (xids); | ||
346 | 359 | } | ||
347 | 360 | else if (app.is_running ()) | ||
348 | 341 | { | 361 | { |
349 | 342 | unowned List<Bamf.Window> windows = app.get_windows (); | 362 | unowned List<Bamf.Window> windows = app.get_windows (); |
350 | 343 | windows.sort ((CompareFunc)order_app_windows); | 363 | windows.sort ((CompareFunc)order_app_windows); |
351 | @@ -375,7 +395,7 @@ | |||
352 | 375 | public void attach_application (Bamf.Application application) | 395 | public void attach_application (Bamf.Application application) |
353 | 376 | { | 396 | { |
354 | 377 | app = application; | 397 | app = application; |
356 | 378 | desktop_file = app.get_desktop_file (); | 398 | desktop_file = app.get_desktop_file ().dup (); |
357 | 379 | child.running = app.is_running (); | 399 | child.running = app.is_running (); |
358 | 380 | child.active = app.is_active (); | 400 | child.active = app.is_active (); |
359 | 381 | child.activating = false; | 401 | child.activating = false; |
360 | @@ -384,6 +404,9 @@ | |||
361 | 384 | app.active_changed.connect (on_app_active_changed); | 404 | app.active_changed.connect (on_app_active_changed); |
362 | 385 | app.closed.connect (detach_application); | 405 | app.closed.connect (detach_application); |
363 | 386 | app.urgent_changed.connect (on_app_urgant_changed); | 406 | app.urgent_changed.connect (on_app_urgant_changed); |
364 | 407 | app.user_visible_changed.connect ((value) => { | ||
365 | 408 | hide = !value; | ||
366 | 409 | }); | ||
367 | 387 | name = app.get_name (); | 410 | name = app.get_name (); |
368 | 388 | if (name == null || name == "") | 411 | if (name == null || name == "") |
369 | 389 | warning (@"Bamf returned null for app.get_name (): $desktop_file"); | 412 | warning (@"Bamf returned null for app.get_name (): $desktop_file"); |
370 | 390 | 413 | ||
371 | === modified file 'unity-private/launcher/launcher-child.vala' | |||
372 | --- unity-private/launcher/launcher-child.vala 2010-06-22 13:18:52 +0000 | |||
373 | +++ unity-private/launcher/launcher-child.vala 2010-07-22 14:56:07 +0000 | |||
374 | @@ -77,6 +77,16 @@ | |||
375 | 77 | rotate_timeline.new_frame.connect (on_rotate_timeline_new_frame); | 77 | rotate_timeline.new_frame.connect (on_rotate_timeline_new_frame); |
376 | 78 | 78 | ||
377 | 79 | notify["rotation"].connect (on_rotation_changed); | 79 | notify["rotation"].connect (on_rotation_changed); |
378 | 80 | notify["opacity"].connect (on_opacity_changed); | ||
379 | 81 | } | ||
380 | 82 | |||
381 | 83 | private void on_opacity_changed () | ||
382 | 84 | { | ||
383 | 85 | //debug (@"opacity changes on launcher child, set to $(opacity)"); | ||
384 | 86 | if (processed_icon is Clutter.Actor) | ||
385 | 87 | { | ||
386 | 88 | processed_icon.set_opacity (opacity); | ||
387 | 89 | } | ||
388 | 80 | } | 90 | } |
389 | 81 | 91 | ||
390 | 82 | ~LauncherChild () | 92 | ~LauncherChild () |
391 | 83 | 93 | ||
392 | === modified file 'unity-private/launcher/quicklist-controller.vala' | |||
393 | --- unity-private/launcher/quicklist-controller.vala 2010-07-16 15:50:39 +0000 | |||
394 | +++ unity-private/launcher/quicklist-controller.vala 2010-07-22 14:56:07 +0000 | |||
395 | @@ -36,6 +36,9 @@ | |||
396 | 36 | get { return _state; } | 36 | get { return _state; } |
397 | 37 | set | 37 | set |
398 | 38 | { | 38 | { |
399 | 39 | var drag_controller = Unity.Drag.Controller.get_default (); | ||
400 | 40 | if (drag_controller.is_dragging) value = QuicklistControllerState.CLOSED; | ||
401 | 41 | |||
402 | 39 | if (value == QuicklistControllerState.LABEL || | 42 | if (value == QuicklistControllerState.LABEL || |
403 | 40 | value == QuicklistControllerState.MENU) | 43 | value == QuicklistControllerState.MENU) |
404 | 41 | { | 44 | { |
405 | @@ -95,7 +98,6 @@ | |||
406 | 95 | 98 | ||
407 | 96 | } | 99 | } |
408 | 97 | 100 | ||
409 | 98 | |||
410 | 99 | public class ApplicationQuicklistController : QuicklistController | 101 | public class ApplicationQuicklistController : QuicklistController |
411 | 100 | { | 102 | { |
412 | 101 | public ApplicationQuicklistController (ScrollerChildController scroller_child) | 103 | public ApplicationQuicklistController (ScrollerChildController scroller_child) |
413 | @@ -111,6 +113,11 @@ | |||
414 | 111 | new_menu (); | 113 | new_menu (); |
415 | 112 | notify["state"].connect (on_state_change); | 114 | notify["state"].connect (on_state_change); |
416 | 113 | state = QuicklistControllerState.LABEL; | 115 | state = QuicklistControllerState.LABEL; |
417 | 116 | |||
418 | 117 | var drag_controller = Unity.Drag.Controller.get_default (); | ||
419 | 118 | drag_controller.drag_start.connect (() => { | ||
420 | 119 | state = QuicklistControllerState.CLOSED; | ||
421 | 120 | }); | ||
422 | 114 | } | 121 | } |
423 | 115 | 122 | ||
424 | 116 | private void new_menu () | 123 | private void new_menu () |
425 | 117 | 124 | ||
426 | === modified file 'unity-private/launcher/scroller-controller.vala' | |||
427 | --- unity-private/launcher/scroller-controller.vala 2010-07-15 13:19:02 +0000 | |||
428 | +++ unity-private/launcher/scroller-controller.vala 2010-07-22 14:56:07 +0000 | |||
429 | @@ -75,38 +75,34 @@ | |||
430 | 75 | { | 75 | { |
431 | 76 | Bamf.Application app = object as Bamf.Application; | 76 | Bamf.Application app = object as Bamf.Application; |
432 | 77 | // need to hook up to its visible changed signals | 77 | // need to hook up to its visible changed signals |
465 | 78 | 78 | string desktop_file = app.get_desktop_file (); | |
466 | 79 | // this is wrong as it will never re-hide a window | 79 | |
467 | 80 | app.user_visible_changed.connect ((a, changed) => { | 80 | ScrollerChildController controller = null; |
468 | 81 | if (changed) | 81 | if (desktop_file != null && desktop_file != "") |
469 | 82 | { | 82 | { |
470 | 83 | handle_bamf_view_opened (a as Object); | 83 | controller = find_controller_by_desktop_file (desktop_file); |
471 | 84 | } | 84 | } |
472 | 85 | }); | 85 | |
473 | 86 | 86 | if (controller is ApplicationController) | |
474 | 87 | if (app.user_visible ()) | 87 | { |
475 | 88 | { | 88 | (controller as ApplicationController).attach_application (app); |
476 | 89 | string desktop_file = app.get_desktop_file (); | 89 | } |
477 | 90 | 90 | else | |
478 | 91 | ScrollerChildController controller = null; | 91 | { |
479 | 92 | if (desktop_file != null && desktop_file != "") | 92 | LauncherChild child = new LauncherChild (); |
480 | 93 | { | 93 | controller = new ApplicationController (null, child); |
481 | 94 | controller = find_controller_by_desktop_file (desktop_file); | 94 | (controller as ApplicationController).attach_application (app); |
482 | 95 | } | 95 | if (app.user_visible ()) |
483 | 96 | 96 | model.add (child); | |
484 | 97 | if (controller is ApplicationController) | 97 | |
485 | 98 | { | 98 | childcontrollers.add (controller); |
486 | 99 | (controller as ApplicationController).attach_application (app); | 99 | controller.closed.connect (on_scroller_controller_closed); |
487 | 100 | } | 100 | controller.notify["hide"].connect (() => { |
488 | 101 | else | 101 | if (controller.hide && controller.child in model) |
489 | 102 | { | 102 | model.remove (controller.child); |
490 | 103 | LauncherChild child = new LauncherChild (); | 103 | if (!controller.hide && (controller.child in model) == false) |
491 | 104 | controller = new ApplicationController (null, child); | 104 | model.add (controller.child); |
492 | 105 | (controller as ApplicationController).attach_application (app); | 105 | }); |
461 | 106 | model.add (child); | ||
462 | 107 | childcontrollers.add (controller); | ||
463 | 108 | controller.closed.connect (on_scroller_controller_closed); | ||
464 | 109 | } | ||
493 | 110 | } | 106 | } |
494 | 111 | } | 107 | } |
495 | 112 | } | 108 | } |
496 | @@ -115,7 +111,7 @@ | |||
497 | 115 | { | 111 | { |
498 | 116 | if (controller is ApplicationController) | 112 | if (controller is ApplicationController) |
499 | 117 | { | 113 | { |
501 | 118 | if (controller.child.pin_type == PinType.UNPINNED) | 114 | if (!(controller as ApplicationController).is_sticky ()) |
502 | 119 | { | 115 | { |
503 | 120 | model.remove (controller.child); | 116 | model.remove (controller.child); |
504 | 121 | childcontrollers.remove (controller); | 117 | childcontrollers.remove (controller); |
505 | @@ -267,8 +263,17 @@ | |||
506 | 267 | } | 263 | } |
507 | 268 | } | 264 | } |
508 | 269 | 265 | ||
509 | 266 | float last_drag_x = 0.0f; | ||
510 | 267 | float last_drag_y = 0.0f; | ||
511 | 270 | private void on_unity_drag_motion (Drag.Model drag_model, float x, float y) | 268 | private void on_unity_drag_motion (Drag.Model drag_model, float x, float y) |
512 | 271 | { | 269 | { |
513 | 270 | if (x == last_drag_x && y == last_drag_y) | ||
514 | 271 | return; | ||
515 | 272 | |||
516 | 273 | last_drag_x = x; | ||
517 | 274 | last_drag_y = y; | ||
518 | 275 | |||
519 | 276 | |||
520 | 272 | var drag_controller = Drag.Controller.get_default (); | 277 | var drag_controller = Drag.Controller.get_default (); |
521 | 273 | // check to see if the data matches any of our children | 278 | // check to see if the data matches any of our children |
522 | 274 | if (!(drag_controller.get_drag_model () is ScrollerChildController)) | 279 | if (!(drag_controller.get_drag_model () is ScrollerChildController)) |
523 | @@ -286,13 +291,40 @@ | |||
524 | 286 | { | 291 | { |
525 | 287 | // if the actor is not in the model, add it. because its now in there! | 292 | // if the actor is not in the model, add it. because its now in there! |
526 | 288 | // find the index at this position | 293 | // find the index at this position |
530 | 289 | int model_index = view.get_model_index_at_y_pos (y); | 294 | int model_index = view.get_model_index_at_y_pos_no_anim (y, true); |
531 | 290 | if (retcont in model) | 295 | if (model_index < 0) return; |
532 | 291 | model.move (retcont, int.max (model_index, 0)); | 296 | |
533 | 297 | //we have to check to see if we would still be over the index | ||
534 | 298 | //if it was done animating | ||
535 | 299 | /* | ||
536 | 300 | GLib.Value value = Value (typeof (float)); | ||
537 | 301 | var child = model[model_index]; | ||
538 | 302 | Clutter.Animation anim = child.get_animation (); | ||
539 | 303 | if (anim is Clutter.Animation) | ||
540 | 304 | { | ||
541 | 305 | debug ("is animating"); | ||
542 | 306 | Clutter.Interval interval = anim.get_interval ("position"); | ||
543 | 307 | interval.get_final_value (value); | ||
544 | 308 | } | ||
545 | 292 | else | 309 | else |
549 | 293 | model.insert (retcont, int.max (model_index, 0)); | 310 | { |
550 | 294 | 311 | debug ("is not animating"); | |
551 | 295 | view.do_queue_redraw (); | 312 | value.set_float (y); |
552 | 313 | } | ||
553 | 314 | |||
554 | 315 | debug ("%f", Math.fabsf (value.get_float () - y)); | ||
555 | 316 | |||
556 | 317 | if (Math.fabsf (value.get_float () - y) < 48) | ||
557 | 318 | { | ||
558 | 319 | debug ("moving things"); | ||
559 | 320 | */ | ||
560 | 321 | if (retcont in model) | ||
561 | 322 | model.move (retcont, int.max (model_index, 0)); | ||
562 | 323 | else | ||
563 | 324 | model.insert (retcont, int.max (model_index, 0)); | ||
564 | 325 | |||
565 | 326 | view.do_queue_redraw (); | ||
566 | 327 | //} | ||
567 | 296 | } | 328 | } |
568 | 297 | } | 329 | } |
569 | 298 | 330 | ||
570 | 299 | 331 | ||
571 | === modified file 'unity-private/launcher/scroller-view.vala' | |||
572 | --- unity-private/launcher/scroller-view.vala 2010-07-19 13:06:02 +0000 | |||
573 | +++ unity-private/launcher/scroller-view.vala 2010-07-22 14:56:07 +0000 | |||
574 | @@ -156,7 +156,35 @@ | |||
575 | 156 | }); | 156 | }); |
576 | 157 | } | 157 | } |
577 | 158 | 158 | ||
579 | 159 | public int get_model_index_at_y_pos (float y) | 159 | public int get_model_index_at_y_pos_no_anim (float y, bool return_minus_if_fail=false) |
580 | 160 | { | ||
581 | 161 | SList<float?> positions = new SList<float?> (); | ||
582 | 162 | foreach (ScrollerChild child in model) | ||
583 | 163 | { | ||
584 | 164 | positions.append (child.position); | ||
585 | 165 | GLib.Value value = Value (typeof (float)); | ||
586 | 166 | Clutter.Animation anim = child.get_animation (); | ||
587 | 167 | if (anim is Clutter.Animation) | ||
588 | 168 | { | ||
589 | 169 | Clutter.Interval interval = anim.get_interval ("position"); | ||
590 | 170 | interval.get_final_value (value); | ||
591 | 171 | child.position = value.get_float (); | ||
592 | 172 | } | ||
593 | 173 | } | ||
594 | 174 | |||
595 | 175 | int value = get_model_index_at_y_pos (y, return_minus_if_fail); | ||
596 | 176 | |||
597 | 177 | unowned SList<float?> list = positions; | ||
598 | 178 | foreach (ScrollerChild child in model) | ||
599 | 179 | { | ||
600 | 180 | child.position = (float)list.data; | ||
601 | 181 | list = list.next; | ||
602 | 182 | } | ||
603 | 183 | |||
604 | 184 | return value; | ||
605 | 185 | } | ||
606 | 186 | |||
607 | 187 | public int get_model_index_at_y_pos (float y, bool return_minus_if_fail=false) | ||
608 | 160 | { | 188 | { |
609 | 161 | 189 | ||
610 | 162 | // trying out a different method | 190 | // trying out a different method |
611 | @@ -174,6 +202,8 @@ | |||
612 | 174 | 202 | ||
613 | 175 | if (picked_actor is ScrollerChild == false) | 203 | if (picked_actor is ScrollerChild == false) |
614 | 176 | { | 204 | { |
615 | 205 | if (return_minus_if_fail) | ||
616 | 206 | return -1; | ||
617 | 177 | // couldn't pick a single actor, return 0 | 207 | // couldn't pick a single actor, return 0 |
618 | 178 | return (y < padding.top + model[0].get_height () + spacing) ? 0 : model.size -1 ; | 208 | return (y < padding.top + model[0].get_height () + spacing) ? 0 : model.size -1 ; |
619 | 179 | } | 209 | } |
620 | @@ -660,7 +690,7 @@ | |||
621 | 660 | if (child.get_animation () is Clutter.Animation) | 690 | if (child.get_animation () is Clutter.Animation) |
622 | 661 | { | 691 | { |
623 | 662 | //GLib.Value value = GLib.Value (GLib.Type.from_name ("string")); | 692 | //GLib.Value value = GLib.Value (GLib.Type.from_name ("string")); |
625 | 663 | GLib.Value value = typeof (float); | 693 | GLib.Value value = Value (typeof (float)); |
626 | 664 | Clutter.Interval interval = child.get_animation ().get_interval ("position"); | 694 | Clutter.Interval interval = child.get_animation ().get_interval ("position"); |
627 | 665 | interval.get_final_value (value); | 695 | interval.get_final_value (value); |
628 | 666 | if (value.get_float () != transitions[index].position) | 696 | if (value.get_float () != transitions[index].position) |
629 | 667 | 697 | ||
630 | === modified file 'unity-private/launcher/scrollerchild-controller.vala' | |||
631 | --- unity-private/launcher/scrollerchild-controller.vala 2010-07-15 09:29:49 +0000 | |||
632 | +++ unity-private/launcher/scrollerchild-controller.vala 2010-07-22 14:56:07 +0000 | |||
633 | @@ -38,6 +38,8 @@ | |||
634 | 38 | public ScrollerChild child {get; construct;} | 38 | public ScrollerChild child {get; construct;} |
635 | 39 | public signal void request_removal (); //call when not needed anymore so we can unref | 39 | public signal void request_removal (); //call when not needed anymore so we can unref |
636 | 40 | public string name = "If you can read this, file a bug!!"; | 40 | public string name = "If you can read this, file a bug!!"; |
637 | 41 | public bool hide {get; set;} | ||
638 | 42 | |||
639 | 41 | 43 | ||
640 | 42 | public signal void closed (); | 44 | public signal void closed (); |
641 | 43 | 45 | ||
642 | @@ -140,6 +142,7 @@ | |||
643 | 140 | private void ensure_menu_state () | 142 | private void ensure_menu_state () |
644 | 141 | { | 143 | { |
645 | 142 | //no tooltips on drag | 144 | //no tooltips on drag |
646 | 145 | |||
647 | 143 | if (Unity.Drag.Controller.get_default ().is_dragging) return; | 146 | if (Unity.Drag.Controller.get_default ().is_dragging) return; |
648 | 144 | 147 | ||
649 | 145 | if (menu is QuicklistController == false) | 148 | if (menu is QuicklistController == false) |
650 | 146 | 149 | ||
651 | === modified file 'unity/icon-postprocessor.vala' | |||
652 | --- unity/icon-postprocessor.vala 2010-06-24 09:10:53 +0000 | |||
653 | +++ unity/icon-postprocessor.vala 2010-07-22 14:56:07 +0000 | |||
654 | @@ -254,6 +254,11 @@ | |||
655 | 254 | g_total = g_total / uint.max (total_caught_pixels, 1); | 254 | g_total = g_total / uint.max (total_caught_pixels, 1); |
656 | 255 | b_total = b_total / uint.max (total_caught_pixels, 1); | 255 | b_total = b_total / uint.max (total_caught_pixels, 1); |
657 | 256 | 256 | ||
658 | 257 | rs_total = rs_total / (width * height); | ||
659 | 258 | gs_total = gs_total / (width * height); | ||
660 | 259 | bs_total = bs_total / (width * height); | ||
661 | 260 | |||
662 | 261 | |||
663 | 257 | // get a new super saturated value based on our totals | 262 | // get a new super saturated value based on our totals |
664 | 258 | if (total_caught_pixels <= 20) | 263 | if (total_caught_pixels <= 20) |
665 | 259 | { | 264 | { |
666 | @@ -491,7 +496,9 @@ | |||
667 | 491 | } | 496 | } |
668 | 492 | }; | 497 | }; |
669 | 493 | 498 | ||
671 | 494 | uchar opacity = self.get_paint_opacity (); | 499 | uchar opacity = self.get_opacity (); |
672 | 500 | |||
673 | 501 | //debug (@"opacity is set to $opacity"); | ||
674 | 495 | 502 | ||
675 | 496 | self.bg_mat.set_color4ub (opacity, opacity, opacity, opacity); | 503 | self.bg_mat.set_color4ub (opacity, opacity, opacity, opacity); |
676 | 497 | self.bgcol_material.set_color4ub (opacity, opacity, opacity, opacity); | 504 | self.bgcol_material.set_color4ub (opacity, opacity, opacity, opacity); |