mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-21 13:10:19 +00:00
Added a Win32 existing-instance fallback so --existing with no URL/command now sends a dedicated __WIN32_TASKBAR_TOGGLE__ command to the running ZoiteChat instance, instead of doing nothing. This gives taskbar/shortcut invocations an explicit toggle action.
Updated the Win32 WM_COPYDATA handler to recognize that toggle command and perform minimize/restore behavior: visible window → iconify hidden window → show/present while preserving existing behavior for normal remote commands.
This commit is contained in:
@@ -229,6 +229,10 @@ zoitechat_remote_win32 (void)
|
|||||||
{
|
{
|
||||||
sent = zoitechat_send_command_to_existing (hwnd, arg_command) || sent;
|
sent = zoitechat_send_command_to_existing (hwnd, arg_command) || sent;
|
||||||
}
|
}
|
||||||
|
else if (arg_existing)
|
||||||
|
{
|
||||||
|
sent = zoitechat_send_command_to_existing (hwnd, "__WIN32_TASKBAR_TOGGLE__") || sent;
|
||||||
|
}
|
||||||
|
|
||||||
if (arg_urls)
|
if (arg_urls)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3892,7 +3892,17 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
|||||||
|
|
||||||
if (command)
|
if (command)
|
||||||
{
|
{
|
||||||
handle_command (current_sess, command, FALSE);
|
if (strcmp (command, "__WIN32_TASKBAR_TOGGLE__") == 0)
|
||||||
|
{
|
||||||
|
if (gtk_widget_get_visible (current_sess->gui->window))
|
||||||
|
fe_ctrl_gui (current_sess, FE_GUI_ICONIFY, 0);
|
||||||
|
else
|
||||||
|
fe_ctrl_gui (current_sess, FE_GUI_SHOW, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
handle_command (current_sess, command, FALSE);
|
||||||
|
}
|
||||||
g_free (command);
|
g_free (command);
|
||||||
return GDK_FILTER_REMOVE;
|
return GDK_FILTER_REMOVE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user