screen flicker problem when moving graphics

The screen in my app draws correctly, and stays drawn as expected; however, when I attempt to move graphics on the screen, I starts to flicker in an annoying way.

The default drawing mode in the application I am writing software for is COPY, which is where the flicker occurs. If I change the default drawing mode to OR, then the flicker stops, but of course with the OR mode it draws an image and leaves it there, so when I move the cursor it leaves a permanent trace of the object being moved.

Does anyone have any suggestions as to why I am experiencing this problem? We have some people who use the application all complain that the flicker causes fatigue, and so are trying to remove this problem.

Here is a stack trace,

No symbol table info available.
(gdb) info local
No symbol table info available.
(gdb) backtrace
#0 0x00b5d402 in __kernel_vsyscall ()
#1 0x00733243 in poll () from /lib/libc.so.6
#2 0x0328b9ca in XtAddTimeOut () from /usr/lib/libXt.so.6
#3 0x0328bf05 in _XtWaitForSomething () from /usr/lib/libXt.so.6
#4 0x0328cfcf in XtAppNextEvent () from /usr/lib/libXt.so.6
#5 0x001846f8 in xvtxi_wait_for_next_event () at /mnt/hgfs/vista/xvtdsp55/linux_x86/src/ptk/xm/xQueue.c:175
#6 0x001abdd5 in xvtk_app_create (argc=1, argv=0xbfccf2b4, flags=0, task_eh=0x8ca3f76 , config_p=0xbfccea88) at /mnt/hgfs/vista/xvtdsp55/linux_x86/src/ptk/xm/xmInit.c:211
#7 0x08daa396 in xvt_app_create (argc=1, argv=0xbfccf2b4, flags=0, eh=0x8ca3f76 , config=0xbfccea88) at /mnt/hgfs/vista/xvtdsp55/linux_x86/src/ptk/tapp.c:103
#8 0x08ca5b75 in CApplication::Go (this=0x9078ae0, argc=1, argv=0xbfccf2b4, theMenuBarId=1000, theAboutBoxId=2002, theBaseName=0x8dcd1ea "vistawin", theApplicationName=0xbfccf000 "Seismic Processing 2D/3D", theTaskTitle=0xbfccef06 "Seismic Processing 2D/3D Project:") at capplctn.cpp:156
#9 0x0805895c in main (argc=1, argv=0xbfccf2b4) at vistawin.cpp:572

Please note that sometimes when when I try to set breakpoints in the application, it causes the whole X server to lock up.

Do anyone have any suggestions?

TIA,

Roger


roger.moore

roger.moore's picture

Re: screen flicker problem when moving graphics

Please note that the flicker problem was in our code--it wasn't X11 or motif's problem.

As for the lockup with breakpoints in gdb, I still haven't figured that out yet--I will probably look into testing using Xnest or Xephyr to see if that gets around the problem.


fredk

fredk's picture

Re: screen flicker problem when moving graphics

Draw into an offscreen pixmap, then use XCopyArea to copy the pixmap to the window.

Also, each time you get a motion event, check the event queue to see if there are any other motion events already queued up. If so, ignore all but the latest event.

--
Fred K