mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +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;
|
||||
|
||||
if(!this.doneFirstActivate)
|
||||
this._handleAppStart();
|
||||
else
|
||||
if(this.doneFirstActivate)
|
||||
this.setWindowPlaylist(this.active_window);
|
||||
|
||||
this.activate();
|
||||
}
|
||||
|
||||
_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 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();
|
||||
|
Reference in New Issue
Block a user