Bug: drawing happening outside of expose-event

Stefan Gehn <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
Heya,

yesterday I looked a bit into getting gkrellm working on OS X using  
the "native" GTK+ (i.e. without X11). OS X enforces drawing to happen  
in expose-events but gkrellm does timer-based drawing.

Basically all gdk_draw_drawable() calls that have drawing_area- 
 >window set as their destination are "wrong" if called from outside  
an expose event. I have tried replacing all these calls (found them  
in chart.c, panel.c and krell.c) with calls to  
gtk_widget_queue_draw_area() or gdk_window_invalidate_rect() (not  
sure which one to use). I'm not yet sure if the behaviour is  
completely correct on OS X but gkrellm at least updates about once or  
twice per second. Before that change I had to click on the main- 
window in order to produce a proper redraw via expose-event.

As I have little knowledge about how gkrellm actually assembles its  
window-contents I'm not sure if deferring all these redraws into  
expose-events will break something in gkrellm. OTOH GTK+ itself tells  
users to only draw onto windows inside an expose-event so gkrellm  
should be fixed in that regard.

Further talk about the OS X porting work I did so far can be found at  
http://developer.imendio.com/node/135.
Drawing in GTK+ is explained in http://library.gnome.org/devel/gtk- 
tutorial/stable/x2312.html and http://library.gnome.org/devel/gdk/ 
unstable/gdk-Windows.html#gdk-window-invalidate-region, just if  
anyone is searching for docs for all this stuff :)

Bye,
Stefan aka mETz

______________________________________________
Gkrellm mailing list
[email protected]
Read archives-join-leave-set RSS feed:
http://archive.lists.netservicesgroup.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.