OK
Rating:
0.00
Thread Listing » AWN Applets
Simple applet development
#24407 by gkv311 (0.1834) posted on 10:40am Saturday, November 29th, 2008
( no avatar )
I tried to develop a VERY simple applet that just show current keyboard layout with flag-icon. I found some solutions for keyboard-state after some crazy searches, but now I have a trouble.
[Q]



On some count of icon switching, it just FREEZE (animation stopped and later switches doesn't take effect) without any error output into console.
[Q]



For applet icon setting used awn_applet_simple_set_temp_icon() or awn_applet_simple_set_icon() functions. Please, any help are welcome :))
[Q]




source you'll find here:
http://www.sview.ru/node/53
[Q]



0.2.6 release used from Ubuntu 8.10 AMD64 repositories.
[Q]



P.S.: sorry if I chose wrong forum tree.
[Q]



*Edited at 10:42am, 11/29/08
Score: 0 points
Any particular reason?
#24416 by moonbeam (1.0000) posted on 10:18am Sunday, November 30th, 2008
( no avatar )
ah... a C applet :-)
[Q]



I'll try and find time tonight or tomorrow to look it over.
[Q]
Score: 0 points
Any particular reason?
#24417 by moonbeam (1.0000) posted on 10:28am Sunday, November 30th, 2008
( no avatar )
The first question that springs to mind is whether the thread is needed? I assume you've determined the answer is yes... but it's always best to ask
[Q]
Score: 0 points
Any particular reason?
#24418 by moonbeam (1.0000) posted on 10:31am Sunday, November 30th, 2008
( no avatar )
gkv311 said:
For applet icon setting used awn_applet_simple_set_temp_icon() or awn_applet_simple_set_icon() functions. Please, any help are welcome :))
[Q]



either is ok. The existence of the two variations is a bit of historical oddity.
[Q]



awn_applet_simple_set_temp_icon() will take care of unrefing the icon sent as an arg and awn_applet_simple_set_icon() will not.
[Q]



At some point in time the temp version will disappear. I'd expect with the 0.4 release.
[Q]
Score: 0 points
Any particular reason?
#24419 by moonbeam (1.0000) posted on 10:33am Sunday, November 30th, 2008
( no avatar )
gkv311 said:
On some count of icon switching, it just FREEZE (animation stopped and later switches doesn't take effect) without any error output into console.
[Q]




If you don't create the thread does it still freeze does it still end up freezing? I know it'll stop switching the keyboard layout but I'm just wondering if the basic animation functions.
[Q]
Score: 0 points
Any particular reason?
#24420 by gkv311 (0.1834) posted on 1:26pm Sunday, November 30th, 2008
( no avatar )
moonbeam said:
<br />If you don't create the thread does it still freeze does it still end up freezing? I know it'll stop switching the keyboard layout but I'm just wondering if the basic animation functions.
[Q]



It is very difficult to test it, cause without thread application become too statical (just mouse clicks). But totally can say yes, before thread were added no freezes become (on my memory).
[Q]



I think about mutexes for sync, but have no idea where to put them, cause code froze not in my code (it still worked - print debug messages) but somewhere in awn set icon function. And belive that calls are thread save (for awn)
[Q]



*Edited at 1:42pm, 11/30/08
Score: 0 points
Any particular reason?
#24504 by Moses (0.4826) posted on 10:05am Sunday, December 21st, 2008
X/GLib/GTK and threads are a bit tricky.
[Q]



You will need to call gtk_threads_init() before entering the main loop to be able to use them at all (to my knowledge that is). In the working thread, before making any GTK calls, you will need to call gtk_threads_enter(), and after having finished gtk_threads_leave().
[Q]



My suggestion is to avoid GUI calls in threads, and instead emit a signal using gobject_idle_add().
[Q]

Score: 0 points
Any particular reason?
Thread Listing » AWN Applets » Simple applet development

Post A Reply:

Anonymous posting has been disabled. Please register first before attempting to post.
Powered by Metaforum ©2004-2010
Get your own Free AJAX Forum Messageboard by visiting the offical site.
.