Commit Graph

7 Commits

Author SHA1 Message Date
wm4 aa458c1fef osx: change license header on some more cocoa files
Changing the headers was actually forgotten in the previous commit.
2017-06-24 16:50:52 +02:00
Akemi 9ac05a575c cocoa: refactor mouse events and cursor visibility
we reported some unnecessary mouse movements and not all mouse enter
and leave events. that lead to wrongly reported activity on hover areas
like on the OSC or comparable lua scripts. sometimes menu items were
shown that shouldn't be shown or they didn't vanish because of the
missing mouse leave event.

this incorporates @torque's fix for mouse leave events that weren't
triggered during a transition, like going to fullscreen. the
tracking area was updated but the mouse never left that area because
it was never over it.

besides some known cursor visibility bugs the aforementioned changes
also revealed some other bugs that weren't reproducible before because
of the missbehavior.
known issues, in some cases the cursor doesn't show or hide properly.
for example when switching spaces, switching Apps via CMD+Tab or a
system notification. former two could be fixed while keeping our current
blank cursor approach. though the notification case couldn't. there is
no event or similar to detect a notification and the cursor visibility
couldn't be recovered in any way.

new issues, i noticed that our event view isn't initialised yet when the
first VOCTRL_SET_CURSOR_VISIBILITY event gets dispatched, which depends
on the event view to be initialised. so the mouse cursor couldn't be
hidden when mpv was opened and the cursor was within the window bounds.
this wasn't noticeable before because of various bugs and unwanted
behavior that have been fixed with this. now, in case the event view
isn't ready yet, we set the visibility at a later point when the event
view is ready and a helper flag is set.

Fixes #1817 #3856 #4147
2017-02-16 22:22:11 +01:00
Akemi a8347eb9ba cocoa: fullscreen refactoring
this replaces the old fullscreen with the native
macOS fullscreen. additional the
--fs-black-out-screens was removed since the new
API doesn't support it in a way the old one did.
it can possibly be re-added if done manually.

Fixes #2857 #3272 #1352 #2062 #3864
2016-12-15 20:55:16 +01:00
torque bce753060e cocoa: update mouse coordinates when window is initialized.
Make MpvEventsView -signalMousePosition a public method so it can be
called without a compiler warning. Previously, the mouse position would
be reported as (0,0) until the cursor was moved.
2015-03-07 19:31:52 +01:00
Stefano Pigozzi 64b6b2ea45 cocoa: fix uninitialization while in fullscreen
This is only needed for switching video track with `_`, since Cocoa
automatically handles cleaning up the application's presentation options when
quitting the process.

Fixes #1399
2015-01-01 14:38:08 +01:00
Stefano Pigozzi 69fa956f50 cocoa: allow to embed into an arbitrary NSView
Basically add if guards on all the problematic features. I'm still thinking
about a better way to handle this, but for the time being, this will do.
2014-10-08 19:38:35 +02:00
Stefano Pigozzi 547b62f45e cocoa: separate video view and events view 2014-10-05 23:38:39 +02:00