Remember and restore last window dimensions on launch

This commit is contained in:
Rafostar
2020-10-31 09:04:41 +01:00
parent 36145adf1a
commit a019ef90ca
4 changed files with 32 additions and 3 deletions

View File

@@ -605,6 +605,15 @@ class ClapperPlayer extends PlayerBase
if(this.state !== GstPlayer.PlayerState.STOPPED)
this.stop();
let clapperWidget = this.widget.get_ancestor(Gtk.Grid);
if(!clapperWidget.fullscreenMode) {
let size = window.get_size();
if(size[0] > 0 && size[1] > 0) {
this.settings.set_string('window-size', JSON.stringify(size));
debug(`saved window dimensions: ${size[0]}x${size[1]}`);
}
}
let app = window.get_application();
if(app) app.quit();
}