Continuous grab is broken 2.92.0 Alpha macOS #82870

Closed
opened 2 years ago by jenkm · 15 comments
jenkm commented 2 years ago

System Information
Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 455 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18

Blender Version
Broken: version: 2.92.0 Alpha, Fri, Nov 20, 14:41, 96995b2343.
Worked: ~

Short description of error
When the cursor crosses the editor border, the value jumps/doubles.
It doesn't matter if it's a tablet, mouse, or trackpad.

This problem is also present in previous versions (at least in 2.83 it definitely is)
but after 96200110eb it began to happen all the time.

Actually there is a report for Windows #59836, but it's set to just todo.

continuous-grab-issue.mov

Here's what I see, this is a normal case:

GHOST x_mouse 558
GHOST x_accum 0 
GHOST warped_x_mouse 558 
WM    event.x 1116

GHOST x_mouse 559
GHOST x_accum 0 
GHOST warped_x_mouse 1 
WM    event.x 1118

GHOST x_mouse 1
GHOST x_accum 558 
GHOST warped_x_mouse 1 
WM    event.x 1118

And this is the wrong one:

GHOST x_mouse 558
GHOST x_accum 0 
GHOST warped_x_mouse 558 

WM    event.x 1116

GHOST x_mouse 559
GHOST x_accum 0 
GHOST warped_x_mouse 1 

GHOST x_mouse 559
GHOST x_accum 558 <--- !!!
GHOST warped_x_mouse 1 

WM    event.x 1118
WM    event.x 2234

CC @brecht

**System Information** Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 455 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18 **Blender Version** Broken: version: 2.92.0 Alpha, Fri, Nov 20, 14:41, `96995b2343`. Worked: ~ **Short description of error** When the cursor crosses the editor border, the value jumps/doubles. It doesn't matter if it's a tablet, mouse, or trackpad. This problem is also present in previous versions (at least in 2.83 it definitely is) but after 96200110eb it began to happen all the time. Actually there is a report for Windows #59836, but it's set to just todo. [continuous-grab-issue.mov](https://archive.blender.org/developer/F9337447/continuous-grab-issue.mov) Here's what I see, this is a normal case: ``` GHOST x_mouse 558 GHOST x_accum 0 GHOST warped_x_mouse 558 WM event.x 1116 GHOST x_mouse 559 GHOST x_accum 0 GHOST warped_x_mouse 1 WM event.x 1118 GHOST x_mouse 1 GHOST x_accum 558 GHOST warped_x_mouse 1 WM event.x 1118 ``` And this is the wrong one: ``` GHOST x_mouse 558 GHOST x_accum 0 GHOST warped_x_mouse 558 WM event.x 1116 GHOST x_mouse 559 GHOST x_accum 0 GHOST warped_x_mouse 1 GHOST x_mouse 559 GHOST x_accum 558 <--- !!! GHOST warped_x_mouse 1 WM event.x 1118 WM event.x 2234 ``` CC @brecht
jenkm commented 2 years ago
Poster

Added subscribers: @brecht, @jenkm

Added subscribers: @brecht, @jenkm
jenkm commented 2 years ago
Poster

I mean, it seems that the value accumulates but the cursor position is not updated,
and at the next event, the previous cursor position is used and the position is again accumulated.

I mean, it seems that the value accumulates but the cursor position is not updated, and at the next event, the previous cursor position is used and the position is again accumulated.
Collaborator

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Collaborator

It seems to be a high priority issue.
I can't reproduce the problem on windows, in fact it seems to be MacOS specific.

It seems to be a high priority issue. I can't reproduce the problem on windows, in fact it seems to be MacOS specific.
brecht commented 2 years ago
Owner

Added subscriber: @PrototypeNM1

Added subscriber: @PrototypeNM1
brecht commented 2 years ago
Owner

I don't have time to look into this. @PrototypeNM1 or @jenkm worked on this and they would be the ones to look into a fix. If there is no quick fix, it's best to revert the patch until this issue is fixed.

Also @jenkm, as a developer you can triage the bug immediately and set appropriate tags, confirmation status and priority.

I don't have time to look into this. @PrototypeNM1 or @jenkm worked on this and they would be the ones to look into a fix. If there is no quick fix, it's best to revert the patch until this issue is fixed. Also @jenkm, as a developer you can triage the bug immediately and set appropriate tags, confirmation status and priority.
Collaborator

The equivalent Windows Ghost code tells the OS to update the mouse cursor position, then skips issuing a Ghost event as the OS will issue a new cursor move event with corrected position.

I think what's happening is that after wrapping/accumulating there remains stale mouse events in the OS event queue that previously would have been overwritten before the next event is issued. The only reason this hasn't surfaced on Windows is because inbetween mouse events aren't handled, only tablets.

