Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    redraw refresh screen Xlib after hiding

    I am trying to build some x11 programs an I think I will manage, but there is one question I can't figure out how to deal with it.
    Very strange I could not find a good example for it. I don't understand how i would have my window repainted after hiding or more precise after the event.xexpose. .

    I have this snip of code :
    if (event.type==Expose && event.xexpose.count==0) {
                    /* the window was exposed redraw it! */
    void redraw() {
            XClearWindow(dis, win);
    Which is not a redraw, I know. But how would I have the window repainted.
    A link to an example for this would be fine.

    The few examples I found till now, the window was realy redrawn by "hand", so it could take a while for a complex picture. While only the pixmap was to be updated. The window still exist in memory and can be changed when invisible. It cannot be very difficult because it is a basic task in a windowing system.

  2. #2
    I found already a solution. Write to the screen and to a pixmap.
    After an exposure event copy back the pixmap.
    Rather silly

  3. #3
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    There is also XSync() and XFlush() if you need to force things. XLib mostly does this by itself, but occasionally you have to tell it explicitly.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts