Page MenuHome

Fix T90817: Object Picker Doesn't Work on Second window
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Aug 25 2021, 4:11 AM.

Details

Summary

The same solution used in rBb94ab93dfb82: Eyedropper: Support get samples from other windows solves the problem.

The idea of that solution is to find the window and region under the cursor to use in the operator.

Diff Detail

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

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Aug 25 2021, 4:11 AM
Germano Cavalcante (mano-wii) created this revision.

It might be good to think of a better name for these new functions.

  • Fix continuous mouse move on Mac

In this case the window needs to be set (according to other OS).

But something has changed in GHOST since then, and the events of the window where the operator was called (which includes the eyedropper's modal operator) are not captured if the mouse cursor is over another window.

Before we go into the rather complicated solution in this patch, have you identified what changed? Wouldn't we have the same problem for e.g. transform operators without continuous grab?

Before we go into the rather complicated solution in this patch, have you identified what changed? Wouldn't we have the same problem for e.g. transform operators without continuous grab?

EDIT: I didn't notice that continuous grab is disabled with the option --debug

Continuous grab calls the updateMouseCapture(OperatorGrab) function which does exactly what this patch proposes to expose.

Germano Cavalcante (mano-wii) planned changes to this revision.Aug 25 2021, 3:00 PM

I was referring to the case where continuous grab is disabled in the preferences, then it's similar to what we want for color picking. Grabbing the cursor but not warping or hiding it.

Maybe that can be improved, rather than adding an additional force capture state.

  • Remove GHOST changes

Operators with the OPTYPE_BLOCKING option always called WM_cursor_grab_enable(CTX_wm_window(C), wrap, false, bounds) which did exactly what this path proposed: Force events to a single window.
I hadn't noticed this before because I had the --debug option enabled which internally disables the continuous grab activation (why does it even do this????)

(This weird behavior of --debug made me waste a lot of time -_-)

That --debug behavior is indeed quite odd. It's apparently due to issues using a debugger with cursor grabbing (rBdcecd8e), not sure how relevant that still is.

This revision is now accepted and ready to land.Aug 26 2021, 3:02 PM