diff --git a/clapper_src/misc.js b/clapper_src/misc.js index b1ef3e2f..f03cd9b7 100644 --- a/clapper_src/misc.js +++ b/clapper_src/misc.js @@ -12,6 +12,7 @@ var settings = new Gio.Settings({ }); var maxVolume = 1.5; +var isOldGtk = (Gtk.MINOR_VERSION === 99 && Gtk.MICRO_VERSION <= 4); let { debug } = Debug; let inhibitCookie; diff --git a/clapper_src/player.js b/clapper_src/player.js index 776ed62c..ac5e0035 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -322,7 +322,10 @@ class ClapperPlayer extends PlayerBase let clapperWidget = this.widget.get_ancestor(Gtk.Grid); if(!clapperWidget.fullscreenMode) { - let size = window.get_default_size(); + let size = (Misc.isOldGtk) + ? window.get_size() + : window.get_default_size(); + if(size[0] > 0 && size[1] > 0) clapperWidget._saveWindowSize(size); } diff --git a/clapper_src/widget.js b/clapper_src/widget.js index 707174a1..664693dd 100644 --- a/clapper_src/widget.js +++ b/clapper_src/widget.js @@ -135,7 +135,9 @@ var Widget = GObject.registerClass({ return; let root = this.get_root(); - let size = root.get_default_size(); + let size = (Misc.isOldGtk) + ? root.get_size() + : root.get_default_size(); this._saveWindowSize(size); @@ -160,7 +162,11 @@ var Widget = GObject.registerClass({ ? this.floatSize : this.windowSize; - root.set_default_size(resize[0], resize[1]); + if(Misc.isOldGtk) + root.resize(resize[0], resize[1]); + else + root.set_default_size(resize[0], resize[1]); + debug(`resized window: ${resize[0]}x${resize[1]}`); this.revealerBottom.showChild(false);