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
=== modified file 'src/SlingshotView.vala'
--- src/SlingshotView.vala 2013-06-12 21:40:45 +0000
+++ src/SlingshotView.vala 2013-06-20 16:19:06 +0000
@@ -87,6 +87,8 @@
87 private int category_column_focus = 0;87 private int category_column_focus = 0;
88 private int category_row_focus = 0;88 private int category_row_focus = 0;
8989
90 private Wnck.Window? wnck_window;
91
90 public SlingshotView () {92 public SlingshotView () {
9193
92 // Window properties94 // Window properties
@@ -537,26 +539,35 @@
537539
538 }540 }
539541
542 bool initial = true;
540 public void show_slingshot () {543 public void show_slingshot () {
541
542 searchbar.text = "";544 searchbar.text = "";
543545
544 reposition ();546 if (initial) {
545 show_all ();547 reposition ();
546 present ();548 initial = false;
549 }
550
551 show ();
547552
548 set_focus(null);553 set_focus(null);
549 searchbar.grab_focus ();554 searchbar.grab_focus ();
555
550 set_modality ((Modality) view_selector.selected);556 set_modality ((Modality) view_selector.selected);
551557
552 while (Gtk.events_pending ())558 if (wnck_window == null) {
553 Gtk.main_iteration ();559 while (Gtk.events_pending ())
560 Gtk.main_iteration ();
561 Wnck.Screen.get_default ().force_update ();
562 var xid = Gdk.X11Window.get_xid (this.get_window ());
563 wnck_window = Wnck.Window.get (xid);
564 }
554565
555 var xid = Gdk.X11Window.get_xid (this.get_window ());566 if (wnck_window != null) {
556 var w = Wnck.Window.get (xid);567 // FIXME Gdk.CURRENT_TIME is faster, but may produce problems
557 Wnck.Screen.get_default ().force_update ();568 // switch back to the proper if that's the case
558 if (w != null)569 wnck_window.activate (Gdk.CURRENT_TIME);
559 w.activate (Gdk.x11_get_server_time (this.get_window ()));570 }
560 }571 }
561572
562 private void move_page (int step) {573 private void move_page (int step) {
@@ -611,6 +622,9 @@
611622
612 private void set_modality (Modality new_modality) {623 private void set_modality (Modality new_modality) {
613624
625 if (modality == new_modality)
626 return;
627
614 modality = new_modality;628 modality = new_modality;
615629
616 switch (modality) {630 switch (modality) {

Subscribers

People subscribed via source and target branches