Updating Screen - Xwindows

This is a discussion on Updating Screen - Xwindows ; There are times when I use X Windows to draw something (e.g. string) in a Window, the screen doesn't update until after I cause another event (e.g. press a key). How can I get the screen to update following the ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Updating Screen

  1. Updating Screen

    There are times when I use X Windows to draw something (e.g. string) in
    a Window, the screen doesn't update until after I cause another event
    (e.g. press a key). How can I get the screen to update following the draw?

    Using SuSE Linux 9.3.

    Thanks
    Paul

  2. Re: Updating Screen

    On 2007-04-18, Paul Thompson wrote:
    > There are times when I use X Windows to draw something (e.g. string) in
    > a Window, the screen doesn't update until after I cause another event
    > (e.g. press a key). How can I get the screen to update following the draw?
    >
    > Using SuSE Linux 9.3.


    I probably won't know the answer, but I would guess those
    who might would need at least a code fragment in order to
    have any idea of what might solve the problem.

    --
    Robert Riches
    spamtrap42@verizon.net
    (Yes, that is one of my email addresses.)

  3. Re: Updating Screen

    In article <132ct1ssfgq5636@corp.supernews.com>, Paul Thompson writes:
    > There are times when I use X Windows to draw something (e.g. string) in
    > a Window, the screen doesn't update until after I cause another event
    > (e.g. press a key). How can I get the screen to update following the draw?


    Have you tried calling XFlush() after the draw?


    George Cook
    WVNET

  4. Re: Updating Screen

    Paul Thompson wrote:
    > There are times when I use X Windows to draw something (e.g. string) in
    > a Window, the screen doesn't update until after I cause another event
    > (e.g. press a key). How can I get the screen to update following the draw?
    >
    > Using SuSE Linux 9.3.
    >
    > Thanks
    > Paul

    Try XSync()
    but don't overuse it, as it slows down the program
    considerably.
    Alternatively, something could be wrong with your redraw logic.
    Sometimes, a good old printf will tell you if the draw code is
    actually executed when you think it is.

    Best regards

    Dušan Peterc
    http://www.arahne.si

  5. Re: Updating Screen


    "arahne" wrote in message
    news:5SJVh.722$553.581268@news.siol.net...
    > Paul Thompson wrote:
    >> There are times when I use X Windows to draw something (e.g. string) in
    >> a Window, the screen doesn't update until after I cause another event
    >> (e.g. press a key). How can I get the screen to update following the
    >> draw?
    >>
    >> Using SuSE Linux 9.3.
    >>
    >> Thanks
    >> Paul

    > Try XSync()
    > but don't overuse it, as it slows down the program
    > considerably.
    > Alternatively, something could be wrong with your redraw logic.
    > Sometimes, a good old printf will tell you if the draw code is
    > actually executed when you think it is.
    >


    XFlush() might be all that is needed. Note that XSync() blocks until all
    existing events are processed, whereas XFlush() sends all pending
    requests then returns immediately.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Aero Stability and Controls Computing



  6. Re: Updating Screen

    On Apr 18, 3:40 pm, Paul Thompson wrote:
    > There are times when I use X Windows to draw something (e.g. string) in
    > a Window, the screen doesn't update until after I cause another event
    > (e.g. press a key). How can I get the screen to update following the draw?
    >
    > Using SuSE Linux 9.3.
    >
    > Thanks
    > Paul


    Also, might want to try XSynchronize(dpy, True);

    I think this should only be used during debugging however. Imposes
    synchronous behavior as opposed to the default.


  7. Re: Updating Screen

    Thanks folks, it appears XSync solves the problem.


    Paul Thompson wrote:
    > There are times when I use X Windows to draw something (e.g. string) in
    > a Window, the screen doesn't update until after I cause another event
    > (e.g. press a key). How can I get the screen to update following the draw?
    >
    > Using SuSE Linux 9.3.
    >
    > Thanks
    > Paul


+ Reply to Thread