One of my objectives is to launch a new GtkApplication when the user clicks a button in the topbar of Gnome. I am able to create the button using a gnome-shell-extension, but encountering difficulties in initializing the GtkApplication itself.
As a result, the code provided below should simply trigger the start of the GtkApplication.
After placing the code inside
~/.local/share/gnome-shell/extensions/test@test/extension.js
and activating the extension, it consistently leads to a SIGSEGV
signal from gnome-shell
.
const Lang = imports.lang;
const Gtk = imports.gi.Gtk;
const TestApp = new Lang.Class({
Name: 'TestApp',
Extends: Gtk.Application,
_init: function() {
this.parent({ application_id: 'testapp.apptesttt' });
},
vfunc_activate: function() {
//this.window.present();
},
});
function init() {
}
let _app;
function enable() {
_app = new TestApp();
_app.register(null);
}
function disable() {
_app.quit();
}