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: Jeremy Huddleston <email@hidden>
- Date: Tue, 21 Dec 2010 17:37:43 -0800
This is not an issue specific to quartz-wm ... you will encounter this issue with any window manager. Make sure you're responding to ConfigureNotify events if you need to know when a window changes configuration.
http://www.x.org/releases/X11R7.6/doc/man/man3/XConfigureEvent.3.xhtml
Also, why not just use the existing window for the GLX context?
On Dec 21, 2010, at 17:12, Cook, Rich wrote:
> Hi, let me first say I wish I were a better X11 programmer. I inherited this code. Basically, the window is created like this:
> window = XCreateWindow(display, parentWin,
> x, y, width, height,
> winBorder, visInfo->depth, InputOutput,
> visInfo->visual, windowAttrsMask, &windowAttrs);
>
> 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!
>
> Hopefully this clears things up a little?
>
>
>
> On Dec 16, 2010, at 8:39 PM, Jeremy Huddleston wrote:
>
>>
>> On Dec 16, 2010, at 18:02, Cook, Rich wrote:
>>
>>> I am having an issue where I place a window in my application and then XQuartz moves it down 22 pixels I guess to make room for the title bar. I need to correct for this behavior, but it only happens when the X Server is X11.app or Xorg.app. Is there a way for my Unix application (running on linux or OS X) to detect XQuartz and take evasive action? Thanks!
>>
>> The X11 side of XQuartz actually doesn't even know about the menu bar. If you notice, the X11 display thinks the resolution is 22 pixels smaller than it really is (because the menu bar is not part of X11).
>>
>> Can you give an example of the problem you are facing?
>>
>> Your best bet is to check the list of extensions:
>>
>> $ xdpyinfo | grep Apple
>> Apple-DRI
>> Apple-WM
>>
>> See XListExtensions. You can see how it's used in print_extension_info in xdpyinfo.c (http://cgit.freedesktop.org/xorg/app/xdpyinfo/tree/xdpyinfo.c)
>>
>> --Jeremy
>
> --
> ✐Richard Cook
> ✇ Lawrence Livermore National Laboratory
> Bldg-453 Rm-4024, Mail Stop L-557
> 7000 East Avenue, Livermore, CA, 94550, USA
> ☎ (office) (925) 423-9605
> ☎ (fax) (925) 423-6961
> ---
> Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
> (opinions expressed herein are mine and not those of LLNL)
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden