Page MenuHome

Window manager: window size/position persistence
Needs ReviewPublic

Authored by Andrew Williams (sobakasu) on Feb 12 2019, 12:04 AM.

Details

Summary

from D4291, this code saves window positions, sizes, and state (maximised/normal) to disk.

keeping the window positions/sizes saved separately from the blend file was a deliberate choice.

Note that functions that read and write to the wmWindowSize structure are in D4291, this code just reads and writes them to disk.

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Feb 15 2019, 8:43 AM

Seems reasonable, I don't have a strong opinion on this, but storing window locations in a text file seems fine, as we do for bookmarks.

The patch isn't complete though.

source/blender/windowmanager/intern/wm_files.c
1175–1176

Could do some sanity checks here that the rectangle is a usable window size.

source/blender/windowmanager/wm_window.h
67

This function isn't available in master, could this patch become self contained.

This revision now requires changes to proceed.Feb 15 2019, 8:43 AM
Andrew Williams (sobakasu) updated this revision to Diff 13713.
  • Updated diff so that it can be applied to master separately from D4291
  • Added sanity checks on window size when reading/writing window position preferences
Andrew Williams (sobakasu) marked 2 inline comments as done.Feb 17 2019, 2:10 AM