Giter Club home page Giter Club logo

Comments (5)

AeioMuch avatar AeioMuch commented on August 15, 2024

Bisected #92424 as the first bad commit.

from godot.

kitbdev avatar kitbdev commented on August 15, 2024

I can't reproduce (Godot v4.3.beta (475248d) - Windows 10.0.22631 - Vulkan (Forward+)).
But it looks like TextEdit is receiving mouse unpressed and pressed notifications when you didn't actually release the mouse button.
Does this also affect actions like panning or selecting in the scene view, or using ui sliders, or is it only the script editor?

from godot.

alvinhochun avatar alvinhochun commented on August 15, 2024

Bisected #92424 as the first bad commit.

Thanks for bisecting. I suspect it is because the patch uses GetAsyncKeyState instead of GetKeyState. Hypothetically, if one press the mouse button while moving the cursor, the window could be receiving these messages (pseudo code):

  1. MouseMove, buttons=None, xy=(100, 100)
  2. MousePress(Left), buttons=LeftMouse, xy=(101, 101)
  3. MouseMove, buttons=LeftMouse, xy=(102, 102)

When the application processes the first message, it is possible that the user has already pressed the mouse button so GetAsyncKeyState(VK_LBUTTON) may indicate the mouse button is pressed, different from what the message represents. More importantly it would indicate the mouse button being held down before the MousePress message had been processed. If the control relies on the MousePress message to initialize states related to text selection, it could explain the bug. (This is just a hypothesis -- I haven't checked what is happening within Godot.)

I think it really should use GetKeyState instead.


I can't reproduce [...]. But it looks like TextEdit is receiving mouse unpressed and pressed notifications when you didn't actually release the mouse button. [...]

In my capture, when the selection stops changing I definitely released the left mouse button. If my hypothesis above is correct, then the key point is that the mouse must be moving when pressing the mouse button to reproduce the bug.

If you really need to verify, I can make a capture with an OSD showing the mouse buttons (though I don't currently have a tool for this so I'll need to hunt for one).

from godot.

KoBeWi avatar KoBeWi commented on August 15, 2024

Can confirm in v4.3.beta.custom_build [475248d]
Windows 10.0.19045

from godot.

kitbdev avatar kitbdev commented on August 15, 2024

I misunderstood earlier, I can reproduce it now while moving the mouse.

Adding logpoints show that a mouse motion event with the left mouse button down is being sent before the mouse pressed event.

image

Created a PR #93105 that uses GetKeyState as suggested.

from godot.

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.