Skip to content
Snippets Groups Projects
Commit b94b4049 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

mainwindow: don't save fullscreen geometry

This covers the case where closing the app while in fullscreen mode
will save the window geometry. A patch was already made to prevent
the client from restoring fullscreen visibility, however, restoring
the geometry will stretch the window over the screen giving the
impression that it is fullscreen. This patch fixes that behavior.

Change-Id: I520d528a0d8fb62c84bfd79d2f2229bcc654bf8f
parent 0722f6a7
No related branches found
No related tags found
No related merge requests found
......@@ -71,17 +71,20 @@ QtObject {
// Save the window geometry and visibility settings.
function saveWindowSettings() {
var geometry = Qt.rect(appWindow.x, appWindow.y,
appWindow.width, appWindow.height)
AppSettingsManager.setValue(Settings.WindowGeometry, geometry)
// If closed-to-tray or minimized, save the cached windowedVisibility
// If closed-to-tray or minimized or fullscreen, save the cached windowedVisibility
// value instead.
if (isHidden) {
if (isHidden || isFullScreen) {
AppSettingsManager.setValue(Settings.WindowState, priv.windowedVisibility)
} else {
AppSettingsManager.setValue(Settings.WindowState, visibility)
}
// Likewise, don't save fullscreen geometry.
const geometry = isFullScreen ?
priv.windowedGeometry :
Qt.rect(appWindow.x, appWindow.y,
appWindow.width, appWindow.height)
AppSettingsManager.setValue(Settings.WindowGeometry, geometry)
}
// Restore the window geometry and visibility settings.
......@@ -208,6 +211,9 @@ QtObject {
// Used to store the last windowed mode visibility.
property int windowedVisibility
// Used to store the last windowed mode geometry.
property rect windowedGeometry
// An stack of items that are fullscreened.
property variant fullScreenItems: []
......@@ -238,8 +244,10 @@ QtObject {
function requestWindowModeChange(fullScreen) {
if (fullScreen) {
if (!isFullScreen) {
// Save the previous visibility state.
// Save the previous visibility state and geometry.
windowedVisibility = visibility
windowedGeometry = Qt.rect(appWindow.x, appWindow.y,
appWindow.width, appWindow.height)
showFullScreen()
}
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment