[gnome-sound-recorder/ebassi/experiments: 6/7] Do not overwrite the existing window on activation
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/ebassi/experiments: 6/7] Do not overwrite the existing window on activation
- Date: Wed, 7 Sep 2022 16:14:56 +0000 (UTC)
commit 2ef831903ba90a87803ecc87b7bfc4814a4e5f18
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Aug 15 18:15:50 2022 +0100
Do not overwrite the existing window on activation
Sound Recorder only has one window per instance, so if there is an
application window open already, we don't need to do anything other than
presenting it to the user.
src/application.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 83125c6..e01b8b4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -102,9 +102,11 @@ var Application = GObject.registerClass(class Application extends Adw.Applicatio
}
vfunc_activate() {
- this.window = new Window({ application: this });
- if (pkg.name.endsWith('Devel'))
- this.window.add_css_class('devel');
+ if (!this.window) {
+ this.window = new Window({ application: this });
+ if (pkg.name.endsWith('Devel'))
+ this.window.add_css_class('devel');
+ }
this.window.show();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]