Re: XAppleWMFrameDraw(), CoreGraphics, TWM
Re: XAppleWMFrameDraw(), CoreGraphics, TWM
- Subject: Re: XAppleWMFrameDraw(), CoreGraphics, TWM
- From: Eeri Kask <email@hidden>
- Date: Mon, 15 Aug 2011 00:55:12 +0200
On 08/13/2011 09:31 PM, Jeremy Huddleston wrote:
>> #define APPLEWM_FRAMETYPE (1 << 0) /* AppleWMFrameClassDocument */
>> #define APPLEWM_FRAMEHILIGHT (0x0001 | 0x0004 | 0x0700)
>> /* AppleWMFrameActive | AppleWMFrameTitle | AppleWMFrameAnyBox */
>> #define APPLEWM_FRAMELOLIGHT (0x0004) /* AppleWMFrameTitle */
>
> Don't do that. I'm trying to eliminate duplicated code. Use the constants provided by Xplugin.h instead.
>
> Use XP_FRAME_CLASS_DECOR_LARGE instead of APPLEWM_FRAMETYPE
> Use XP_FRAME_ATTR_TITLE instead of APPLEWM_FRAMELOLIGHT
> Use (XP_FRAME_ATTR_ACTIVE | XP_FRAME_ATTR_TITLE | XP_FRAME_ATTRS_ANY_BUTTON) for your "APPLEWM_FRAMEHILIGHT" but try calling it something more consistent, like _XP_FRAME_ATTRS_ACTIVE_TITLE_ANY_BUTTON.
Alternatively, as this whole thing has to run on e.g. a Tiger-laptop
too,
#if (defined XPLUGIN_VERSION) && (XPLUGIN_VERSION >= 4)
#define AppleWMFrameClassDocument XP_FRAME_CLASS_DECOR_LARGE
#define AppleWMFrameActive XP_FRAME_ATTR_ACTIVE
#define AppleWMFrameTitle XP_FRAME_ATTR_TITLE
#define AppleWMFrameAnyBox XP_FRAME_ATTRS_ANY_BUTTON
#endif
then use the names consistently as specified by 'man AppleWM'...?
>>>> (2) What good purpose does the 'XAppleWMNotifyEvent'
>>>> (AppleWMControllerNotify, AppleWMActivationNotify, etc) offer?
>>>> How to use the XAppleWMSelectInput() function? Is it supposed to
>>>> work like XSelectInput()? Are these notify-events meant to be
>>>> utilised by a WM at all?
>>>
>>> Yes. It serves to pass along notifications from non-X11 sources for close, minimize, zoom, hide, and various other notifications that quartz-wm wants to know about. My advise to you at this point is to take a look in the server for what sends out those notifications and that'll hopefully help you understand them better.
>>>
>>> Chances are you won't need all of them, and if you find you need one that isn't there, we can always add it to the protocol.
>>
>>
>> I took a look at them. According to the first findings, it looks
>> like the 'window' field of 'XAppleWMNotifyEvent' is set to 'None'?
>
> Yeah, that's what it looks like... these events usually correspond to events from outside X11 itself (usually from OS X) and correspond to the "front" window or the application as a whole.
OK, but then e.g. to 'close' the currently focused window is a risky
activity, if it is *not* clear that the event comes from the user's
keypress CMD+W while in that particular window; but may have some
other, probably unknown sources.
Does only pressing CMD+W trigger a 'close' under MacOSX, so the
'close' event can be considered equivalent to that keypress event?
>> In respect to AppleWM it seems though in some cases, e.g. for
>> matters like 'AppleWMHideAll' and 'AppleWMShowAll' it would probably
>> make sense to fill this field with the value of the root-window-ID,
>> or something?
>
> Maybe it would've, but there are a ton (all) of servers out there that don't do this now, so that's not a great solution if you want to work on existing systems, and the fix is easy to do in your wm.
Another question in that regard is, as it stands in applewm.h,
besides others the XAppleWMFrameDraw() expects a 'screen' parameter
(besides inner and outer region sizes) making one think XQuartz
supports multiple X11-screens which may have differing dpi
resolutions so specifying differing inner/outer area sizes
respectively; which is important if we aim to have window titles
which have the same extents in "physical-world" measures.
On the other side XAppleWMFrameGetRect(), to e.g. find out title
area height, does not have a 'screen' parameter, which leads one to
think all attached X11-screens have the same dpi resolution which
may not be the case generally. So the Aqua compositor works using
pixel metrics, not physical lengths?
Still investigating,
Eeri Kask
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden