Memphiz / xbmc

XBMC Main Repository
http://xbmc.org
Other
55 stars 18 forks source link

Check the double mouse event logic #35

Open Memphiz opened 7 years ago

Memphiz commented 7 years ago

There seems to be logic in place that handles/forwards mouse events in 2 code positions.

  1. CWinEventsOSXImp (see enableInputEvents and InputEventHandler)
  2. OSXGLWindow (see for example the mouseMoved handler).

The second handlers are all guarded with Cocoa_IsMouseHidden - currently this method always returns false so the second handlers are not in function currently.

There needs to be a sane decision how to handle those mouse events. It sounds not so bad to have those coming in from the OSXGLWindow - but the InputEvents Approach from CWinEventsOSXImp works fine as far as i can tell.

Memphiz commented 7 years ago

I think i found the culprit with the general input event mouse handling. If display is windowed on second screen and we move the mouse around on the first screen - kodi is still in focus and interprets the mouse movements. So the 1. approach should be properly implemented - only mouse movements over our window are resulting in kodi events then.

Memphiz commented 7 years ago

I have implemented a WIP state of this. Its a bit wonky still.

  1. I disabled the mouse events from the input tap (the second approach)
  2. I readded tracking area for our view a. if mouse enters tracking area - cocoa native mouse cursor is hidden b. if mouse exits tracking area - cocoa native mouse cursor is shown
  3. in our Window i now forward all mouse related events as long as cocoa native mouse cursor is hidden (means - the mouse is in our tracking area - also means the mouse is above our window/view).

The way that mrmc has it is a bit strange. I think he receives double events (one from the window and one from the input tap), where his coordinates for one of the both are invalid which by accident ensures that only one of the 2 events is handled.

I have still one strange issue. Mostly when starting up in windowed mode. Sometimes the mouse location is out of bounds and not properly related to our view. I tried multiple conversion methods for mouse coordinates - but none of them result in the proper position once the app is in that broken condition.

github-actions[bot] commented 1 month ago

This issue is now marked stale because it has been open over a year without activity. Remove the stale label or add a comment to reset the stale state.