From be300a28092bac8381500ea1a3ff87e516af1f56 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 13 May 2022 23:27:06 -0400 Subject: [PATCH] Fix Zenity On Wayland --- launcher/src/client/launcher.cpp | 2 +- launcher/src/crash-report.c | 2 +- mods/src/chat/ui.c | 2 +- mods/src/game-mode/ui.cpp | 6 +++--- mods/src/misc/logging.cpp | 3 +++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/launcher/src/client/launcher.cpp b/launcher/src/client/launcher.cpp index 18b13f7..07841c1 100644 --- a/launcher/src/client/launcher.cpp +++ b/launcher/src/client/launcher.cpp @@ -110,7 +110,7 @@ static void run_zenity_and_set_env(const char *env_name, std::vector full_command; full_command.push_back("zenity"); - full_command.push_back("--class"); + full_command.push_back("--name"); full_command.push_back(GUI_TITLE); full_command.insert(full_command.end(), command.begin(), command.end()); // Convert To C Array diff --git a/launcher/src/crash-report.c b/launcher/src/crash-report.c index 29423b5..107d1a4 100644 --- a/launcher/src/crash-report.c +++ b/launcher/src/crash-report.c @@ -20,7 +20,7 @@ static void show_report(const char *log_filename) { const char *command[] = { "zenity", "--title", DIALOG_TITLE, - "--class", GUI_TITLE, + "--name", GUI_TITLE, "--width", CRASH_REPORT_DIALOG_WIDTH, "--height", CRASH_REPORT_DIALOG_HEIGHT, "--text-info", diff --git a/mods/src/chat/ui.c b/mods/src/chat/ui.c index 0cd6b7b..194bdb9 100644 --- a/mods/src/chat/ui.c +++ b/mods/src/chat/ui.c @@ -34,7 +34,7 @@ static void *chat_thread(__attribute__((unused)) void *nop) { const char *command[] = { "zenity", "--title", DIALOG_TITLE, - "--class", GUI_TITLE, + "--name", GUI_TITLE, "--entry", "--text", "Enter Chat Message:", NULL diff --git a/mods/src/game-mode/ui.cpp b/mods/src/game-mode/ui.cpp index e213d6d..5e3b726 100644 --- a/mods/src/game-mode/ui.cpp +++ b/mods/src/game-mode/ui.cpp @@ -89,7 +89,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) { const char *command[] = { "zenity", "--title", DIALOG_TITLE, - "--class", GUI_TITLE, + "--name", GUI_TITLE, "--entry", "--text", "Enter World Name:", "--entry-text", DEFAULT_WORLD_NAME, @@ -116,7 +116,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) { const char *command[] = { "zenity", "--title", DIALOG_TITLE, - "--class", GUI_TITLE, + "--name", GUI_TITLE, "--list", "--radiolist", "--width", GAME_MODE_DIALOG_SIZE, @@ -149,7 +149,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) { const char *command[] = { "zenity", "--title", DIALOG_TITLE, - "--class", GUI_TITLE, + "--name", GUI_TITLE, "--entry", "--only-numerical", "--text", "Enter Seed (Leave Blank For Random):", diff --git a/mods/src/misc/logging.cpp b/mods/src/misc/logging.cpp index bf43041..95a66f9 100644 --- a/mods/src/misc/logging.cpp +++ b/mods/src/misc/logging.cpp @@ -105,4 +105,7 @@ void _init_misc_logging() { // Print Log On Game Save overwrite_calls((void *) Level_saveLevelData, (void *) Level_saveLevelData_injection); + + // Disable stdout Buffering + setvbuf(stdout, NULL, _IONBF, 0); }