GithubHelp home page GithubHelp logo

Comments (4)

low-batt avatar low-batt commented on June 6, 2024

This is the code in PlaylistView that changes the cursor:

  override func resetCursorRects() {
    let rect = NSRect(x: frame.origin.x - 4, y: frame.origin.y, width: 4, height: frame.height)
    addCursorRect(rect, cursor: .resizeLeftRight)
  }

This code is working under macOS Catalina, but not under macOS Ventura

In this case I do not think this is a macOS defect. I believe that code is violating the following requirement specified in the documentation for addCursorRect:

You should explicitly confine a cursor rectangle to the view's visible rectangle to prevent improper behavior.

The "- 4" puts the rectangle outside of the view's frame. I suspect this is the source of the problem.

from iina.

uiryuu avatar uiryuu commented on June 6, 2024

Not directly related to this issue, but I think a range of -2 ~ 2 instead of -4 ~ 0 would be better

from iina.

low-batt avatar low-batt commented on June 6, 2024

Remember I'm not a GUI programmer, so always question my understanding of AppKit…

The suggestion is to have the resizing area span the border. That makes logical sense and might be what users expect. The downside is that it doubles the implementation required if the approach uses resetCursorRects as it would span views.

I've been searching the net for best practices and so far I've not found a discussion of this. My guess would be that the normal way this is handled is that the area would be fully inside the view. If you think about resizing a window you would have to have the area poke outside of the window. Is that easy to do?

Today I remembered the PR #4472 by @svobs that attempts to address the cursor issue. I don't think it was noticed that IINA has code to do this that works in macOS 10.15.7. The approach taken by this PR is probably better than what I was experimenting with. Need to check in with @svobs on this, however this issue is not as important as getting some of the other PRs updated and merged.

from iina.

svobs avatar svobs commented on June 6, 2024

Today I remembered the PR #4472 by @svobs that attempts to address the cursor issue. I don't think it was noticed that IINA has code to do this that works in macOS 10.15.7.

Yes I've found that using NSPointInRect is a much better approach than using a cursor rect or mouse tracking areas, which could have been the first solutions some developer scribbled on the whiteboard when the mouse was being invented. It won't work outside the window's bounds though. I haven't yet found a way to do that.

from iina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.