Skip to content

Commit

Permalink
fix(linux): application window not visible after launch
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 5, 2024
1 parent 2b5fd35 commit 8fc44ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 222 deletions.
30 changes: 17 additions & 13 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void my_application_activate(GApplication* application) {
gtk_window_present(GTK_WINDOW(windows->data));
return;
}

GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));

Expand Down Expand Up @@ -55,10 +55,11 @@ static void my_application_activate(GApplication* application) {
}

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();
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);
gtk_widget_show(GTK_WIDGET(view));
Expand All @@ -70,16 +71,18 @@ static void my_application_activate(GApplication* application) {
}

// 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);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);

g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}

g_application_activate(application);
Expand All @@ -97,15 +100,16 @@ static void my_application_dispose(GObject* object) {

static void my_application_class_init(MyApplicationClass* klass) {
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;
}

static void my_application_init(MyApplication* self) {}

MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"com.github.KRTirtho.Spotube", APPLICATION_ID,
"flags", G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
nullptr));
}
return MY_APPLICATION(g_object_new(
my_application_get_type(), "application-id", APPLICATION_ID, "flags",
G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
nullptr));
}
210 changes: 1 addition & 209 deletions untranslated_messages.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
{}

0 comments on commit 8fc44ed

Please sign in to comment.