fix(linux): application window not visible after launch

This commit is contained in:
Kingkor Roy Tirtho 2024-06-05 17:59:31 +06:00
parent 2b5fd35529
commit 8fc44ed655
2 changed files with 18 additions and 222 deletions

View File

@ -55,10 +55,11 @@ static void my_application_activate(GApplication* application) {
} }
gtk_window_set_default_size(window, 1280, 720); gtk_window_set_default_size(window, 1280, 720);
gtk_widget_realize(GTK_WIDGET(window)); gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new(); g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); fl_dart_project_set_dart_entrypoint_arguments(
project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project); FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view)); gtk_widget_show(GTK_WIDGET(view));
@ -70,16 +71,18 @@ static void my_application_activate(GApplication* application) {
} }
// Implements GApplication::local_command_line. // Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { static gboolean my_application_local_command_line(GApplication* application,
gchar*** arguments,
int* exit_status) {
MyApplication* self = MY_APPLICATION(application); MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name. // Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
g_autoptr(GError) error = nullptr; g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) { if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message); g_warning("Failed to register: %s", error->message);
*exit_status = 1; *exit_status = 1;
return TRUE; return TRUE;
} }
g_application_activate(application); g_application_activate(application);
@ -97,15 +100,16 @@ static void my_application_dispose(GObject* object) {
static void my_application_class_init(MyApplicationClass* klass) { static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate; G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; G_APPLICATION_CLASS(klass)->local_command_line =
my_application_local_command_line;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose; G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
} }
static void my_application_init(MyApplication* self) {} static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() { MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(), return MY_APPLICATION(g_object_new(
"com.github.KRTirtho.Spotube", APPLICATION_ID, my_application_get_type(), "application-id", APPLICATION_ID, "flags",
"flags", G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN, G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
nullptr)); nullptr));
} }

View File

@ -1,209 +1 @@
{ {}
"ar": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"bn": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ca": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"cs": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"de": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"es": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"eu": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"fa": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"fi": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"fr": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"hi": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"id": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"it": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ja": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ka": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ko": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ne": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"nl": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"pl": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"pt": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"ru": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"th": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"tr": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"uk": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"vi": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
],
"zh": [
"local_library",
"add_library_location",
"remove_library_location",
"local_tab",
"stats"
]
}