mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
Open new file in the same window. Closes #31
This commit is contained in:
@@ -9,15 +9,8 @@ let { settings } = Misc;
|
||||
var AppBase = GObject.registerClass(
|
||||
class ClapperAppBase extends Gtk.Application
|
||||
{
|
||||
_init(opts)
|
||||
_init()
|
||||
{
|
||||
opts = opts || {};
|
||||
|
||||
let defaults = {
|
||||
playlist: [],
|
||||
};
|
||||
Object.assign(this, defaults, opts);
|
||||
|
||||
super._init({
|
||||
application_id: Misc.appId,
|
||||
});
|
||||
@@ -58,10 +51,7 @@ class ClapperAppBase extends Gtk.Application
|
||||
{
|
||||
super.vfunc_activate();
|
||||
|
||||
if(!this.doneFirstActivate)
|
||||
this._onFirstActivate();
|
||||
|
||||
this.active_window.present();
|
||||
this._handleAppStart();
|
||||
}
|
||||
|
||||
run(arr)
|
||||
@@ -69,6 +59,15 @@ class ClapperAppBase extends Gtk.Application
|
||||
super.run(arr || []);
|
||||
}
|
||||
|
||||
_handleAppStart()
|
||||
{
|
||||
if(this.doneFirstActivate)
|
||||
return this._onWindowShow(this.active_window);
|
||||
|
||||
this._onFirstActivate();
|
||||
this.active_window.present();
|
||||
}
|
||||
|
||||
_onFirstActivate()
|
||||
{
|
||||
let gtkSettings = Gtk.Settings.get_default();
|
||||
@@ -89,6 +88,9 @@ class ClapperAppBase extends Gtk.Application
|
||||
|
||||
_onWindowShow(window)
|
||||
{
|
||||
if(!this.windowShowSignal)
|
||||
return;
|
||||
|
||||
window.disconnect(this.windowShowSignal);
|
||||
this.windowShowSignal = null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user