|
|
| Author |
Message |
|
|
realistik
Joined: 17 Mar 2010 Posts: 4
|
Posted: Wed Mar 17, 2010 9:17 pm Post subject: The case of the disappearing tray icon |
|
|
Hi everybody. A few months back I wrote a C#/Gtk# app to automatically change my desktop background in Xfce 4.6. A couple of days after that I wrote the same app with C/Gtk+. I'm running Xubuntu 9.10 x86 and have my panel set to autohide. My app is accessible via a tray icon, however, when I bring up my panel from autohide, my tray icon is rarely visible, at least immediately, even though the app is running. I was wondering if this is a commonly-known problem where I just didn't write enough code or something.
It appears I can't post a link to my source without having posted at least 2 messages... |
|
| Back to top |
|
 |
realistik
Joined: 17 Mar 2010 Posts: 4
|
Posted: Wed Mar 17, 2010 9:18 pm Post subject: Second post |
|
|
| Sorry to do this in this manner... |
|
| Back to top |
|
 |
realistik
Joined: 17 Mar 2010 Posts: 4
|
Posted: Wed Mar 17, 2010 9:19 pm Post subject: The source code |
|
|
| My source is available at Google Code. |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Fri Mar 19, 2010 11:39 pm Post subject: |
|
|
Hello and welcome to the GTK+ forums.
Looking at your code and wp_switch() function, I get a feeling that using fork() and execlp() is causing you troubles, since application "flow" doesn't return to main loop as soon as possible. Idling in main loop is needed in order to give GTK+ time to process all of the events.
Try using GLib provided utility function in form of g_spawn_*() family of functions to do what you want. And if spawned command will not return relatively fast, I would strongly encourage you to use _async() family, since this will make your application respond as expected.
I'm not familiar with XFCE much, so I cannot guarantee that this will work, but replacing all of your fork() related stuff with g_spawn_async() call should do the trick. Post back if you need more help.
Tadej |
|
| Back to top |
|
 |
realistik
Joined: 17 Mar 2010 Posts: 4
|
Posted: Sat Mar 20, 2010 8:03 pm Post subject: Thanks! |
|
|
| Thanks for the tip! I have done very little programming on Linux in general, and even less for GUI. Sounds like I need to go do some studying on GLib. :) |
|
| Back to top |
|
 |
|