View Single Post
Old 11-14-2008, 11:07 PM   #45
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
I just found a flickering probelm, which might has something to do with pthread.
I wrote a viewer to display image contained in GtkViewport. If the image is larger than screen, the viewport will be scrollable. In the meantime, a pthread is created to load next image in background. The pthread routine is simple. It just loads a image file to GdkPixbuf , no GUI is affected.
The problem is:
when I scroll viewport, the screen will refresh two times in a second, even thoug the first refresh has already displayed a correct image. That is, the second refresh is redundant.
If I disable preload next image, no flicker will occur.
Besides, flickering only occurs when scrolling viewport. There is no flickering when switching between image files.
I am not sure if it's caused by xepdmgr or by GTK+.

Added:
It seems that the first refresh only display the intermediate, not the final position. For example, the viewport is designed to display the right most part of a image file, then scroll to display the left most part. Sometimes, the first refresh display the part between rightmost and leftmost. But, most of the time, the first refresh already scroll to the left most part.

Added Part 2:
Sorry to make things confusing. I made some mistake. Flickering occurred between shifting from one image to another image, not when scrolling viewport within a image.

Last edited by ericshliao; 11-15-2008 at 06:20 AM.
ericshliao is offline   Reply With Quote