perf: Stop using GTK

Instead of going through GtkSettings, we can just as well use the
underlying GSettings directly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/481
This commit is contained in:
Florian Müllner 2019-04-04 15:45:01 +02:00 committed by Florian Müllner
parent 9f8edd980c
commit 4541fb9819

View File

@ -1,4 +1,4 @@
const { Clutter, Gio, Gtk, Shell } = imports.gi; const { Clutter, Gio, Shell } = imports.gi;
const Main = imports.ui.main; const Main = imports.ui.main;
const Scripting = imports.ui.scripting; const Scripting = imports.ui.scripting;
@ -104,7 +104,10 @@ function *run() {
yield Scripting.waitLeisure(); yield Scripting.waitLeisure();
Scripting.scriptEvent('desktopShown'); Scripting.scriptEvent('desktopShown');
Gtk.Settings.get_default().gtk_enable_animations = false; let interfaceSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.interface'
});
interfaceSettings.set_boolean('enable-animations', false);
Scripting.scriptEvent('overviewShowStart'); Scripting.scriptEvent('overviewShowStart');
Main.overview.show(); Main.overview.show();
@ -200,7 +203,7 @@ function *run() {
yield Scripting.sleep(1000); yield Scripting.sleep(1000);
Gtk.Settings.get_default().gtk_enable_animations = true; interfaceSettings.set_boolean('enable-animations', true);
} }
let overviewShowStart; let overviewShowStart;