Page MenuHome

Fix eyedropper operators not working on Mac
Changes PlannedPublic

Authored by Germano Cavalcante (mano-wii) on Aug 27 2021, 12:08 AM.

Details

Summary

Event capturing on Mac is quite different from that seen on Windows.

While on Windows mouse move events are only captured when the cursor is over a window. On Mac any mouse movement is captured.

Another difference is that the window where events will be added on Windows is the window under the cursor and on Mac it is the active window.

It's as if, on the Mac, the mouse grab was always enabled for the active window.

But eyedropper doesn't work between different windows because when clicking on a different window, it becomes the activated window and the modal operator events of the other window are not fired.

The workaround for this patch is to partially simulate the mouse capture seen in Windows.

When the grab mouse is activated, the window reference is saved in the system, and this window is used in the processing of mouse events.

Also the window is prevented from being activated if there is a window "capturing" the mouse events.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 16644
Build 16644: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Aug 27 2021, 12:08 AM
Germano Cavalcante (mano-wii) created this revision.
  • rebase on master
  • Do not use [NSEvent mouseLocation] to get the mouse location of the event (as it returns the current location).

I noticed that to fix the eyedropper problem, only the part of preventing another window from being activated is needed.

Germano Cavalcante (mano-wii) planned changes to this revision.Sep 15 2022, 6:54 PM
  • less invasive solution/workaround

Still need to fix the cursor that changes in the inactive window

Germano Cavalcante (mano-wii) planned changes to this revision.Sep 16 2022, 1:35 AM