From 887f189b6079ddc8cbf2d6c7a5de7b583450d92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Tue, 16 Feb 2021 17:04:56 +0100 Subject: [PATCH] Save window size only when windowed and not in floating mode --- src/player.js | 9 ++++++--- src/widget.js | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/player.js b/src/player.js index 9413bb13..64dc2889 100644 --- a/src/player.js +++ b/src/player.js @@ -376,11 +376,14 @@ class ClapperPlayer extends PlayerBase this.closeRequestSignal = null; const clapperWidget = this.widget.get_ancestor(Gtk.Grid); - if(!clapperWidget.fullscreenMode) { + + if(!clapperWidget.fullscreenMode && clapperWidget.controlsRevealer.child_revealed) { const size = window.get_default_size(); - if(size[0] > 0 && size[1] > 0) - clapperWidget._saveWindowSize(size); + if(size[0] > 0 && size[1] > 0) { + settings.set_string('window-size', JSON.stringify(size)); + debug(`saved window size: ${size[0]}x${size[1]}`); + } } /* If "quitOnStop" is set here it means that we are in middle of autoclosing */ if(this.state !== GstClapper.ClapperState.STOPPED && !this.quitOnStop) { diff --git a/src/widget.js b/src/widget.js index 54c68f5d..7f7cb536 100644 --- a/src/widget.js +++ b/src/widget.js @@ -137,12 +137,6 @@ class ClapperWidget extends Gtk.Grid debug(`interface in fullscreen mode: ${isFullscreen}`); } - _saveWindowSize(size) - { - settings.set_string('window-size', JSON.stringify(size)); - debug(`saved window size: ${size[0]}x${size[1]}`); - } - _changeControlsPlacement(isOnTop) { if(isOnTop) {