-
Notifications
You must be signed in to change notification settings - Fork 87
Add window-maximization creation-param, and isWindowMaximized() #142
Conversation
f0bd325
to
082e3df
Compare
Rebased. |
68b1452
to
57fbab0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct.
57fbab0
to
e4fcb11
Compare
(Rebased.) |
* creation-param is implemented with maximizeWindow() * isMaximized() returns state set via maximizeWindow() and restoreWindow() (otherwise autosave would overwrite the setting) * other backends don't support maximization
Added simple implementations (via |
(Oh, does only one review-request work? That button is weird. x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with CIrrDeviceLinux + Minetest PR.
No issues found. SDL part LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Needed because big centered windows don't work well.
In X11 we don't support centering the window, instead we always use pos (0,0). In SDL, the window can be (and is, because we use pos (-1,-1) in minetest) centered, but it centers into the middle of display area, not usable display area (the usable one doesn't include the panel), which is better for small windows, but completely wrong for big ones, that almost fill the usable area. And changing that (in SDL) would require repositioning the window when the window decoration is added. All in all, it would be complicated, and it's hard to decide when to center with respect to which area.
Fix: Keep centering the window in SDL, but store whether the window is maximised (just like
screen_[h,w]
), and maximise window on startup again accordingly.See also: minetest/minetest#12861
Edit: Please don't merge yet.