The equivalent Windows Ghost code tells the OS to update the mouse cursor position, then skips issuing a Ghost event as the OS will issue a new cursor move event with corrected position. I think what's happening is that after wrapping/accumulating there remains stale mouse events in the OS event queue that previously would have been overwritten before the next event is issued. The only reason this hasn't surfaced on Windows is because inbetween mouse events aren't handled, only tablets.
jenkm commented 2 years ago
Poster

@brecht It was much better with these, (note 2.91 also has a similar regression, but less noticeable).

--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1590,7 +1590,7 @@ - (void)windowWillClose:(NSNotification *)notification
         }
         case GHOST_kGrabWrap:  // Wrap cursor at area/window boundaries
         {
-          NSPoint mousePos = [event locationInWindow];
+          NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream];
           GHOST_TInt32 x_mouse = mousePos.x;
           GHOST_TInt32 y_mouse = mousePos.y;
           GHOST_Rect bounds, windowBounds, correctedBounds;

9e85812acc


Also I think the navigation gizmos needs to use GHOST_kGrabHide not GHOST_kGrabWrap, this will completely fix the problem for them.

@brecht It was much better with these, (note 2.91 also has a similar regression, but less noticeable). ``` --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1590,7 +1590,7 @@ - (void)windowWillClose:(NSNotification *)notification } case GHOST_kGrabWrap: // Wrap cursor at area/window boundaries { - NSPoint mousePos = [event locationInWindow]; + NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream]; GHOST_TInt32 x_mouse = mousePos.x; GHOST_TInt32 y_mouse = mousePos.y; GHOST_Rect bounds, windowBounds, correctedBounds; ``` 9e85812acc *** Also I think the navigation gizmos needs to use GHOST_kGrabHide not GHOST_kGrabWrap, this will completely fix the problem for them.
jenkm commented 2 years ago
Poster

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
jenkm commented 2 years ago
Poster

OK, I found a third similar report #74918 and there was a fix for Linux d6fd03616e.
I will try to do the similar thing (use a time stamp and delay) for Mac.

And the fourth #75528.
And probably these, too #67362 #39144.

OK, I found a third similar report #74918 and there was a fix for Linux d6fd03616e. I will try to do the similar thing (use a time stamp and delay) for Mac. And the fourth #75528. And probably these, too #67362 #39144.
Collaborator

This issue was referenced by 9306e01b10

This issue was referenced by 9306e01b10cd0cad50179f68fe8c8fed1c86e4a1
seanr commented 2 years ago

Added subscriber: @seanr

Added subscriber: @seanr
seanr commented 2 years ago

I can confirm that @jenkm's fix in D9662 works well. 2.92 was utterly unusable without it, but it now appears to be performing even better than it did previously with the fix.

I can confirm that @jenkm's fix in [D9662](https://archive.blender.org/developer/D9662) works well. 2.92 was utterly unusable without it, but it now appears to be performing even better than it did previously with the fix.
brecht commented 2 years ago
Owner

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
brecht closed this issue 2 years ago
brecht self-assigned this 2 years ago

Added subscriber: @AgentSam-2

Added subscriber: @AgentSam-2
Sign in to join this conversation.
No Label
Interest/Alembic
Interest/Animation & Rigging
Interest/Asset Browser
Interest/Asset Browser Project Overview
Interest/Audio
Interest/Automated Testing
Interest/Blender Asset Bundle
Interest/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
Interest/Eevee & Viewport
Interest/Freestyle
Interest/Geometry Nodes
Interest/Grease Pencil
Interest/ID Management
Interest/Images & Movies
Interest/Import/Export
Interest/Line Art
Interest/Masking
Interest/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
Interest/Python API
Interest/Render & Cycles
Interest/Render Pipeline
Interest/Sculpt, Paint & Texture
Interest/Text Editor
Interest/Translations
Interest/Triaging
Interest/Undo
Interest/USD
Interest/User Interface
Interest/UV Editing
Interest/VFX & Video
Interest/Video Sequencer
Interest/Virtual Reality
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
Module › Animation & Rigging
Module › Core
Module › Development Management
Module › Eevee & Viewport
Module › Grease Pencil
Module › Modeling
Module › Nodes & Physics
Module › Pipeline, Assets & IO
Module › Platforms, Builds, Tests & Devices
Module › Python API
Module › Render & Cycles
Module › Sculpt, Paint & Texture
Module › Triaging
Module › User Interface
Module › VFX & Video
Platform/FreeBSD
Platform/Linux
Platform/macOS
Platform/Windows
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#82870
Loading…
There is no content yet.