Skip to content

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

Closed

Description

@vitorgalvao

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.

Activity

  1. Argon- commented on Apr 14, 2015

    @Argon-
    Member

    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.

  2. Nyx0uf commented on Apr 14, 2015

    @Nyx0uf
    Contributor

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

  3. ArPrt93 commented on Apr 14, 2015

    @ArPrt93

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

  4. vitorgalvao commented on Apr 14, 2015

    @vitorgalvao
    ContributorAuthor

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

  5. changed the title [-]Window dragging doesn’t work correctly on OSX[/-] [+]Window dragging doesn’t work correctly on OS X when using showwindowed=no[/+] on Apr 14, 2015
  6. Argon- commented on Apr 14, 2015

    @Argon-
    Member

    You are right, I can reproduce it as well.

  7. vitorgalvao commented on Apr 29, 2015

    @vitorgalvao
    ContributorAuthor

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

  8. vitorgalvao commented on Jun 2, 2015

    @vitorgalvao
    ContributorAuthor

    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.

  9. vitorgalvao commented on Jun 3, 2015

    @vitorgalvao
    ContributorAuthor

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

  10. vitorgalvao commented on Jun 3, 2015

    @vitorgalvao
    ContributorAuthor

    @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).

  11. changed the title [-]Window dragging doesn’t work correctly on OS X when using showwindowed=no[/-] [+]Window dragging doesn’t work on OS X until the OSC has been activated at least once[/+] on Jun 3, 2015
  12. vitorgalvao commented on Jun 3, 2015

    @vitorgalvao
    ContributorAuthor

    @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.

  13. ghost added on Jul 18, 2015
  14. Akemi commented on Dec 12, 2016

    @Akemi
    Member

    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.

  15. added a commit that references this issue on Feb 19, 2017
    4e9878f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions