New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window dragging doesn’t work on OS X until the OSC has been activated at least once #1819

Closed
vitorgalvao opened this Issue Apr 14, 2015 · 12 comments

Comments

Projects
None yet
6 participants
@vitorgalvao
Contributor

vitorgalvao commented Apr 14, 2015

Window dragging from anywhere (i.e. by dragging the video being displayed as opposed to the top bar) does not work on OS X if the on-screen display hasn’t been available at least once.

So if for example the showwindowed=no option is set and we open a video in windowed mode, window dragging will be unavailable until the video is made fullscreen at least once. By this I mean that when opening the video it won’t work at all, but if we quickly go in and out of fullscreen, then it starts working for the duration of the video.

Reproducible both with --script-opts=osc-showwindowed=no and in ~/.mpv/lua-settings/osc.conf.

If we completely disable the on-screen display in both cases (--script-opts=osc-showwindowed=no,osc-showfullscreen=no, or by setting both options in ~/.mpv/lua-settings/osc.conf), then window dragging won’t work at all.

Currently on mpv version 0.9.2, installed via homebrew with no specified flags, from the official repo. OS X Yosemite 10.10.3.

@Argon-

This comment has been minimized.

Member

Argon- commented Apr 14, 2015

Could you test with HEAD? Dragging works for me (always did). Probably try with --no-config too and try to identify the problematic option in case it works.

@Nyx0uf

This comment has been minimized.

Contributor

Nyx0uf commented Apr 14, 2015

Same here, works perfectly (tried with my config and with --no-config)

@AirPort

This comment has been minimized.

AirPort commented Apr 14, 2015

Same, it works as expected here (10.10.3, HEAD mpv).

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Apr 14, 2015

Found the culprit: it’s the showwindowed=no option. Reproducible both with --script-opts=showwindowed=no and in ~/.mpv/lua-settings/osc.conf.

@vitorgalvao vitorgalvao changed the title from Window dragging doesn’t work correctly on OSX to Window dragging doesn’t work correctly on OS X when using showwindowed=no Apr 14, 2015

@Argon-

This comment has been minimized.

Member

Argon- commented Apr 14, 2015

You are right, I can reproduce it as well.

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Apr 29, 2015

Still happens in 0.9.0. Updated top comment to reflect that.

@wm4 wm4 added the osx label Apr 29, 2015

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Jun 2, 2015

There’s a really ugly hack to work around this. Simply execute the following line.

mkdir -p "${HOME}/.mpv/scripts && echo 'function cycle_fullscreen()\n  mp.command("cycle fullscreen")\nend\n\nmp.register_event("start-file", cycle_fullscreen)\nmp.register_event("file-loaded", cycle_fullscreen)' > "${HOME}/.mpv/scripts/cycle_fullscreen_twice.lua"

What it does is create a .mpv/scripts directory, if it didn’t exist, in your home. It then creates a cycle_fullscreen_twice.lua file inside it with the contents

function cycle_fullscreen()
  mp.command("cycle fullscreen")
end

mp.register_event("start-file", cycle_fullscreen)
mp.register_event("file-loaded", cycle_fullscreen)

which basically just makes mpv toggle fullscreen twice when opening a file.

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Jun 3, 2015

Actually, scratch that, as it causes other problems and may even hang mpv.

@wm4

This comment has been minimized.

Contributor

wm4 commented Jun 3, 2015

What does --script-opts=showwindowed=no actually do? Seems to do nothing here.

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Jun 3, 2015

@wm4 Should be --script-opts=osc-showwindowed=no instead. The osc- prefix was left out before (not sure if I just forgot to write it or if the requirement came after the issue was opened).

@vitorgalvao vitorgalvao changed the title from Window dragging doesn’t work correctly on OS X when using showwindowed=no to Window dragging doesn’t work on OS X until the OSC has been activated at least once Jun 3, 2015

@vitorgalvao

This comment has been minimized.

Contributor

vitorgalvao commented Jun 3, 2015

@wm4 Actually, looking further into it, it appears the issue can be more accurately described as “window dragging doesn’t work on OS X until the OSC has been activated at least once”. I’ve updated the title and top post to reflect that.

@wm4 wm4 added bug stalled labels Jul 18, 2015

@Akemi

This comment has been minimized.

Member

Akemi commented Dec 12, 2016

i investigated the issue and the problem is that the function mp_input_test_dragging used in recalcMovableByWindowBackground always returns true, when used with --script-opts=osc-showwindowed=no. it should return false in that case. there seems to be a mouse area active in the OSC which leads to this problem. when cycling the visibility options of the OSC (O script_message osc-visibility cycle) to 'never' an area seem to be properly set and the function returns the right value as expected.

so this isn't an OSX bug per se.

Akemi added a commit to Akemi/mpv that referenced this issue Feb 19, 2017

osc: fix window dragging with showwindowed=no
initialise OSC with a zero mouse area so mp_input_test_dragging returns
a proper value.

Fixes mpv-player#1819

@Akemi Akemi closed this in 55fb4cb Feb 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment