From 4eebc8b6867cba30afc9c65ba560839fdb7fc225 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:05:30 +0200 Subject: [PATCH 1/5] Update my_application.cc --- linux/my_application.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/my_application.cc b/linux/my_application.cc index 040251e7..f46934ea 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -23,7 +23,7 @@ static void my_application_activate(GApplication* application) { // Use a header bar when running in GNOME as this is the common style used // by applications and is the setup most users will be using (e.g. Ubuntu // desktop). - // If running on X and not using GNOME then just use a traditional title bar + // If running on X and not using GNOME or KDE, just use a traditional title bar // in case the window manager does more exotic layout, e.g. tiling. // If running on Wayland assume the header bar will work (may need changing // if future cases occur). @@ -32,7 +32,8 @@ static void my_application_activate(GApplication* application) { GdkScreen* screen = gtk_window_get_screen(window); if (GDK_IS_X11_SCREEN(screen)) { const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + // Don't use a header bar if the window manager is not GNOME or KDE + if (g_strcmp0(wm_name, "GNOME Shell") != 0 && g_strcmp0(wm_name, "KWin") != 0) { use_header_bar = FALSE; } } From b6629c779b997f006ecf46764b75908c22589396 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:08:10 +0200 Subject: [PATCH 2/5] Update my_application.h --- linux/my_application.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/linux/my_application.h b/linux/my_application.h index 72271d5e..40ac8e70 100644 --- a/linux/my_application.h +++ b/linux/my_application.h @@ -3,15 +3,25 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, - GtkApplication) +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, GtkApplication) /** - * my_application_new: + * MyApplication: * - * Creates a new Flutter-based application. + * This is a custom GTK application that integrates Flutter within a + * GTK-based window. It provides a way to run Flutter-based content + * inside a native Linux GTK application. + */ + +/** + * my_application_new: + * + * Creates a new instance of #MyApplication, which is a GTK application + * designed to run Flutter-based content. This function sets up the + * application with the required initialization parameters and ensures + * proper integration with the Flutter rendering engine. * - * Returns: a new #MyApplication. + * Returns: (transfer full): A newly created instance of #MyApplication. */ MyApplication* my_application_new(); From d6d546e9d2d06963d28a41385b3f0375c7e60328 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:13:51 +0200 Subject: [PATCH 3/5] Update main.cc --- linux/main.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/linux/main.cc b/linux/main.cc index e7c5c543..03c7a4e3 100644 --- a/linux/main.cc +++ b/linux/main.cc @@ -1,6 +1,22 @@ #include "my_application.h" +/** + * main: + * @argc: The number of command-line arguments. + * @argv: The array of command-line arguments. + * + * The entry point of the application. It creates a new instance of + * #MyApplication and runs the application using `g_application_run`. + * This function manages the lifecycle of the application, including + * command-line arguments and the main GTK event loop. + * + * Returns: The exit status of the application (0 for success). + */ int main(int argc, char** argv) { + // Automatically handles memory management for 'app' by using g_autoptr. g_autoptr(MyApplication) app = my_application_new(); + + // Run the application and start the main event loop. + // The exit status will be returned when the application finishes. return g_application_run(G_APPLICATION(app), argc, argv); } From 499413f15622cd93b3d9bc3c7558331bae3261a6 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:30:39 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 7cfb2622..a18fa8ea 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,44 @@ Supported Booru engines: ![github-small](https://raw.githubusercontent.com/NO-ob/LoliSnatcher_Droid/master/sancucku.png) +To build the LoliSnatcher_Droid project using CMake, you'll need to follow several steps, especially since some users have reported specific issues with the build process. Here's a general outline of the instructions: + + Clone the repository: + Start by cloning the repository from GitHub: + + git clone https://github.com/NO-ob/LoliSnatcher_Droid.git + cd LoliSnatcher_Droid + +Install dependencies: + + Ensure you have Flutter and CMake installed. The project is a Flutter-based Android application, so you may also need the Android SDK. + Additionally, install any necessary plugins or dependencies using: + + + flutter pub get + +Linux-specific builds: + + If you're building for Linux, note that there have been issues with missing directories for some Flutter plugins. You may need to regenerate or fix paths in the CMakeLists.txt file by ensuring that plugins like awesome_notifications and url_launcher have the correct paths​ + ​ + . + +Build the project: + + Run the following command to trigger the CMake build: + + + cmake . + make + +Troubleshooting: + + If you encounter issues with missing resources or other errors like CMake Error at flutter/generated_plugins.cmake, make sure the flutter directory is correctly set up with all necessary files. Regenerating the CMake build files can help: + + + + rm -rf build + cmake . + make + +These steps should guide you in building the project successfully, though you may need to adapt them based on the environment or specific errors you encounter From d48960a63070f7eea08a8f54dc8c51714f3d57e1 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:31:58 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index a18fa8ea..537d602e 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,8 @@ Install dependencies: flutter pub get Linux-specific builds: +If you're building for Linux, note that there have been issues with missing directories for some Flutter plugins. You may need to regenerate or fix paths in the CMakeLists.txt file by ensuring that plugins like awesome_notifications and url_launcher have the correct paths​ - If you're building for Linux, note that there have been issues with missing directories for some Flutter plugins. You may need to regenerate or fix paths in the CMakeLists.txt file by ensuring that plugins like awesome_notifications and url_launcher have the correct paths​ - ​ - . Build the project: