File browser puts focus on wrong window after closing the dialog #72693

Closed
opened 2019-12-25 20:21:24 +01:00 by Vanessa Dannenberg · 11 comments

System Information
Applies to all operating systems

Blender Version
Broken: 2.81a
Worked: 2.80 (Before the new file browser)

Short description of error

Closing the file browser puts the focus on the newest child window, disregarding which window was originally in focus before the file browser was opened.

Exact steps for others to reproduce the error

  • Create a new window through Window > New Window
  • Focus on the original main window

Open a file browser dialog, e.g. through File > Append and close it


The focus switches to the child window, even though the dialog was started from there.

**System Information** Applies to all operating systems **Blender Version** Broken: 2.81a Worked: 2.80 (Before the new file browser) **Short description of error** Closing the file browser puts the focus on the newest child window, disregarding which window was originally in focus before the file browser was opened. **Exact steps for others to reproduce the error** - Create a new window through *Window > New Window* - Focus on the original main window # Open a file browser dialog, e.g. through *File > Append* and close it ``` ``` The focus switches to the child window, even though the dialog was started from there.

Added subscriber: @VanessaE

Added subscriber: @VanessaE

Added subscriber: @rjg

Added subscriber: @rjg

Thank you for the new report, I can reproduce this behavior. The missing key fact was that you don't close the image editor window. The behavior is not exclusive to the exporting of .STLs, it affects all file browser dialogs. It seems the most recently created window, that is a child of a main window, is getting the focus afterwards.

A simpler test is to create two new windows through Window > New Window with adjusted perspective in the 3D view in order to keep track what the most recently created one is. Select the main window and open a file browser windows, e.g. through File > Append and close it by pressing Cancel. The most recently created child window always gets the focus afterwards. This does not apply to a new main window created through Window >New Main Window when there aren't any new child windows yet. When opening and closing the file browser on the new main window it will still returns to the last child window of the original main window. When a child window for the new main window is created through Window > New Window, it will jump this one as well when the test is repeated.

Thank you for the new report, I can reproduce this behavior. The missing key fact was that you don't close the image editor window. The behavior is not exclusive to the exporting of .STLs, it affects all file browser dialogs. It seems the most recently created window, that is a child of a main window, is getting the focus afterwards. A simpler test is to create two new windows through *Window > New Window* with adjusted perspective in the 3D view in order to keep track what the most recently created one is. Select the main window and open a file browser windows, e.g. through *File > Append* and close it by pressing *Cancel*. The most recently created child window always gets the focus afterwards. This does not apply to a new main window created through *Window >New Main Window* when there aren't any new child windows yet. When opening and closing the file browser on the new main window it will still returns to the last child window of the original main window. When a child window for the new main window is created through *Window > New Window*, it will jump this one as well when the test is repeated.

Ah, yes, I noticed that behavior as well (in my case, opening the user preferences will re-use other windows such as the Image Editor, if it's open)

Ah, yes, I noticed that behavior as well (in my case, opening the user preferences will re-use other windows such as the Image Editor, if it's open)
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I can reproduce the behavior using the steps described by @rjg.
However, before this task should be confirmed, the task title and description should be updated to reflect the actual bug better to help the developer who is going to work on this.

I can reproduce the behavior using the steps described by @rjg. However, before this task should be confirmed, the task title and description should be updated to reflect the actual bug better to help the developer who is going to work on this.
Robert Guetzkow changed title from Export to STL pops-up Image Editor window to Focus switches to newest child window after closing file browser dialog, not the window that originally had the focus 2020-01-15 21:39:39 +01:00

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

Changed status from 'Needs Triage' to: 'Confirmed'
Robert Guetzkow changed title from Focus switches to newest child window after closing file browser dialog, not the window that originally had the focus to File Browser switches focus to wrong window after closing dialog 2020-01-15 21:40:54 +01:00
Robert Guetzkow changed title from File Browser switches focus to wrong window after closing dialog to File browser puts focus on wrong window after closing the dialog 2020-01-15 21:41:41 +01:00
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

The reported issue is caused by this workaround: https://developer.blender.org/diffusion/B/browse/master/source/blender/windowmanager/intern/wm_window.c$439

When opening the file browser, we register it in the OS as dialog window - as of now, it's the only kind of window we do that for. For that to work we also need to assign the window to a "parent" window (loosely speaking) to the OS. Now, the OS typically takes over the ordering of windows, moving other non-dialog windows like the Preferences to the back, so that the dialog window and its parent are in front. That makes it seem like the preferences got closed. The workaround is, that we just move other windows back in front when closing a dialog window (i.e. file browser).

Maybe we could workaround this issue too, i.e. by keeping a window selection history. However before too long, we should look into improving our dialog and secondary window behavior, see #69819. With that done, the window ordering workaround that causes this issue can be removed.
So I don't think it's worth the hassle of introducing a temporary workaround for this temporary workaround.
Marking this as "Known Issue".

The reported issue is caused by this workaround: https://developer.blender.org/diffusion/B/browse/master/source/blender/windowmanager/intern/wm_window.c$439 When opening the file browser, we register it in the OS as dialog window - as of now, it's the only kind of window we do that for. For that to work we also need to assign the window to a "parent" window (loosely speaking) to the OS. Now, the OS typically takes over the ordering of windows, moving other non-dialog windows like the Preferences to the back, so that the dialog window and its parent are in front. That makes it seem like the preferences got closed. The workaround is, that we just move other windows back in front when closing a dialog window (i.e. file browser). Maybe we could workaround this issue too, i.e. by keeping a window selection history. However before too long, we should look into improving our dialog and secondary window behavior, see #69819. With that done, the window ordering workaround that causes this issue can be removed. So I don't think it's worth the hassle of introducing a temporary workaround for this temporary workaround. Marking this as "Known Issue".

This issue was referenced by 796412dca0

This issue was referenced by 796412dca0a54a0f35400ea8ebf7a99ce891080d
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Julian Eisel self-assigned this 2020-05-20 17:12:49 +02: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
5 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#72693
No description provided.