[gnome-sound-recorder/ebassi/experiments: 2/3] 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: 2/3] Do not overwrite the existing window on activation
- Date: Sat, 3 Sep 2022 15:23:23 +0000 (UTC)
commit cda9302e839d12b074b6b06feec450f6e43f43b6
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]