Windows screensaver.

David Elliott dfe at tgwbd.org
Sun Dec 23 14:24:41 CST 2001


On 2001.12.23 11:10 Gleb Natapov wrote:
>  Hello all,
> 
> Perhaps this was asked before, but I didn't find the answer.
> Is it possible to run windows screensaver in linux using wine?
> If not, how hard it will be to write support for this?
> 
Well, there are a few issues:
1. Loading wine takes forever on my box (although this will be fixed in 
about a week when I get a dual-athlon setup).  Not an ideal solution to 
the speed problem in my mind.. but works for me.

2. You can already run most screensavers using: wine using wine 
/path/to/screensaver.scr /s
An .scr file is essentially just an .exe that has been renamed.  The /s 
switch tells the screensaver to actually run as a screensaver.  Without it 
it will open up the configuration properties for the screensaver.

3. You'll notice that when you run the screensaver like this that it will 
appear on top of all other windows and when you move the mouse it will go 
away.  That is, the screensaver itself takes care of putting itself above 
all other windows and will dismiss itself when it gets an event such as 
mouse move or button press or whatever.  XScreenSaver doesn't work this 
way.  You'll notice that most of the commandlines in your .xscreensaver 
file have the -root option.  That means draw in the root window which if 
you run that by itself (i.e. outside of xscreensaver) you'll notice that 
it will in fact draw to the root window (i.e. your desktop background).  
Also, moving the mouse around does nothing... the program simply draws 
stuff on the screen and absolutely does not handle dismissing itself like 
a win screensaver.

XScreenSaver creates a virtual root window on top of everything which it 
then runs the screensaver program in.  That way the screensaver program 
still thinks it is just drawing in the root window, but in reality it is 
drawing on top of everything.  XScreensaver also takes care of dismissing 
the screensaver when you move the mouse.  I believe it does this by 
sending it a signal of some sort, although I am not entirely sure.  You 
really ought to read its documentation to get all the specifics on this.

However, you /can/ add a line that runs wine to run the screensaver in 
your .xscreensaver file. In fact, I just tried this.  If you run in demo 
mode you get the expected behavior, it won't go away until you click a 
button.  If you set it as your screensaver and do a normal blank (i.e. not 
lock) then it'll go away when you move the mouse.  However, if you do a 
lock screen it'll clear the screen to black when you move the mouse, ask 
you for your password (which for some reason it didn't accept the first 
time, but maybe I just typed it wrong).  Anyway, once you type a valid 
password you are still looking at the screensaver until you move the mouse 
again.

So basically it already does mostly work. One way to decrease the startup 
time would be to start the wineserver in persistent mode before hand.  
Then the first time you load the screensaver (or some other windows app) 
it'll take a while, this is because the first client to connect has to set 
some stuff up.  However, after that the wineserver is running and ready to 
go so it doesn't take very long for the screensaver to start up.  (I just 
checked this, and that is what happens).

One thing you could maybe try to do to decrease this is make a very 
lightweight wine configuration in a different directory.  You can use the 
WINEPREFIX environment variable to do this.  With a bit of configuration 
you could have a wineserver running permanently listening on a socket in 
$WINEPREFIX instead of in the usual ~/.wine directory.  Also that way when 
you run windows apps it doesn't affect your other wineserver.

As far as fixing the behavior goes, I have a few ideas.  Wine supports a 
"Desktop" mode where a desktop window is created and all wine drawing is 
done to that window.  You could maybe change wine a bit to allow wine to 
draw into an already created desktop window (e.g. draw into the root 
window).  That might make things behave a slight bit better.  In fact, 
doing that alone might fix everything.  And I also think that doing that 
should be simple (and maybe there is already a way to do this).

Hope that helps you to figure it out!
-Dave




More information about the wine-devel mailing list