On OS X, when switching from another app to Blender via Mission Control, it doesn't work. #42305
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#42305
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: OS X 10.9.5
Graphics card: NVIDIA GeForce GT 650M 1024 MB
Blender Version
Broken: I have seen it since 2.69.0 to 2.72a (haven't tested it on any version prior 2.69.0)
Short description of error
On OS X, when switching from another app to Blender via Mission Control (the OS X feature that spreads out in your screen every window/app you have open) it doesn't switch. Blender kind of hides in the back, you need to repeat the process and then it works fine. Here is a dropbox link to a quick video for easier understanding, sorry if I can't explain myself with words:
Exact steps for others to reproduce the error
With Blender opened, switch to another app, then via Mission Control select Blender. It will hide itself.
Changed status to: 'Open'
Added subscriber: @claudio-10
Added subscriber: @FloridaJo
I can't recreate that here on OS X 10.10 AMD Radeon HD 6770M 512 MB.
Forgot to mention this is a retina display. I remember not so long ago there was a weird error when adding nodes (the nodes didn't add where the cursor was) that only happened on a retina display. Maybe this also happens only on a retina display? Also, this only happens with Blender.
Thanks for your help.
Cannot reproduce here on MacPro with AMD gpu atm.
Can only guess its something with retina and backbuffer
preventing Blender to be frontmost app on the first call.
Can somebody with NV try ?
Jens
Added subscribers: @ThomasDinges, @Sergey
@ThomasDinges, you've got mac for as long as i concerned.
Cannot confirm this either, I open Blender, go to Safari, then via Mission Control back to Blender, opens fine.
Added subscriber: @donfabio
I can actually reproduce this behavior and remember it bothering me in earlier versions of Blender...
I'm also on a 15" Retina MacBook Pro.
OS: OS X 10.10
Graphics: GeForce GT 750M
I tried to debug this issue on the current master branch. The event flow is exactly the same as if you would use command+tab (windowDidBecomeKey is received when switching to Blender and windowDidResignKey when switching to another application). It appears the window just gets ordered to the background. Repeating the Mission Control action orders the window on top (no additional windowDidBecomeKey is received).
Now I stumbled onto a weird solution for my system: I added a windowDidBecomeMain method to the CocoaWindowDelegate interface and this glitch doesn't appear anymore. I have no idea why, but it works for me.
FYI: the windowDidBecomeMain is received before windowDidBecomeKey message.
If you know how to compile Blender yourself I can provide you a patch so you can see if this works on your system, too.
Here's the patch: http://pastebin.com/v7Z8S3JR
Must look at this first.
Normally we prepend [m_window makeKeyAndOrderFront:nil]; just fine.
Looks as something with the retina backbuffer is fishy.
I remeber i can simulate retina on my nin-retina gfx too.
Must check this over.
Jens
I had a look at it again and you can forget my patch. It has nothing to do with the problem, sorry. I narrowed it down why it worked for me to a break point I had set which just prints the eventType in GHOST_SystemCocoa::handleWindowEvent without pausing execution... Disabling the break point leads to the old behavior. Replacing the break point with a printf statement has no effect on the glitch.
BTW: [m_window makeKeyAndOrderFront:nil] is only called once in the constructor
Joel, can you please help me ?
Simulating retina res, i can still not reproduce this issue.
Try add prints or NSLOG to check if the windowDidBecomeKey
reponds when switching. If so please try add an: [[NSApp keyWindow] orderFront:nil];
after: systemCocoa->handleWindowEvent(GHOST_kEventWindowActivate, associatedWindow);
Your patch would not harm afaik, but i would rather understand the rootproblem first.
Jens
[[NSApp keyWindow] orderFront:nil]; after systemCocoa->handleWindowEvent(GHOST_kEventWindowActivate, associatedWindow); didn't help.
As I said earlier windowDidBecomeKey is received just when clicking on the window in Mission Control. Then the window goes back to its previous order. Repeating this orders the window on top. No additional windowDidBecomeKey is received as if the window was already key. It appears the window is actually key even though other windows are on top (mouse overs are received). No intermittent windowDidResignKey is received.
I also tried low resolution mode via the checkbox in the info panel and the glitch is still reproduceable.
If you only use Mission Control to switch between windows this glitch does not appear. Only when you combine it with command+tab.
I could now reproduce this behavoiur by switching to another app with cmd-tab then with mission-control trying to go back.
Not sure if this is a system bug or if we can workaround this, anyway i beliece this is a cornercase in usage.
Tetsing some things ....
Jens
K, 'am 1 step further:
It has todo with mssioncontrol settings, if you disable the highestmost option ( duuno the exact engl. naming )
it goes away:
Now must lookup, if we can influence this from inside the app, but seems a known bug: http://apple.stackexchange.com/questions/108852/mavericks-window-loses-focus-on-cmdtab
Jens
I have the same options checked as you do but the glitch still appears...
Okay, i think i have a solution, try this patch pls:
Atm. checking if this has any unwanted impact.
Jens
patch was truncated -> corrected
This works. :)
But it doesn't really go to the root of this problem. Now the window disappears in the background and immediately comes to the top again which looks weird. Also if you have multiple Blender windows and you're in another App and click on one Blender window all Blender windows are brought to the top.
But I agree the issue might be that Blender doesn't get activated but the window still becomes key.
Also I found these:
http://stackoverflow.com/questions/3747715/nswindow-not-activating
http://stackoverflow.com/questions/10759920/cocoa-windows-spawned-from-carbon-windows-are-reordered-by-mission-control
http://apple.stackexchange.com/questions/108852/mavericks-window-loses-focus-on-cmdtab
Okay, try this, i think this is the right appoach:
This still has the problem that it orders ALL Blender windows on top.
What works for me is this:
[(NSWindow*)associatedWindow->getOSWindow() orderFrontRegardless];
in windowDidBecomeKey
Interestingly [NSApp keyWindow] is nil in windowDidBecomeKey which looks to me like a bug...
Do u use the "seperate spaces" option ?
Jens
I adjusted my settings so they match yours. So I have "Monitore verwenden verschiedene Spaces" deactivated. Why do you ask?
Edit: tested with the option activated: works, too.
Just to assure we are talking about same prelimnaries.
Your tweak looks best atm., i compared with document based apps and the behaviour looks same ( textedit with several docs open ).
So perhaps we can use you diff after checking once over (?).
Jens
Well there's still a small flicker sometimes as if the window gets put to the back in one frame and then to the top. It isn't perfect but basically it works...
Didn't notice, we should get rid of any flicker i think.
Jens
I recorded a video of the flicker. It's just one frame. Also it doesn't always appear.
http://fabioarnold.de/videos/glitch.mov
I just did an update on OS X to 10.10 version. I didn't do a clean installation, I kept every program and settings, and the error seems to be gone. I tried 2.71, 2.72, 2.72a, 2.72b and now I don't get the error. I don't know what this might tell you about the error.
Ok so I don't know what is happening but as soon as I sent the last message I started to get the error again on 2.72b.
Please note the exact steps to reproduce this problem are:
The Blender window should animate into position and before it finally arrives it will be ordered back into its old position.
Sorry, was away for some hours.
I must investigate this still a bit, it is not such imminent issue i think,
We should aim a clean solution for 2.73 though.
Jens
This issue was referenced by
8dbce41706
Changed status from 'Open' to: 'Resolved'
Closed by commit
8dbce41706
.