Fix #66722: Blender doesn't open file if isn't focused #106769
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
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
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106769
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ankitm:66722"
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?
After double clicking a file, user can click on a different app and
Blender will lose focus. Then it stays on splash screen. So fetch any
window instead of relying on active one.
--
This fixes the bug, but need to investigate if there is any better: Scenarios tested:window to choose.
double click.
In some other PR, would like to remove other behaviour dependent
on active window and not put Blender at the front even if
some other app has focus. Similar to Firefox.
66722to Fix #66722: Blender doesn't open file if isn't focusedJust mentioning that on the Windows platform we steal focus a few different times during startup so it is basically impossible for a different app to remain in focus between launching Blender and having it fully loaded. I remember one bug report that complained about this behavior, but otherwise it feels fairly normal compared to other programs.
On mac, on lower end machines like mine, starting blender and then switching desktop is common for me. But instead of staying on older desktop, Blender shows up on the new one.
I can pin it to one desktop, but then at launch even the desktop changes to Blender's.
https://apple.stackexchange.com/questions/394603/how-do-you-prevent-launched-apps-from-taking-focus
https://apple.stackexchange.com/questions/428522/prevent-all-apps-in-macos-from-stealing-focus
https://superuser.com/questions/56589/is-there-a-way-in-mac-os-x-to-stop-applications-from-stealing-focus-especially
https://apple.stackexchange.com/questions/355431/avoid-apps-from-stealing-focus-in-macos
https://apple.stackexchange.com/questions/123448/os-x-how-to-have-starting-applications-optionally-not-take-the-focus
Will discuss it later in detail
Fix #66722: Blender doesn't open file if isn't focusedto WIP: Fix #66722: Blender doesn't open file if isn't focusedWIP: Fix #66722: Blender doesn't open file if isn't focusedto Fix #66722: Blender doesn't open file if isn't focusedWe should avoid stealing focus, and indeed, for file opening that shouldn't be needed. File loading should work with any window.
Haven't tested this but makes sense to me.
@ -1403,1 +1403,3 @@
GHOST_Window *window = (GHOST_Window *)m_windowManager->getActiveWindow();
GHOST_Window *window = m_windowManager->getWindows().empty() ?
NULL :
(GHOST_Window *)m_windowManager->getWindows().back();
It shouldn't matter much, but I would use the first, not the last window here. Just because that would always be a main window I think, not a child window, and this makes more sense to me conceptually.
Pull request closed