Fix #112462: Panel buttons remain active after redrawing #112503
No reviewers
Labels
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
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
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
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
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
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 Info 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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112503
Loading…
Reference in New Issue
No description provided.
Delete Branch "LukasTonne/blender:fix-panel-button-sticky-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This seems to be an issue deep inside UI drawing code. The nodes render
the panel button in the correct place,
but it doesn't correctly update the button state after a redraw, unless
the mouse is moved. The button is still in a
BUTTON_STATE_HIGHLIGHT
state after drawing, and a mouse press will trigger it regardless of
where the mouse cursor actually is.
A common hack to force a reset of the button state is to add a fake
mouse move event using
WM_event_add_mousemove
.Never knew about this hack, but indeed looks reasonable given how this is used elsewhere. Will leave this to a UI dev to review though.
Does this mean that you are now just always redrawing the editor?
No, the
WM_event_add_mousemove
does not trigger a redraw, it just resets the button state so that a click event won't toggle the button.Hmm, I don't see this hack used in other drawing code.
Any idea why this is a problem now, or why it isn't a problem elsewhere?
It's only a problem when you don't move the mouse after hiding sockets and click, which is probably quite rare in practice. The issue only happens when buttons change location on redraw. This workaround was suggested by @JulianEisel who maybe knows other places this is used.
Could the workaround be applied in the place that hide sockets then, rather than being in every node redraw? Just think it being a bit more localized and close to the source of the problem might be better.
TBH, I wonder why
BUTTON_STATE_HIGHLIGHT
isn't cleared if the mouse isn't over the button anymore. But maybe that question is out of scope here :PAgreed with Hans here, this shouldn't be done in drawing. If it is really necessary it should be done by the handling, ie the operator in this case.