nanogui: Window Mapping & Unmapping Revisited


Previous by date: 8 Mar 2006 19:15:00 +0000 Re: updating window, Aaron J. Grier
Next by date: 8 Mar 2006 19:15:00 +0000 Re: updating window, Robbie
Previous in thread: 8 Mar 2006 19:15:00 +0000 Window Mapping & Unmapping Revisited, Gil Glass
Next in thread: 8 Mar 2006 19:15:00 +0000 Re: Window Mapping & Unmapping Revisited, Greg Haerr

Subject: Re: Window Mapping & Unmapping Revisited
From: "Aaron J. Grier" ####@####.####
Date: 8 Mar 2006 19:15:00 +0000
Message-Id: <20060308191457.GG20104@mordor.unix.fryenet>

On Wed, Mar 08, 2006 at 10:43:46AM -0500, Gil Glass wrote:
> // ...
> <Do lots of drawing on the root window until...>
> // ...
> 
> // Create and open a NEW window whose PARENT is the ROOT window.
> windowID = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, SCREEN_WIDTH, 
> SCREEN_HEIGHT, 0, GR_COLOR_WHITE, GR_COLOR_WHITE);
> 
> // Map (show) the window.
> GrMapWindow(windowID);
> 
> <draw some stuff>
> 
>  // Remove this window.
> GrUnmapWindow(windowID);
> GrDestroyWindow(windowID);
> 
> ...then at this point, should the contents of the root window not be 
> redisplayed?

only if you've set it up that way.  (:

> Please forgive my naïveté, but do I have to use the window manager
> (nanowm) to make this happen?

after your window is drawn and erased, nano-X will generate an expose
event to the root window, telling it which area(s) need to be redrawn.
the window manager checks for these events and does appropriate
notifications/callbacks to get things done.  if you're using a
backing-store (offscreen) buffer, these expose events are
straightforward GrCopyArea calls.  if you don't have backing store,
you'll need to regenerate the missing data somehow.

nanowm is one way to handle these sorts of events.

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  ####@####.####

Previous by date: 8 Mar 2006 19:15:00 +0000 Re: updating window, Aaron J. Grier
Next by date: 8 Mar 2006 19:15:00 +0000 Re: updating window, Robbie
Previous in thread: 8 Mar 2006 19:15:00 +0000 Window Mapping & Unmapping Revisited, Gil Glass
Next in thread: 8 Mar 2006 19:15:00 +0000 Re: Window Mapping & Unmapping Revisited, Greg Haerr


Powered by ezmlm-browse 0.20.