Blender does not react to a file being opened from finder on a different desktop (MacOS) #70039

Closed
opened 2019-09-18 20:03:16 +02:00 by Wouter Stomp · 21 comments

System Information
Operating system: Darwin-18.7.0-x86_64-i386-64bit 64 Bits
Graphics card: Intel(R) Iris(TM) Graphics 540 Intel Inc. 4.1 INTEL-12.10.12

Blender Version
Broken: version: 2.80 and 2.81 (sub 11), branch: master, commit date: 2019-09-16 21:02, hash: 76650402f3
Worked: unknown

Short description of error
On MacOS when you try to open any .blend file from finder, when Blender is already running on a different desktop (workspace, also when it is running fullscreen), nothing happens (except for the menu bar saying blender until you click somewhere else). When opened from the same desktop space, the blend files open as expected.

Exact steps for others to reproduce the error
Have a Blender window open regular or fullscreen.
On a different desktop, from finder click a blend file to try to open it. Blender does not react to this.

**System Information** Operating system: Darwin-18.7.0-x86_64-i386-64bit 64 Bits Graphics card: Intel(R) Iris(TM) Graphics 540 Intel Inc. 4.1 INTEL-12.10.12 **Blender Version** Broken: version: 2.80 and 2.81 (sub 11), branch: master, commit date: 2019-09-16 21:02, hash: `76650402f3` Worked: unknown **Short description of error** On MacOS when you try to open any .blend file from finder, when Blender is already running on a different desktop (workspace, also when it is running fullscreen), nothing happens (except for the menu bar saying blender until you click somewhere else). When opened from the same desktop space, the blend files open as expected. **Exact steps for others to reproduce the error** Have a Blender window open regular or fullscreen. On a different desktop, from finder click a blend file to try to open it. Blender does not react to this.
Author

Added subscriber: @blenderrocket

Added subscriber: @blenderrocket
Member

Added subscriber: @ankitm

Added subscriber: @ankitm

Added subscriber: @sebbas

Added subscriber: @sebbas

@blenderrocket I cannot reproduce this with the latest master (95ca3f6). Can you please confirm that this is still an issue for you?

@blenderrocket I cannot reproduce this with the latest master (95ca3f6). Can you please confirm that this is still an issue for you?
Author

The issue still occurs for me with 2.82 alpha 2019-12-03

The issue still occurs for me with 2.82 alpha 2019-12-03
Member

Another relevant thing: when using the {key command W} shortcut, it closes the current window, but also quits blender. Most apps on macOS keep the option for keeping the app open but all windows closed, thus giving purpose to {key command Q}.

Another relevant thing: when using the {key command W} shortcut, it closes the current window, but also quits blender. Most apps on macOS keep the option for keeping the app open but all windows closed, thus giving purpose to {key command Q}.

Added subscriber: @jenkm

Added subscriber: @jenkm

@sebbas to be clear, here by "desktops" we mean Mission Control spaces.

@sebbas to be clear, here by "desktops" we mean Mission Control spaces.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Can you make a short screen recording that shows the issue in the latest build, please?

Can you make a short screen recording that shows the issue in the latest build, please?
[blender.mov](https://archive.blender.org/developer/F8292061/blender.mov) [affinity.mov](https://archive.blender.org/developer/F8292060/affinity.mov)
Member

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Member

@jenkm not that you needed to make them fullscreen, just put blender (in normal mode) to desktop 2 with the default file, and open another file from finder in desktop 1. Fullscreen apps are not highly reliable, not even Safari.

The file gives the boom effect of being opened, in the Finder, but neither it opens nor does the app changes desktop.

@jenkm not that you needed to make them fullscreen, just put blender (in normal mode) to desktop 2 with the default file, and open another file from finder in desktop 1. Fullscreen apps are not highly reliable, not even Safari. The file gives the boom effect of being opened, in the Finder, but neither it opens nor does the app changes desktop.

Oh! exactly, it should also switch to another desktop, an unsuccessful example with an Affinity Photo (also a bug).

safari.mov

Oh! exactly, it should also switch to another desktop, an unsuccessful example with an Affinity Photo (also a bug). [safari.mov](https://archive.blender.org/developer/F8292537/safari.mov)

Added subscriber: @brecht

Added subscriber: @brecht

Okay, this issue is easy to reproduce, just minimize Blender and try to open the file from Finder.

Caused by the absence of an active window:

lang= objc
  GHOST_Window *window = (GHOST_Window *)m_windowManager->getActiveWindow();

  if (!window) {
    return NO;
  }

It works with changes like this:

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index e50e478b9fc..410c6c5b6b6 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1370,6 +1370,13 @@ - (void)windowWillClose:(NSNotification *)notification
   NSArray *windowsList;
   char *temp_buff;
   size_t filenameTextSize;
+
+  // Check for blender opened windows and make the frontmost key.
+  windowsList = [NSApp orderedWindows];
+  if ([windowsList count]) {
+    [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil];
+  }
+
   GHOST_Window *window = (GHOST_Window *)m_windowManager->getActiveWindow();
 
   if (!window) {

CC @brecht

Okay, this issue is easy to reproduce, just minimize Blender and try to open the file from Finder. Caused by the absence of an active window: ``` lang= objc GHOST_Window *window = (GHOST_Window *)m_windowManager->getActiveWindow(); if (!window) { return NO; } ``` It works with changes like this: ``` diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index e50e478b9fc..410c6c5b6b6 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1370,6 +1370,13 @@ - (void)windowWillClose:(NSNotification *)notification NSArray *windowsList; char *temp_buff; size_t filenameTextSize; + + // Check for blender opened windows and make the frontmost key. + windowsList = [NSApp orderedWindows]; + if ([windowsList count]) { + [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil]; + } + GHOST_Window *window = (GHOST_Window *)m_windowManager->getActiveWindow(); if (!window) { ``` CC @brecht

@jenkm a fix like this seems fine, but this function already has this same code a few lines lower. Can we just move that up instead of having it twice?

@jenkm a fix like this seems fine, but this function already has this same code a few lines lower. Can we just move that up instead of having it twice?

No, it is also necessary after the confirm box closing, but #68707.

No, it is also necessary after the confirm box closing, but #68707.

This issue was referenced by 2fb9285371

This issue was referenced by 2fb928537104ec5a5060c29a6bc253906ff8a3dc

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Brecht Van Lommel self-assigned this 2020-02-11 17:45:36 +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
7 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#70039
No description provided.