Re: Is there a way to programmatically determine if the X Server is using XQuartz?
Re: Is there a way to programmatically determine if the X Server is using XQuartz?
- Subject: Re: Is there a way to programmatically determine if the X Server is using XQuartz?
- From: Brandon S Allbery KF8NH <email@hidden>
- Date: Wed, 22 Dec 2010 12:36:48 -0500
- Openpgp: id=2B0BDB95
- Organization: Carnegie Mellon University, Electrical & Computer Engineering, Computing Facilities
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/21/10 20:12 , Cook, Rich wrote:
> Later in the code, X11 moves the window down 22 pixels, presumably so the window manager can draw the title bar. I save those values at that time. In my code, I don't have a way to find out whether this is the window manager moving the window or the user. But later on, I may destroy and recreate the window with a different OpenGL context to do stereo rendering. At that point, I'd like the new window to show up where the old one was, so the user does not get creeped out by the creeping window. :-) It's not a big deal, but if I knew I was displaying to a Mac X server, then I could make the adjustment heuristically without lots of complicated logic, i.e., just decrement the Y position by 22 if it's a Mac X server. It would be "good enough" for my purposes. I know it's hacky, but X11 is not easy to use!
Get the position and size of the window, watch for a ReparentNotify on the
window, and if received replace them with the position and size of the new
parent window. Likewise if the window is moved/resized, get the parent
window's position and size; but if you never got the ReparentNotify, use the
position/size of the window itself.
This will work with any window manager, including non-reparenting window
managers which some people use with full-screen mode.
- --
brandon s. allbery [linux,solaris,freebsd,perl] email@hidden
system administrator [openafs,heimdal,too many hats] email@hidden
electrical and computer engineering, carnegie mellon university KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0SNzAACgkQIn7hlCsL25VL8QCdHzSpmtbLxOh4aPbsF3IPfsk1
Et4AnAk7hS0Opdo4vQguTT4bML+4ytDa
=8Ih0
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden