Add Commits

This commit is contained in:
daleclack 2022-11-06 22:47:46 +08:00
parent b07ccc9bf1
commit f2acd6ba9f
1 changed files with 7 additions and 0 deletions

View File

@ -428,9 +428,16 @@ void MyDock::btnrun_clicked()
void MyDock::window_ctrl(Gtk::Window &window, bool on_dock)
{
// Get the GdkWindow object to get the state of a window
auto gdk_win = window.get_window();
if (gdk_win)
{
/*
The State of GdkWindow (GdkSurface for Gtk4)
Gdk::WINDOW_STATE_WITHDRAWN: The window is not shown
Gdk::WINDOW_STATE_ICONIFIED: The window is minimized
the default mode for first launch
*/
auto state = gdk_win->get_state();
switch (state)
{