From d465d9f150a42de52fa5c0341bb083b1ef689653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 15 Dec 2021 16:58:54 +0100 Subject: [PATCH] Make floating window update its title earlier Instead of waiting till animation finishes, update the window title right away when changing modes --- src/revealers.js | 10 +++++----- src/widget.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/revealers.js b/src/revealers.js index 21ffae1e..f601d155 100644 --- a/src/revealers.js +++ b/src/revealers.js @@ -321,21 +321,21 @@ class ClapperControlsRevealer extends Gtk.Revealer const isStick = (isFloating && settings.get_boolean('floating-stick')); DBus.shellWindowEval('stick', isStick); + + this.root.child.refreshWindowTitle(this.root.title); } _onControlsRevealed() { - const clapperWidget = this.root.child; - if(!clapperWidget) return; - if(this.child_revealed) { + const clapperWidget = this.root.child; + if(!clapperWidget) return; + const [width, height] = this.root.get_default_size(); clapperWidget.player.widget.height_request = -1; this.root.set_default_size(width, height); } - - clapperWidget.refreshWindowTitle(this.root.title); } _onUnrevealTick(playerWidget, width, height) diff --git a/src/widget.js b/src/widget.js index bf1dd5d5..34334515 100644 --- a/src/widget.js +++ b/src/widget.js @@ -326,7 +326,7 @@ class ClapperWidget extends Gtk.Grid refreshWindowTitle(title) { - const isFloating = !this.controlsRevealer.child_revealed; + const isFloating = !this.controlsRevealer.reveal_child; const pipSuffix = ' - PiP'; const hasPipSuffix = title.endsWith(pipSuffix);