1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 06:45:45 +02:00

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
This commit is contained in:
Andreas Traczyk 2022-03-23 18:00:27 -04:00
parent 0722f6a76b
commit b94b404967

View file

@ -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 {