Merge lp:~tombeckmann/slingshot/faster-start into lp:~elementary-pantheon/slingshot/trunk

Proposed by Tom Beckmann
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~tombeckmann/slingshot/faster-start
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 69 lines (+25/-11)
1 file modified
src/SlingshotView.vala (+25/-11)
To merge this branch: bzr merge lp:~tombeckmann/slingshot/faster-start
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+170660@code.launchpad.net

Description of the change

This branch tries to speed up the start of slingshot. I removed/moved some things which could potentially lead to focus problems. However, I did not encounter any while testing.

One thing that still has to be done here is the reposition() call. I placed a temporary initial variable there, but we certainly need to connect to some signal instead.

To post a comment you must log in.

Unmerged revisions

366. By Tom Beckmann

remove benchmark stuff

365. By Tom Beckmann

fix previous commit

364. By Tom Beckmann

further improvements

363. By Tom Beckmann

Make sure we don't call set_modality when it's not needed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/SlingshotView.vala'
2--- src/SlingshotView.vala 2013-06-12 21:40:45 +0000
3+++ src/SlingshotView.vala 2013-06-20 16:19:06 +0000
4@@ -87,6 +87,8 @@
5 private int category_column_focus = 0;
6 private int category_row_focus = 0;
7
8+ private Wnck.Window? wnck_window;
9+
10 public SlingshotView () {
11
12 // Window properties
13@@ -537,26 +539,35 @@
14
15 }
16
17+ bool initial = true;
18 public void show_slingshot () {
19-
20 searchbar.text = "";
21
22- reposition ();
23- show_all ();
24- present ();
25+ if (initial) {
26+ reposition ();
27+ initial = false;
28+ }
29+
30+ show ();
31
32 set_focus(null);
33 searchbar.grab_focus ();
34+
35 set_modality ((Modality) view_selector.selected);
36
37- while (Gtk.events_pending ())
38- Gtk.main_iteration ();
39+ if (wnck_window == null) {
40+ while (Gtk.events_pending ())
41+ Gtk.main_iteration ();
42+ Wnck.Screen.get_default ().force_update ();
43+ var xid = Gdk.X11Window.get_xid (this.get_window ());
44+ wnck_window = Wnck.Window.get (xid);
45+ }
46
47- var xid = Gdk.X11Window.get_xid (this.get_window ());
48- var w = Wnck.Window.get (xid);
49- Wnck.Screen.get_default ().force_update ();
50- if (w != null)
51- w.activate (Gdk.x11_get_server_time (this.get_window ()));
52+ if (wnck_window != null) {
53+ // FIXME Gdk.CURRENT_TIME is faster, but may produce problems
54+ // switch back to the proper if that's the case
55+ wnck_window.activate (Gdk.CURRENT_TIME);
56+ }
57 }
58
59 private void move_page (int step) {
60@@ -611,6 +622,9 @@
61
62 private void set_modality (Modality new_modality) {
63
64+ if (modality == new_modality)
65+ return;
66+
67 modality = new_modality;
68
69 switch (modality) {

Subscribers

People subscribed via source and target branches