diff --git a/clapper_src/app.js b/clapper_src/app.js index c084c616..bfc4c196 100644 --- a/clapper_src/app.js +++ b/clapper_src/app.js @@ -44,10 +44,10 @@ class ClapperApp extends AppBase this.playlist = files; - if(!this.doneFirstActivate) - this._handleAppStart(); - else + if(this.doneFirstActivate) this.setWindowPlaylist(this.active_window); + + this.activate(); } _onWindowShow(window) diff --git a/clapper_src/appBase.js b/clapper_src/appBase.js index cc2842af..db2a423e 100644 --- a/clapper_src/appBase.js +++ b/clapper_src/appBase.js @@ -1,4 +1,4 @@ -const { Gio, GObject, Gtk } = imports.gi; +const { Gio, GLib, GObject, Gtk } = imports.gi; const Debug = imports.clapper_src.debug; const Menu = imports.clapper_src.menu; const Misc = imports.clapper_src.misc; @@ -51,7 +51,12 @@ class ClapperAppBase extends Gtk.Application { super.vfunc_activate(); - this._handleAppStart(); + if(!this.doneFirstActivate) + this._onFirstActivate(); + + this.active_window.present_with_time( + Math.floor(GLib.get_monotonic_time() / 1000) + ); } run(arr) @@ -59,15 +64,6 @@ class ClapperAppBase extends Gtk.Application super.run(arr || []); } - _handleAppStart() - { - if(this.doneFirstActivate) - return; - - this._onFirstActivate(); - this.active_window.present(); - } - _onFirstActivate() { let gtkSettings = Gtk.Settings.get_default();