Fix #111295: Add Missing Win32 Platform-Specific Window functions #111359

Harley Acheson merged 6 commits from Harley/blender:Win32WinFunctions into main 2023-08-25 22:10:02 +02:00

6 Commits

Author SHA1 Message Date
Harley Acheson 10e545fb8b Only comment changes. 2023-08-25 12:50:24 -07:00
Harley Acheson 82b54443e4 Merge branch 'main' of into Win32WinFunctions 2023-08-25 12:43:45 -07:00
Harley Acheson 87fae133fa Comment Changes. Remove x,y arguments from Win32 getWindowUnderCursor
buildbot/vexp-code-patch-coordinator Build done. Details
2023-08-25 10:55:16 -07:00
Harley Acheson c79e951954 Merge branch 'main' of into Win32WinFunctions 2023-08-25 10:25:56 -07:00
Harley Acheson 16e664d14b Comment improvements 2023-08-21 13:43:33 -07:00
Harley Acheson 6bf593b3ad Fix #111295: Add Missing Win32 Platform-Specific Window functions
Add platform-specific (Windows) versions of getOSWindow() and


The base default behavior of `getOSWindow` always returns nullptr. This PR makes it return the Windows OS Handle as expected. This is needed for `getWindowAssociatedWithOSWindow` to work correctly, otherwise that always returns nullptr.

The base default behavior of `getWindowUnderCursor` does a forward search through the ghost windows checking bounds. This does not consider z-depth. And because the search is forward it will always return the main window if a child is overlapping in front. This specific implementation gets the cursor location from the OS and then the Window from that.

This PR does not use the passed cursor location because that will often be wrong. The best example is when we have a blender window on one monitor but the mouse cursor is on a different monitor that uses a different scale. In this case the cursor location will not be a nice offset from our blender window. Best to just ask the OS where the cursor actually is.

For testing and how this relates to the referenced bug report. Opening the "Preferences" window and having it above the main window, using the color picker in the Themes area will select through to the main window. This is because the base getWindowUnderCursor returns the first window with bounds that match the cursor position.
2023-08-21 11:20:33 -07:00