OSX: GUI left-click is broken after long Python script on startup #48283

Closed
opened 2016-04-27 00:14:51 +02:00 by George Anderson · 17 comments

OSX Yosemite (10.10.5)
Appears not to be an issue on Linux.

Broken: 2.73 and later
Worked: 2.72

After a Python script is run on startup that takes a while to complete, the GUI behaves peculiarly.

To reproduce, run from the command line

blender --factory-startup -P wait.py

where wait.py contains simply

import time
print("Pausing for a few seconds...")
time.sleep(7)

After it's finished, single left-clicking on GUI elements has no effect.

(Note that this happens about 90% of the time for me, but sometimes it inexplicably works.)

Several things still work normally:

  1. right-click
  2. mouse-over
  3. tool-tips

Also, I can still interact with GUI elements by double-left-clicking (or triple-left-clicking on submenus).

There is also a strange way to fix it --

  1. Change to a different application window
  2. Refocus Blender.

At this point the left-click works again.

OSX Yosemite (10.10.5) Appears **not** to be an issue on Linux. Broken: **2.73 and later** Worked: **2.72** After a Python script is run on startup that takes a while to complete, the GUI behaves peculiarly. To reproduce, run from the command line ``` blender --factory-startup -P wait.py ``` where wait.py contains simply ``` import time print("Pausing for a few seconds...") time.sleep(7) ``` After it's finished, single left-clicking on GUI elements has no effect. (Note that this happens about 90% of the time for me, but sometimes it inexplicably works.) Several things still work normally: 1) right-click 2) mouse-over 3) tool-tips Also, I can still interact with GUI elements by **double**-left-clicking (or triple-left-clicking on submenus). There is also a strange way to fix it -- 1) Change to a different application window 2) Refocus Blender. At this point the left-click works again.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @supergra

Added subscriber: @supergra

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Maybe OSX only, can't redo on Linux.

Maybe OSX only, can't redo on Linux.

That's correct, I can't reproduce on Linux either.

That's correct, I can't reproduce on Linux either.
Added subscribers: @MartijnBerger, @Sergey, @ThomasDinges, @jensverwiebe, @mont29

One thing to check would be to run Blender with --debug-events option, and look in console whether left-click reach our event loop or not (my guess would be they don’t, since re-focusing the window seems to be enough to fix the issue).

Then could be something like some initial event that gets lost while py script is running, and that prevents correct initialization in OSX handling from ghost…

We need a dev having access to OSX platform here, @ThomasDinges? @jensverwiebe? @MartijnBerger or @Sergey maybe?

One thing to check would be to run Blender with `--debug-events` option, and look in console whether left-click reach our event loop or not (my guess would be they don’t, since re-focusing the window seems to be enough to fix the issue). Then could be something like some initial event that gets lost while py script is running, and that prevents correct initialization in OSX handling from ghost… We need a dev having access to OSX platform here, @ThomasDinges? @jensverwiebe? @MartijnBerger or @Sergey maybe?

Here are two logs from running with --debug-events, where the problem was reproduced.

Example 1

Pausing for a few seconds...
ED_screen_refresh: set screen
found bundled python: /Users/ganders1/Applications/Blender.app/Contents/MacOS/../Resources/2.77/python
ghost_event_proc: ghost redraw 1
ED_screen_refresh: set screen
wm_event_add_ghostevent Send double click
wm_handlers_do_intern:       handled! 'VIEW3D_OT_cursor3d'
wm_event_add_ghostevent Send double click
wm_handlers_do_intern:       handled! 'VIEW3D_OT_cursor3d'
ghost_event_proc: window 1 state = normal
win move event pos 1065 -501 size 2560 1317
ED_screen_refresh: set screen
ghost_event_proc: window 1 state = normal
win move event pos 818 -183 size 2560 1317
ED_screen_refresh: set screen
Blender quit

Example 2

Pausing for a few seconds...
ED_screen_refresh: set screen
found bundled python: /Users/ganders1/Applications/Blender.app/Contents/MacOS/../Resources/2.77/python
ghost_event_proc: ghost redraw 1
ED_screen_refresh: set screen
wm_event_add_ghostevent Send double click
wm_handlers_do_intern:       handled! 'VIEW3D_OT_cursor3d'
wm_handlers_do_intern:       handled - and pass on! 'VIEW3D_OT_select'
wm_handlers_do_intern:       handled - and pass on! 'VIEW3D_OT_select'
wm_handlers_do_intern:       handled - and pass on! 'VIEW3D_OT_select'
wm_handlers_do_intern:       handled - and pass on! 'VIEW3D_OT_select'
ghost_event_proc: window 1 state = normal
win move event pos 847 0 size 2560 1317
ED_screen_refresh: set screen
wm_handlers_do_intern:       handled - and pass on! 'VIEW3D_OT_select'
ghost_event_proc: window 1 state = normal
win move event pos 692 -23 size 2560 1317
ED_screen_refresh: set screen
ghost_event_proc: ghost redraw 1
ED_screen_refresh: set screen
Saved session recovery to '/tmp/quit.blend'

Blender quit

In both cases I tried left-clicking various elements on splash screen, which had no effect. Then I double-clicked in the 3D view, which managed to be interpreted as a single-click, and the splash disappeared. I then tried left-clicking on various elements in the GUI. I then moved some objects with the RMB. Refocusing Blender fixed the problem.

