On Mon, 10 Jul 2023 23:11:21 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Harshitha Onkar has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   minor test changes
>
> src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m line 135:
> 
>> 133:             if ((initFlags & kCGEventFlagMaskSecondaryFn) != 0) {
>> 134:                 initFlags ^= kCGEventFlagMaskSecondaryFn;
>> 135:             }
> 
> Can you please double check how the lines below affected the usecase you fix, 
> especially:
>> CGEnableEventStateCombining - Pass true to specify that the actual key and 
>> mouse state are merged with the application-specified state in a synthetic 
>> event; otherwise, pass false.

@mrserb I checked by changing `CGEnableEventStateCombining()` to `false` with 
the updated code and it didn't  make any difference. Works the same when I test 
it with the reproducer. I will check again to see if there is any difference in 
the final flag bits that is used to post the event.

Did you also mean trying out different options available for the following 
lines with the original code intact?


// Let our event's modifier key state blend with local hardware events
CGEnableEventStateCombining(TRUE);

// Don't let our events block local hardware events
CGSetLocalEventsFilterDuringSupressionState(
                            kCGEventFilterMaskPermitAllEvents,
                            kCGEventSupressionStateSupressionInterval);

CGSetLocalEventsFilterDuringSupressionState(
                            kCGEventFilterMaskPermitAllEvents,
                            kCGEventSupressionStateRemoteMouseDrag);


While going through Apple documentation about 
[CGEnableEventStateCombining(boolean 
doCombineState)](https://developer.apple.com/documentation/coregraphics/1541787-cgenableeventstatecombining?language=objc)
 it states:

_When called with doCombineState equal to false, this function initializes 
local (per application) state tracking information to a state of all keys, 
modifiers, and mouse buttons up. When called with doCombineState equal to true, 
the current global state of keys, modifiers, and mouse buttons are used in 
generating events._

So I think CGEnableEventStateCombining should be set to TRUE as it is 
configured now ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14744#discussion_r1260107279

Reply via email to