[comp.windows.x] What is visible?

ssd@engr.ucf.edu (Steven S. Dick) (01/24/91)

I have an application for which drawing the window is computationally
expensive, so I'd like to be able to draw the smallest amount
possible--in other words, only the visible portions.

Currently, the program triggers off of expose events, and draws each part
as it is exposed.  Unfortunately, the program must periodically redraw
the window from scratch.  When this becomes necessary, I have to guess
what portions of the window are visible.

Is there a way to ask the server what parts of the window are visible?

	Steve
ssd@engr.ucf.edu

marbru@attc.UUCP (Martin Brunecky) (01/26/91)

In article <1991Jan24.140821.19001@osceola.cs.ucf.edu> ssd@engr.ucf.edu (Steven S. Dick) writes:
>I have an application for which drawing the window is computationally
>expensive, so I'd like to be able to draw the smallest amount
>possible--in other words, only the visible portions.
>
>Is there a way to ask the server what parts of the window are visible?
>
    I don't know about such protocol request (correct me if I am wrong).

    What you can do, however, is:

    - kepp track of ALL exposure events SINCE you cleared your window
     (asking for exposure in clear). This will show you what portions
     of window are visible. Though some portions may become obscured
     since the clear, at least you will know what areas NEVER got
     exposed.

    - merge expose events where possible (Xt has a mechanism to do that
     for you, in pure X you can do it yourself). This will help with
     multiple XExpose events caused by a single event (such as unmap
     of an obscuring window).



-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky                           {...}sunpeaks!auto-trol!marbru
(303) 252-2499                        (sometimes also:  marbru@auto-trol.COM )
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404