Python API - Modal operator losing context.area after focus is stolen #64216

Open
opened 2019-05-06 21:26:09 +02:00 by eldee smith · 5 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.77

Blender Version
Broken: version: 2.80 (sub 58), branch: master, commit date: 2019-04-23 17:06, hash: f32902e6da
Worked: (optional)

Short description of error
When focus is stolen (for example, when the user uses Ctrl+S and the file browser dialog pops up), a running modal operator will lose the context.area and it never returns even after the dialog has been closed.

Exact steps for others to reproduce the error
Run the attached modal operator from a VIEW_3D area, without pressing RMB or Escape (which will cancel the operator), bring up the Save File dialog. Watch the console output- it will change from VIEW_3D to "no context area" because the dialog has focus and the area is no longer valid, but when you Cancel the file save operation, you would expect the context.area to return but it never does. You must cancel the operator and restart it.modal_area_focus_bug.py

**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.77 **Blender Version** Broken: version: 2.80 (sub 58), branch: master, commit date: 2019-04-23 17:06, hash: `f32902e6da` Worked: (optional) **Short description of error** When focus is stolen (for example, when the user uses Ctrl+S and the file browser dialog pops up), a running modal operator will lose the context.area and it never returns even after the dialog has been closed. **Exact steps for others to reproduce the error** Run the attached modal operator from a VIEW_3D area, without pressing RMB or Escape (which will cancel the operator), bring up the Save File dialog. Watch the console output- it will change from VIEW_3D to "no context area" because the dialog has focus and the area is no longer valid, but when you Cancel the file save operation, you would expect the context.area to return but it never does. You must cancel the operator and restart it.[modal_area_focus_bug.py](https://archive.blender.org/developer/F7010619/modal_area_focus_bug.py)
Author

Added subscriber: @testure

Added subscriber: @testure
Campbell Barton was assigned by Sebastian Parborg 2019-05-07 12:01:46 +02:00
Campbell Barton was unassigned by Dalai Felinto 2019-12-23 16:34:30 +01:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Added subscriber: @mont29

Added subscriber: @mont29

Will consider that as a known issue for now, I suspect that won't be trivial to fix (file saving is also an operator, I don’t really have an idea of how modal ops are supposed to be handled in those cases…).

Will consider that as a known issue for now, I suspect that won't be trivial to fix (file saving is also an operator, I don’t really have an idea of how modal ops are supposed to be handled in those cases…).

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:25:49 +01:00
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
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
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#64216
No description provided.