Review request for 7124430: [macosx] LWCToolkit.grab() and LWCToolkit.ungrab() events are not implemented yet
Artem Ananiev
artem.ananiev at oracle.com
Tue Jan 17 07:41:03 PST 2012
On 1/17/2012 6:09 PM, Anton V. Tarasov wrote:
> Here's the new version:
>
> http://cr.openjdk.java.net/~ant/7124430/webrev.3/
I don't have any further comments. Anthony?
Thanks,
Artem
> Thanks for the catch! I've added the case to the test as well.
>
> Thanks,
> Anton.
>
>
> On 17.01.2012 14:34, Artem Ananiev wrote:
>> Hi, Anton,
>>
>> as we discussed offline, the fix looks fine with except the code in
>> LWWindowPeer.notifyNCMouseDown(): it doesn't send ungrab events when
>> user clicks on a title of a frame, that is not related (neither owner
>> nor child) to the current grabbing window.
>>
>> So waiting for the next version of the fix.
>>
>> Thanks,
>>
>> Artem
>>
>> On 1/17/2012 11:30 AM, Anton V. Tarasov wrote:
>>> Anthony was right (thanks for the persistence! :)
>>>
>>> Please review the new version, with -[NSWindow sendEvent:] overridden:
>>>
>>> http://cr.openjdk.java.net/~ant/7124430/webrev.2/
>>>
>>> Thanks,
>>> Anton.
>>>
>>> On 1/13/12 9:17 PM, Anthony Petrov wrote:
>>>> Overriding NSWindow -sendEvent: does allow one to catch mouse click
>>>> events on the Mac. We use this technique in JavaFX for grab/ungrab
>>>> functionality, and everything works smoothly.
>>>>
>>>> Anton was just trying to override NSApplication -sendEvent: which
>>>> indeed won't help in that case (note the class name difference).
>>>>
>>>> --
>>>> best regards,
>>>> Anthony
>>>>
>>>> On 1/13/2012 9:34 PM, Mike Swingler wrote:
>>>>> Don't worry about trying to catch the window title bar frame, you
>>>>> really can't, and you shouldn't try. The titlebar/toolbar area is
>>>>> specially marked so that the WindowServer will still allow the window
>>>>> to be movable, even if the app is spinning and non-responsive. Due to
>>>>> this fact, the app is infrequently notified when it's window is being
>>>>> moved, because that app isn't even involved.
>>>>>
>>>>> Regards,
>>>>> Mike Swingler
>>>>> Apple Inc.
>>>>>
>>>>> On Jan 13, 2012, at 7:49 AM, Anton V. Tarasov wrote:
>>>>>
>>>>>> Hi Anthony,
>>>>>>
>>>>>> Thanks for the tip. Though I did look through some forum discussions
>>>>>> where people asked question
>>>>>> "is it possible to catch a mouse down event in a frame's titlebar?"
>>>>>> The answer was "not a direct way".
>>>>>> Commonly, a suggestion is to workaround it by means of
>>>>>> -windowWillMove usage, but this looks quite
>>>>>> odd to me...
>>>>>>
>>>>>> For instance:
>>>>>>
>>>>>> http://www.cocoabuilder.com/archive/cocoa/6725-catching-mousedown-in-an-nswindow-titlebar.html
>>>>>>
>>>>>>
>>>>>>
>>>>>> "PS: I have tried to overiding -sendEvent in the instance of a
>>>>>> subclass
>>>>>> of NSApplication object to see what events are going thru, mouseDown
>>>>>> and mouseUp events in the titlebar don't go thru. It's seem that the
>>>>>> windows are moved directly by the WindowServer, as you explained me."
>>>>>>
>>>>>> Did you have an experience of trying it yourself?
>>>>>>
>>>>>> Thanks,
>>>>>> Anton.
>>>>>>
>>>>>> On 1/13/12 4:58 PM, Anthony Petrov wrote:
>>>>>>> Hi Anton,
>>>>>>>
>>>>>>> You want to override NSWindow -sendEvent: in order to catch clicks
>>>>>>> on the titlebar of windows on the Mac.
>>>>>>>
>>>>>>> --
>>>>>>> best regards,
>>>>>>> Anthony
>>>>>>>
>>>>>>> On 1/13/2012 6:36 PM, Anton V. Tarasov wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> Please review a fix for 7124430.
>>>>>>>>
>>>>>>>> webrev: http://cr.openjdk.java.net/~ant/7124430/webrev.1/
>>>>>>>>
>>>>>>>> UngrabEvent dispatching is implemented according to the cases
>>>>>>>> mentioned
>>>>>>>> in the UngrabEvent class description, except for the case of
>>>>>>>> clicking
>>>>>>>> in an owner frame's title. The latter, as I found, can't be
>>>>>>>> implemented
>>>>>>>> on Mac OS X platform. Along with the implementation, a regression
>>>>>>>> test
>>>>>>>> is proposed.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Anton.
>>>>>>>>
>>>>>>>>
>>>>>
>>>
>
More information about the macosx-port-dev
mailing list