Script window position update

Charlie Brej plymouth at brej.org
Mon Mar 22 17:09:18 PDT 2010


I changed the way that the window get functions behave when no window 
index has been passed. Now it gives the position and size of a fully 
overlapped area (one which is visible on all screens). Sorry about the 
breakage, but I couldn't find any way round this one.

What it means is that you can no longer assume that the window starts at 
0,0. If you have a script which wants to place something in the centre 
of a window, you should now add the window X and Y offsets. Doing this 
in previous releases does no harm.

There are some examples of this in this commit:
http://cgit.freedesktop.org/plymouth/commit/?id=d28ff94b690d9dd231def8723a63910f52bd4ebb

This change only effects multiple monitor setups and is there to allow 
the theme designer to be sure that a piece of text or an image will be 
visible no matter which screen the user looks at.

Centre of the window = Widnow.GetX () + Widnow.GetWidth () / 2;
Minimum window width = Widnow.GetWidth ();
Maximum window width = Widnow.GetX () * 2 + Widnow.GetWidth ();
Minimum window X = Widnow.GetX ();
Maximum window X = 0;

Similar for Y and Height.


More information about the plymouth mailing list