WIP: UI: Save Temp Window Sizes & Positions #104727
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
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104727
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:WindowPosSize"
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 temporary windows (like File Browser, Preferences, Render,
Drivers, Info) to open at their last positions and sizes.
UserDef gets a new kind of struct to contain a temp window's position and size. A new
WM_window_open_temp
takes a pointer to one of these as a parameter and automatically saves and restores on close and open.Positions are saved in unscaled values (as if the UI scale is 1.0), using the DPI scale of the parent window. Using unscaled values means that if you increase the UI scale the temp window sizes are suitably scaled as well. Using the DPI of the parent is required to position them correctly in complex situations like having multiple monitors that differ in OS scale.
Note this currently only saves and restores the size and position of the Preferences and File Browser windows. But this design could easily work for other windows after it is confirmed (or fixed) to work on Mac and Linux.
9ef8eac91d
to82675a6d04
82675a6d04
tof2e4f60631
@rajveermalviya
Is any way you can take a look at this? This should just automatically save and restore the last sizes and positions of the Preferences window. But the last I heard some of these are incorrect on Mac with Retina displays.
We do measuring a bit wrong on high-dpi though, so this will just come down to a bad or missing use of GHOST_GetNativePixelSize
I tried this impl on my macbook and found that window positions and window sizes are being preserved correctly on laptop display.
But (for me) absolute positioning in general is broken on extended displays. I even tested with current
main
but that didn't change anything. Is there a bug already for it? (couldn't find one)Oh so it works to set and restore the size and position on the built-in monitor. Those are all Retina right, so high-dpi? That would be a good sign that the PR is probably doing everything correctly.
So you are saying that positioning on multiple displays is incorrect in main? I'm not surprised as that seems to be incomplete on Mac.
On Windows I can start with defaults. Then choose Window/ New Window and move the resulting window anywhere to any of my monitors. I can do this to make and arrangement of windows all over the place. Then I can select File / Defaults / Save Startup File. I can close and launch Blender again - everything will be back to where they were to the pixel.
If this isn't working on Mac we might have to identify exactly which parts aren't working correctly. Its not that hard to figure out to be honest. Window creation is all done in wm_window.c, and by examining what happens when windows are made we might find that we are missing some ghost functions. Like wm_get_desktopsize could be getting the wrong values.
I doubt it. But knowing what works on Windows, it would make sense to create a bug report for the missing/broken behavior on Mac.
1f6a9b3b70
to0a3261a786
@Brainzman
I'm hoping you can give this a quick test to see how it is on Mac. Or is it something we shouldn't do until we have multi-monitor support on Mac?
Checkout
From your project repository, check out a new branch and test the changes.