Crash when right clicking certain, nested, popup dialogs #114436

Closed
opened 2023-11-03 06:25:33 +01:00 by Jesse Yurkovich · 5 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 528.24

Blender Version
Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-11-03 01:01, hash: 5d765a0d31a1
Worked: 3.6.5

Caused by 088d7a0bdd

Short description of error
Crash when right clicking certain, nested, popup dialogs. Unsure how far-reaching this is or if it's only limited to the dialog below.

Exact steps for others to reproduce the error

  • Open blender
  • Click File -> Defaults -> Save Startup File
  • A popup asking for confirmation will appear with "Save Startup File" as the only entry
  • Right click that entry
Stack trace:
blender.exe         :0x00007FF65CD32030  ui_region_winrct_get_no_margin
blender.exe         :0x00007FF65CD97E80  ui_region_contains_point_px
blender.exe         :0x00007FF65CD980B0  ui_view_item_find_mouse_over
blender.exe         :0x00007FF65CD58F40  ui_do_button
blender.exe         :0x00007FF65CD5A730  ui_handle_button_event
blender.exe         :0x00007FF65CD5B5F0  ui_handle_menu_button
blender.exe         :0x00007FF65CD5B790  ui_handle_menu_event
blender.exe         :0x00007FF65CD5C8D0  ui_handle_menus_recursive
blender.exe         :0x00007FF65CD617D0  ui_popup_handler
**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 528.24 **Blender Version** Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-11-03 01:01, hash: `5d765a0d31a1` Worked: 3.6.5 Caused by 088d7a0bdd8e341830f015c82834749ef90ed2ff **Short description of error** Crash when right clicking certain, nested, popup dialogs. Unsure how far-reaching this is or if it's only limited to the dialog below. **Exact steps for others to reproduce the error** - Open blender - Click `File` -> `Defaults` -> `Save Startup File` - A popup asking for confirmation will appear with "Save Startup File" as the only entry - Right click that entry ``` Stack trace: blender.exe :0x00007FF65CD32030 ui_region_winrct_get_no_margin blender.exe :0x00007FF65CD97E80 ui_region_contains_point_px blender.exe :0x00007FF65CD980B0 ui_view_item_find_mouse_over blender.exe :0x00007FF65CD58F40 ui_do_button blender.exe :0x00007FF65CD5A730 ui_handle_button_event blender.exe :0x00007FF65CD5B5F0 ui_handle_menu_button blender.exe :0x00007FF65CD5B790 ui_handle_menu_event blender.exe :0x00007FF65CD5C8D0 ui_handle_menus_recursive blender.exe :0x00007FF65CD617D0 ui_popup_handler ```
Jesse Yurkovich added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2023-11-03 06:25:34 +01:00
Member

Yes, can confirm the crash.

Caused by 088d7a0bdd

@JulianEisel ^

Yes, can confirm the crash. > Caused by 088d7a0bdd @JulianEisel ^
Pratik Borhade added this to the 4.0 milestone 2023-11-03 07:45:16 +01:00
Member

Not sure if this is fine for all scenarios, but using uiHandleButtonData's region seems to work fine here

diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc
index 0284ef5b700..5465d14f8c0 100644
--- a/source/blender/editors/interface/interface_handlers.cc
+++ b/source/blender/editors/interface/interface_handlers.cc
@@ -8054,9 +8054,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
        * Apply the button immediately, so context menu polls get the right active item. */
       uiBut *clicked_view_item_but = but->type == UI_BTYPE_VIEW_ITEM ?
                                          but :
-                                         ui_view_item_find_mouse_over(region, event->xy);
+                                         ui_view_item_find_mouse_over(but->active->region, event->xy);
       if (clicked_view_item_but) {
-        UI_but_execute(C, region, clicked_view_item_but);
+        UI_but_execute(C, but->active->region, clicked_view_item_but);
       }
 
       /* RMB has two options now */
Not sure if this is fine for all scenarios, but using `uiHandleButtonData`'s region seems to work fine here ``` diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index 0284ef5b700..5465d14f8c0 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -8054,9 +8054,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * * Apply the button immediately, so context menu polls get the right active item. */ uiBut *clicked_view_item_but = but->type == UI_BTYPE_VIEW_ITEM ? but : - ui_view_item_find_mouse_over(region, event->xy); + ui_view_item_find_mouse_over(but->active->region, event->xy); if (clicked_view_item_but) { - UI_but_execute(C, region, clicked_view_item_but); + UI_but_execute(C, but->active->region, clicked_view_item_but); } /* RMB has two options now */ ```
Member

Similar to !114363 ^^

Similar to !114363 ^^
Julian Eisel was assigned by Dalai Felinto 2023-11-03 16:29:26 +01:00
Member

Not sure if this is fine for all scenarios, but using uiHandleButtonData's region seems to work fine here

diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc
index 0284ef5b700..5465d14f8c0 100644
--- a/source/blender/editors/interface/interface_handlers.cc
+++ b/source/blender/editors/interface/interface_handlers.cc
@@ -8054,9 +8054,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
        * Apply the button immediately, so context menu polls get the right active item. */
       uiBut *clicked_view_item_but = but->type == UI_BTYPE_VIEW_ITEM ?
                                          but :
-                                         ui_view_item_find_mouse_over(region, event->xy);
+                                         ui_view_item_find_mouse_over(but->active->region, event->xy);
       if (clicked_view_item_but) {
-        UI_but_execute(C, region, clicked_view_item_but);
+        UI_but_execute(C, but->active->region, clicked_view_item_but);
       }
 
       /* RMB has two options now */

That seems mostly correct, except that data->region should be used, instead of but->active->region. This way events can be sent to buttons that are not active (by passing custom uiHandleButtonData as data for a non-active button). We're not strict enough about this yet though.

> Not sure if this is fine for all scenarios, but using `uiHandleButtonData`'s region seems to work fine here > > > ``` > diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc > index 0284ef5b700..5465d14f8c0 100644 > --- a/source/blender/editors/interface/interface_handlers.cc > +++ b/source/blender/editors/interface/interface_handlers.cc > @@ -8054,9 +8054,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * > * Apply the button immediately, so context menu polls get the right active item. */ > uiBut *clicked_view_item_but = but->type == UI_BTYPE_VIEW_ITEM ? > but : > - ui_view_item_find_mouse_over(region, event->xy); > + ui_view_item_find_mouse_over(but->active->region, event->xy); > if (clicked_view_item_but) { > - UI_but_execute(C, region, clicked_view_item_but); > + UI_but_execute(C, but->active->region, clicked_view_item_but); > } > > /* RMB has two options now */ > ``` That seems mostly correct, except that `data->region` should be used, instead of `but->active->region`. This way events can be sent to buttons that are not active (by passing custom `uiHandleButtonData` as `data` for a non-active button). We're not strict enough about this yet though.
Member

@JulianEisel : do you want to handle? (otherwise I can try to make a PR -- not sure though if you mean passing in uiHandleButtonData from everywhere to ui_do_button? atm. data is just retrieved as but->active at the beginning of ui_do_button)

@JulianEisel : do you want to handle? (otherwise I can try to make a PR -- not sure though if you mean passing in `uiHandleButtonData` from everywhere to `ui_do_button`? atm. data is just retrieved as `but->active` at the beginning of `ui_do_button`)
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-06 21:54:43 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#114436
No description provided.