Here are two logs from running with `--debug-events`, where the problem was reproduced. **Example 1** ``` Pausing for a few seconds... ED_screen_refresh: set screen found bundled python: /Users/ganders1/Applications/Blender.app/Contents/MacOS/../Resources/2.77/python ghost_event_proc: ghost redraw 1 ED_screen_refresh: set screen wm_event_add_ghostevent Send double click wm_handlers_do_intern: handled! 'VIEW3D_OT_cursor3d' wm_event_add_ghostevent Send double click wm_handlers_do_intern: handled! 'VIEW3D_OT_cursor3d' ghost_event_proc: window 1 state = normal win move event pos 1065 -501 size 2560 1317 ED_screen_refresh: set screen ghost_event_proc: window 1 state = normal win move event pos 818 -183 size 2560 1317 ED_screen_refresh: set screen Blender quit ``` **Example 2** ``` Pausing for a few seconds... ED_screen_refresh: set screen found bundled python: /Users/ganders1/Applications/Blender.app/Contents/MacOS/../Resources/2.77/python ghost_event_proc: ghost redraw 1 ED_screen_refresh: set screen wm_event_add_ghostevent Send double click wm_handlers_do_intern: handled! 'VIEW3D_OT_cursor3d' wm_handlers_do_intern: handled - and pass on! 'VIEW3D_OT_select' wm_handlers_do_intern: handled - and pass on! 'VIEW3D_OT_select' wm_handlers_do_intern: handled - and pass on! 'VIEW3D_OT_select' wm_handlers_do_intern: handled - and pass on! 'VIEW3D_OT_select' ghost_event_proc: window 1 state = normal win move event pos 847 0 size 2560 1317 ED_screen_refresh: set screen wm_handlers_do_intern: handled - and pass on! 'VIEW3D_OT_select' ghost_event_proc: window 1 state = normal win move event pos 692 -23 size 2560 1317 ED_screen_refresh: set screen ghost_event_proc: ghost redraw 1 ED_screen_refresh: set screen Saved session recovery to '/tmp/quit.blend' Blender quit ``` In both cases I tried left-clicking various elements on splash screen, which had no effect. Then I double-clicked in the 3D view, which managed to be interpreted as a single-click, and the splash disappeared. I then tried left-clicking on various elements in the GUI. I then moved some objects with the RMB. Refocusing Blender fixed the problem.

Interestingly, after a reboot of my Mac, the behavior happens less frequently (roughly 15% of the time, rather than 90% of the time as before).

Interestingly, after a reboot of my Mac, the behavior happens less frequently (roughly 15% of the time, rather than 90% of the time as before).

Did anyone on OSX besides @supergra manage to redo this?

Did anyone on OSX besides @supergra manage to redo this?

Can anyone reproduce this? It's a continuous blockage in my Blender workflow. I guess we don't have that many OSX developers. Unfortunately I don't have another OSX system to check this on.

Can anyone reproduce this? It's a continuous blockage in my Blender workflow. I guess we don't have that many OSX developers. Unfortunately I don't have another OSX system to check this on.

Added subscriber: @brecht

Added subscriber: @brecht

I can reproduce the problem using some specific steps. If I keep my mouse still it works fine, but if I move it quickly back and forth over the dock while Blender is starting, the issue always happens.

When it happens, Blender is out of focus (the buttons at the top left of the window are grey rather than colored). Clicking the inside the window or on the header does not put the window in focus, the only way is switching to another application and back.

I can reproduce the problem using some specific steps. If I keep my mouse still it works fine, but if I move it quickly back and forth over the dock while Blender is starting, the issue always happens. When it happens, Blender is out of focus (the buttons at the top left of the window are grey rather than colored). Clicking the inside the window or on the header does not put the window in focus, the only way is switching to another application and back.

I can confirm this. If I leave my mouse still after launching, I don't get the problem.

However, it doesn't have to be specifically over the dock. I can just quickly move my mouse in a tight circle right in the terminal window and I still reproduce it.

Slow, modest movements seem to not cause the bug, but it's hard to be quantitative.

Since posting this, I was upgraded to El Capitan, and the problem persists.

I can confirm this. If I leave my mouse still after launching, I don't get the problem. However, it doesn't have to be specifically over the dock. I can just quickly move my mouse in a tight circle right in the terminal window and I still reproduce it. Slow, modest movements seem to not cause the bug, but it's hard to be quantitative. Since posting this, I was upgraded to El Capitan, and the problem persists.

Seems to be due to these changes:

I'm guessing what happens is, OS X will automatically make the application active and focused on launch, except if launch takes too long and the user is doing something else. In that case OS X will not move the application to the front to avoid interfering with what the user is doing.

However by forcing things we are somehow ending up with a window that is the front window, but the Blender application is not actually active.

I haven't found a fix yet that solves both this and the animation player issue.

Seems to be due to these changes: * 6e8a8a72 * 825d6ade I'm guessing what happens is, OS X will automatically make the application active and focused on launch, except if launch takes too long and the user is doing something else. In that case OS X will not move the application to the front to avoid interfering with what the user is doing. However by forcing things we are somehow ending up with a window that is the front window, but the Blender application is not actually active. I haven't found a fix yet that solves both this and the animation player issue.

This issue was referenced by 70100b4ec7

This issue was referenced by 70100b4ec7ba299912bf999f15914c0a29125ffd

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#48283
No description provided.