From 7cfa3b35133c7c5a2b3871f48120c4505b55aa0f Mon Sep 17 00:00:00 2001 From: deepend Date: Wed, 25 Feb 2026 14:18:23 -0700 Subject: [PATCH 1/2] Added a Windows-only helper (mg_win32_allow_autohide_taskbar) that gets the native HWND and calls SetWindowPos(..., HWND_NOTOPMOST, ...) for non-fullscreen window-state transitions, so a maximized ZoiteChat window no longer blocks the taskbar auto-hide reveal edge. Hooked that helper into mg_windowstate_cb so it runs whenever the main window state changes (while preserving existing maximize/fullscreen preference handling). --- src/fe-gtk/maingui.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 4add6786..1a58d01d 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -58,6 +58,36 @@ #ifdef G_OS_WIN32 #include +#include + +static void +mg_win32_allow_autohide_taskbar (GtkWindow *window, GdkEventWindowState *event) +{ + GdkWindow *gdk_window; + HWND hwnd; + + if (!window || !event) + return; + + if ((event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0) + return; + + gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + if (!gdk_window) + return; + + hwnd = gdk_win32_window_get_handle (gdk_window); + if (!hwnd) + return; + + SetWindowPos (hwnd, + HWND_NOTOPMOST, + 0, + 0, + 0, + 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOOWNERZORDER); +} #endif #define ICON_TAB_DETACH "zc-menu-detach" @@ -659,6 +689,10 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen); +#ifdef G_OS_WIN32 + mg_win32_allow_autohide_taskbar (wid, event); +#endif + return FALSE; } From e3f932aa6ba9ebb3284c6cfd4fabfacfb01cd9f7 Mon Sep 17 00:00:00 2001 From: deepend Date: Wed, 25 Feb 2026 14:48:18 -0700 Subject: [PATCH 2/2] =?UTF-8?q?Updated=20the=20Win32=20window-state=20hand?= =?UTF-8?q?ling=20to=20include=20shellapi.h=20and=20query=20taskbar=20auto?= =?UTF-8?q?-hide/taskbar=20edge=20state=20via=20SHAppBarMessage,=20so=20ma?= =?UTF-8?q?ximized=20windows=20can=20leave=20a=201px=20reveal=20edge=20for?= =?UTF-8?q?=20the=20auto-hidden=20taskbar.=20Added=20monitor-aware=20work-?= =?UTF-8?q?area=20adjustment=20when=20maximized=20(MonitorFromWindow=20+?= =?UTF-8?q?=20GetMonitorInfo)=20and=20shrink=20by=201px=20on=20the=20detec?= =?UTF-8?q?ted=20taskbar=20edge=20(including=20bottom=20edge),=20then=20ap?= =?UTF-8?q?ply=20that=20rectangle=20with=20SetWindowPos.=20This=20addresse?= =?UTF-8?q?s=20the=20=E2=80=9Cmouse=20at=20bottom=20edge=20should=20unhide?= =?UTF-8?q?=20taskbar=E2=80=9D=20behavior.=20Kept=20the=20existing=20HWND?= =?UTF-8?q?=5FNOTOPMOST=20safeguard=20in=20place=20after=20the=20adjustmen?= =?UTF-8?q?t,=20preserving=20prior=20not-topmost=20behavior.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fe-gtk/maingui.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 1a58d01d..1dcfb871 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -58,6 +58,7 @@ #ifdef G_OS_WIN32 #include +#include #include static void @@ -80,6 +81,56 @@ mg_win32_allow_autohide_taskbar (GtkWindow *window, GdkEventWindowState *event) if (!hwnd) return; + if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) + { + APPBARDATA appbar_data; + RECT work_area; + + ZeroMemory (&appbar_data, sizeof (APPBARDATA)); + appbar_data.cbSize = sizeof (APPBARDATA); + + if ((SHAppBarMessage (ABM_GETSTATE, &appbar_data) & ABS_AUTOHIDE) != 0 && + SHAppBarMessage (ABM_GETTASKBARPOS, &appbar_data) != 0) + { + HMONITOR monitor; + MONITORINFO monitor_info; + + monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONEAREST); + ZeroMemory (&monitor_info, sizeof (MONITORINFO)); + monitor_info.cbSize = sizeof (MONITORINFO); + + if (monitor && GetMonitorInfo (monitor, &monitor_info)) + { + work_area = monitor_info.rcMonitor; + + switch (appbar_data.uEdge) + { + case ABE_LEFT: + work_area.left += 1; + break; + case ABE_TOP: + work_area.top += 1; + break; + case ABE_RIGHT: + work_area.right -= 1; + break; + case ABE_BOTTOM: + default: + work_area.bottom -= 1; + break; + } + + SetWindowPos (hwnd, + NULL, + work_area.left, + work_area.top, + work_area.right - work_area.left, + work_area.bottom - work_area.top, + SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); + } + } + } + SetWindowPos (hwnd, HWND_NOTOPMOST, 0,