Fix #109886: Win32 AutoFocus Between Main Windows #109946
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109946
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:AutoFocusMain"
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?
Allow auto-focusing between multiple parent (main) windows when they
are immediately adjacent.
Issue #109886 describes a lack of auto-focus between main windows when they are full-screen on multiple adjacent monitors.
But this issue isn't really related to windows being full-screen or when on multiple monitors. It is most easily replicated like this:
If they are closer than about 20 pixels they won't auto-focus.
We allow auto-focusing between multiple main (parent) windows as long as they don't overlap. Unfortunately our test for overlapping is a bit sus. Since Vista the Windows API call GetWindowRect now includes the area occupied by the drop shadow that is beyond the window bounds. Because we are using a rectangle larger than the window the two windows can be quite far apart and test as overlapping.
This PR just uses a different Windows API call that returns the actual window bounds instead.
I can't test this as i'm single monitor only, but can you validate monitors with different DPI's work as expected?
https://stackoverflow.com/questions/49002910/why-does-dwmgetwindowattribute-with-dwmwa-extended-frame-bounds-behave-unexpecte
seems to imply some dpi magic may be at play, depending on if we opted in to be dpi aware or not.
They do. I was also expecting some DPI nonsense, so put two of my monitors in different scales (100% and 125%) and tested two main windows in various locations. They worked as expected when entirely on each monitor and in all variations of having some or all of each on each monitor.
I think the warnings about DPI are related to similar warnings about the function not working correctly if the window is not visible and/or not shown at least once, which doesn't apply here. So it doesn't (like many of their functions) have the ability to guess the size of non-client areas before the window is drawn. I have read (although not confirmed) that this function is used by PrintScreen since Vista to capture windows without the shadow space.
allright then!
Will be merged without further review. Is own code, Windows-only, and has no change of functionality besides fixing this bug report.
Harley Acheson referenced this pull request2023-07-13 01:45:03 +02:00