Split area feature messed up then other window in background. #129414
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129414
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
System Information
Operating system: Linux-6.5.0-14-generic-x86_64-with-glibc2.35 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 4080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.146.02
Blender Version
Broken: version: 4.3.0 Beta, branch: blender-v4.3-release, commit date: 2024-10-25 18:17, hash:
1dd6cdb1727f
Worked: 4.2
Short description of error
Split area feature messed up then other window in background. You try to split the area by dragging the corner, instead the area goes in window at background. Look at the video:
Exact steps for others to reproduce the error
I can't say that it happened in 100% cases.
I can confirm the issue here on Linux (Gnome X11), but couldn't on Windows or macOS.
CC @Harley as the developer of the feature, and CC @ideasman42 due to their involvment in Linux windowing development.
System Information
Operating system: Linux-6.8.0-41-generic-x86_64-with-glibc2.39 64 Bits, X11 UI
Graphics card: Mesa Intel(R) Arc(tm) A750 Graphics (DG2) Intel 4.6 (Core Profile) Mesa 24.0.9-0ubuntu0.1
Blender version: 4.3.0 Beta, branch: blender-v4.3-release, commit date: 2024-10-25 18:17, hash:
1dd6cdb1727f
The video and description doesn’t detail how these multiple windows were created and in what order. And I think that is significant here. Sorry that I am away from my computer so the following is guesses from memory.
When doing operations between multiple windows it is necessary to know what window is the topmost one at the mouse position. Relative z-depth of the windows is not something we directly track, so in order for this to work flawlessly we need to ask the operating system. I don’t believe we do this for X11 so there can be times when this is incorrect.
The base behaviour, when there isn’t platform-specific code, for “what is the topmost window at this position” is to test the position against all our windows, and - when multiples- assume windows created later are on top of those created earlier, as that is more likely.
For Windows, (I think) MacOS, and (probably) Wayland, we instead call OS-supplied functions, specific to this purpose, and so always get the correct answer. Unless we get X11-specific code for this it will be possible to get bad behaviour for area interactions, drag and drop, etc if a window is above another that was created after it.
When I ran my tests, I started with a single "main" window and shrunk it down, then created a new window and placed it behind the existing window. The tested.
Based on my testing here, this does seem to be what's happening. Windows created later are given priority.
I made this two-window setup for two monitors in Blender 2.80, and haven't been changed it since that time. But it looks like the main window in the foreground creates first.
@Harley Are there any updates here?
P.S. It might be Linux specific.It is easy to reproduce on Linux (following steps from Alaska), but I didn't manage to reproduce it on macOS yet.
@Sergey
I'm back now.
It is Linux-specific. It is missing a platform-specific ghost function.
Whenever we are dealing with operations that span multiple windows (drag & drop and area maintenance stuff mostly), we need to know the source and target windows. We don't keep track of the z-depth of our windows, so when they overlap it is ambiguous.
To find out the topmost window at the current mouse pointer position we call
WM_window_find_under_cursor
, which in turn callsGHOST_GetWindowUnderCursor
, which brings us to ghost functionsystem->getWindowUnderCursor
The base behavior of
getWindowUnderCursor
(ghost\intern\GHOST_System.cc) is to just test what we think to be the mouse position against all of our windows, in reverse order, and return the first found. This means that it does return the topmost for the most common case, when a window created later is on top of one created earlier, like children on top of parents. But this will not work correctly when the windows are reversed with the older on on top.For Mac and Windows we have specific versions of
getWindowUnderCursor
that asks the OS for this instead. The Windows one, for example, ignores the passed positions and instead gets the mouse position from Windows API GetCursorPos, then passes this toWindowFromPoint
, which returns the topmost window at that point. The Mac version useswindowNumberAtPoint
.I don't use Linux, but as far I can tell XQueryTree is used to query windows and it looks like that those are sorted back to front, so it might not be difficult for a linux dev to add a better version of
getWindowUnderCursor
I see, thanks for the insights.
For the X11 I've came up with the following solution:
it seems to work from quick tests, but there are a few aspects:
I don't really think the current state of the code is good enough for 4.3, and I think we either need to finish the PoC from above, or simply disable space dragging functionality from outside of the active window. The latter one might be the best, considering we're so close to the release.
@Sergey
Thanks for the help.
The problem with completely disabling this for Linux outside of the active window is that it would then not work for the simple case of dragging between multiple windows that do not overlap. I think I can check (only for Linux) for multiple windows matching and in that case use the active one.
But hoping to add you as the reviewer since I don't run Linux.
Works now, but this #129415 still is broken.