xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] restoring contents of an unmapped/mapped canvas ??


From: Jens Thoms Toerring
Subject: Re: [XForms] restoring contents of an unmapped/mapped canvas ??
Date: Fri, 18 Dec 2015 00:12:28 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Peter,

On Wed, Dec 16, 2015 at 05:16:51PM -0800, Peter Rowat wrote:
>   If I XUnmapWindow (ref p.199 in the manual) a canvas with various items
> drawn on it, (e.g. XDrawLines) the following XMapWindow doesn’t restore the
> previous contents. XMapWindow requires a window as 2nd argument but,
> supposedly, that was destroyed by the XUnmap ??

A window doesn't have amy "content", it's just an area you're
allowed to draw into (and receive events for). Even if another
window is moved over your window and then again removed, the
previous content of your windiw isn't restored all by itself.
Instead, you get XEvents for thar window that tell you which
parts of it need restoring. And if you unmap a window its con-
tent is gone for good. All that unmapping it does is to tell
the Window manager to withdraw the borders and issue redraw
XEvent so all windows that had been obscured by your window
you just unmapped.

> What functions are there to Save/Restore the contents. Presumably some
> save/restore pixrect function ??

There are none that I know of. In my experience, one typically has
an off-screen pixmap into which all drawing requests go (instead
of directly to the window) and then that is XCopy'ed the on-screen
window (already to avoid flicker). With such a pixmap as a kind of
"back-up" it's easy to restore the window contents. If you don't
have one I'd think you'll have to do a complete redraw of every-
thing from scratch.

Of course, you can implement some function for saving the window
contents before you unmap it by simply copyimg its content into
an off-screen pixmap with XCopy (though that alaways assumes that
your window isn't partially obscured by another window). But there
is none in XForms for that (and to get that right all of the time
would be extremely difficult!). With canvases, which are a very
thin layer on top of an X window, you're mostly on your own;-) 

Of course, I could completely misunderstand your question (and
at the moment, I'm not too deeply into the details of Xlib due
to other work...), so the answer you're looking for might be
something completely different...

                          Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]