Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: Event Handling

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Event Handling

    I am trying to enchance event handling loop. Right now with a standard (text book) loop the problem is that on any ConfigureNotify or Expose event I had to run drawing function which takes too long to complete. As a result, e.g., when I resize the window it will draw one by one all the intermediate sizes up to the final one. (Again since the draw function is slow it may take up to several seconds) Can I somehow discard all the intermediate ConfigureNotify and Expose events and process only the final one? I am trying to do that but so far wthout success.


  2. #2
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    I had a similar problem when writing my own app, and here's some solutions I came up with:

    1) Expose events have a count member; ignore all Expose events with a count higher than 0. (This was my temporary solution)

    2) Expose events have members to specify the region of the window that needs to be redrawn; redraw only this part. (This is part of the solution I used)

    3) Draw to back buffers (like Pixmaps or in my case, Imlib_Images) whenever needed (for me it was when the root pixmap changed) and render the buffer onto the window when needed (Expose event)
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

Posting Permissions

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