mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Move window to top when new file is opened
This commit is contained in:
@@ -44,10 +44,10 @@ class ClapperApp extends AppBase
|
|||||||
|
|
||||||
this.playlist = files;
|
this.playlist = files;
|
||||||
|
|
||||||
if(!this.doneFirstActivate)
|
if(this.doneFirstActivate)
|
||||||
this._handleAppStart();
|
|
||||||
else
|
|
||||||
this.setWindowPlaylist(this.active_window);
|
this.setWindowPlaylist(this.active_window);
|
||||||
|
|
||||||
|
this.activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onWindowShow(window)
|
_onWindowShow(window)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
const { Gio, GObject, Gtk } = imports.gi;
|
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||||
const Debug = imports.clapper_src.debug;
|
const Debug = imports.clapper_src.debug;
|
||||||
const Menu = imports.clapper_src.menu;
|
const Menu = imports.clapper_src.menu;
|
||||||
const Misc = imports.clapper_src.misc;
|
const Misc = imports.clapper_src.misc;
|
||||||
@@ -51,7 +51,12 @@ class ClapperAppBase extends Gtk.Application
|
|||||||
{
|
{
|
||||||
super.vfunc_activate();
|
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)
|
run(arr)
|
||||||
@@ -59,15 +64,6 @@ class ClapperAppBase extends Gtk.Application
|
|||||||
super.run(arr || []);
|
super.run(arr || []);
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleAppStart()
|
|
||||||
{
|
|
||||||
if(this.doneFirstActivate)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this._onFirstActivate();
|
|
||||||
this.active_window.present();
|
|
||||||
}
|
|
||||||
|
|
||||||
_onFirstActivate()
|
_onFirstActivate()
|
||||||
{
|
{
|
||||||
let gtkSettings = Gtk.Settings.get_default();
|
let gtkSettings = Gtk.Settings.get_default();
|
||||||
|
Reference in New Issue
Block a user