mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Restore GTK dialogs on Cinnamon
This commit is contained in:
parent
1890afabbb
commit
0a80ce24ef
1 changed files with 3 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ static int linux_dialog(void *rawData)
|
|||
}
|
||||
|
||||
// Display dialog and get result
|
||||
GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, gtktype, gtkbuttons, data->body);
|
||||
GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, gtktype, gtkbuttons, "%s", data->body);
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), data->title);
|
||||
int result = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
|
|
@ -284,6 +284,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
|
|||
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::tolower);
|
||||
if (desktop.find("cinnamon") != std::string::npos) {
|
||||
desktopEnv = "cinnamon";
|
||||
gtk_init(0, 0);
|
||||
} else if (
|
||||
desktop.find("gnome") != std::string::npos ||
|
||||
desktop.find("unity") != std::string::npos
|
||||
|
|
@ -476,7 +477,7 @@ bool Oneshot::msgbox(int type, const char *body, const char *title)
|
|||
if (!title)
|
||||
title = "";
|
||||
#if defined OS_LINUX
|
||||
if (desktopEnv == "gnome" || desktopEnv == "mate") {
|
||||
if (desktopEnv == "gnome" || desktopEnv == "mate" || desktopEnv == "cinnamon") {
|
||||
linux_DialogData data = {type, body, title, 0};
|
||||
gdk_threads_add_idle(linux_dialog, &data);
|
||||
gtk_main();
|
||||
|
|
|
|||
Loading…
Reference in a new issue