nanogui: Screensaver deactivation
Subject:
Re: [nanogui] Screensaver deactivation
From:
Alex Holden ####@####.####
Date:
31 May 2006 20:04:10 +0100
Message-Id: <B0D90E35-F0EB-4C34-A613-D4C783208CD3@linuxhacker.org>
On 31 May 2006, at 14:02, Ciarán Rehill wrote:
> I've searched the list archives and read every thread where
> screensaver is mentioned and I'm still no closer to understanding
> the process of stopping the screensaver (i.e. generating a
> deactivate GR_EVENT_TYPE_SCREENSAVER).
That happens when the mouse/touchscreen move or a key is pressed. You
should be able to simulate it with a GrInjectKeyboardEvent() if you
don't have an ordinary keyboard driver.
> Can anyone point me towards a run-through of the screensaver
> process. Should it be started by a dedicated application, calling
> GrSetScreenSaverTimeout() and then watching for
> GR_EVENT_TYPE_SCREENSAVER? Should the actual screen drawing part
> be a separate process that gets forked and killed by that event
> monitor?
Take a look at the nsaver and launcher demos. Launcher sets the
timeout period and launches the screensaver process on receiving a
timeout event, and nsaver is a collection of screensavers. Launcher
also has the ability for you to specify multiple screensavers and
change them at set time intervals.
> Also, I would like to manuipulate the existing content of the
> screen during the screensaver (i.e. ViewML is running and showing a
> page). Doing GrCopyArea() from the root window to a new window
> doesn't seem to work (starts with a blank screen). Can an
> application get the current screen contents using nano-X calls
> (independent of who drew the window(s) in the first place)?
Yes, in fact search for capture_screen in nsaver.c and you'll see an
example of reading the current contents of the screen. I'm not sure
if that's really what you want to do though.
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer