12 12 2007

Sunday morning, 7.30am. Should really be in bed still but have had problems with sleeping in lately. That’s good and bad I guess. The good is that I have more time, The bad is.. uhm… Well, I’m sure there’s something bad with not sleeping enough.

Good to see that Michael Meeks is on the case of optimizing as well.

With regards to performance, I don’t think it’s ever possible to optimize to the point where AB pops up within a second without changing the way it works. At the moment, it will make a call to gtk_widget_show_all which is the most expensive operation in the code. Even if some optimization can be done, the time it takes to show AB will always depend on how many .desktop files you have.

The way to get around that would be to show the window with only the number of apps that are visible, then once it’s shown, add the rest of the apps.

I’ve been experimenting with it, using a loop like this;

void ui_itterator(GtkWidget *wid, gpointer unused)


      if (GTK_IS_CONTAINER(wid)) {


            while (gtk_events_pending())


            gtk_container_foreach(GTK_CONTAINER(wid), ui_itterator, NULL);

}      gtk_widget_show(wid);

      while (gtk_events_pending())



No need to start laughing! It’s only an experiment to see how it works 🙂 I need to spend more time with it and figure out how to show all widgets but the apps, calculate how many apps that will fit in the visible window space, then loop through to show them.

I don’t know if this is the best approach but something like this is needed for sure. Looking at Nautilus, it will show the window with nothing in it until it fetched all files so I hope I’m on the right track here.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: