From 081f35350cd1cb7a948ad0f99641c0efb75468c3 Mon Sep 17 00:00:00 2001 From: daleclack Date: Tue, 19 Mar 2024 22:45:32 +0800 Subject: [PATCH] Tag window ctrl func for poor wayland support --- Gtk4_Reset/src/ui/MyDock.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Gtk4_Reset/src/ui/MyDock.cpp b/Gtk4_Reset/src/ui/MyDock.cpp index f68822d..cb6075e 100644 --- a/Gtk4_Reset/src/ui/MyDock.cpp +++ b/Gtk4_Reset/src/ui/MyDock.cpp @@ -66,6 +66,7 @@ void hide_launchpad(MyDock *dock) dock->current_page = MainPage; } + static void btnlaunch_clicked(GtkWidget *widget, MyDock *dock) { // Check is launchpad page is shown and switch pages @@ -93,7 +94,7 @@ static void pressed(GtkGesture *gesture, int n_press, gtk_popover_popup(GTK_POPOVER(dock->context_menu)); } -// Window control func +// Window control func, X11/Windows Only! static void window_ctrl(GtkWindow *window, GtkWindow *parent) { // Get GdkSurface for window state @@ -101,14 +102,18 @@ static void window_ctrl(GtkWindow *window, GtkWindow *parent) if (surface) { // The state will available when the window open - unsigned short state = gdk_toplevel_get_state(GDK_TOPLEVEL(surface)); + unsigned state = gdk_toplevel_get_state(GDK_TOPLEVEL(surface)); switch (state) { // Minimized case GDK_TOPLEVEL_STATE_MINIMIZED: + // g_print("Try to unminimize window"); gtk_window_set_transient_for(window, parent); gtk_window_unminimize(window); +#ifdef _WIN32 + // Fix for Microsoft Windows gtk_window_present(window); +#endif break; default: // The controlled window is on dock