mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-13 17:20:21 +00:00
fix: Win32 taskbar toggle + --existing now work.
This commit is contained in:
@@ -91,7 +91,7 @@ static const GOptionEntry gopt_entries[] =
|
||||
{"configdir", 'u', 0, G_OPTION_ARG_NONE, &arg_show_config, N_("Show user config directory"), NULL},
|
||||
{"url", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &arg_url, N_("Open an irc://server:port/channel?key URL"), "URL"},
|
||||
{"command", 'c', 0, G_OPTION_ARG_STRING, &arg_command, N_("Execute command:"), "COMMAND"},
|
||||
#ifdef USE_DBUS
|
||||
#if defined(USE_DBUS) || defined(WIN32)
|
||||
{"existing", 'e', 0, G_OPTION_ARG_NONE, &arg_existing, N_("Open URL or execute command in an existing ZoiteChat"), NULL},
|
||||
#endif
|
||||
{"minimize", 0, 0, G_OPTION_ARG_INT, &arg_minimize, N_("Begin minimized. Level 0=Normal 1=Iconified 2=Tray"), N_("level")},
|
||||
|
||||
@@ -3868,10 +3868,21 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
{
|
||||
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);
|
||||
GtkWidget *window = current_sess->gui->window;
|
||||
GtkWindow *gtk_window = GTK_WINDOW (window);
|
||||
GdkWindow *gdk_window = gtk_widget_get_window (window);
|
||||
gboolean iconified = gdk_window && ((gdk_window_get_state (gdk_window) & GDK_WINDOW_STATE_ICONIFIED) != 0);
|
||||
|
||||
if (!gtk_widget_get_visible (window) || iconified)
|
||||
{
|
||||
gtk_widget_show (window);
|
||||
gtk_window_deiconify (gtk_window);
|
||||
gtk_window_present (gtk_window);
|
||||
}
|
||||
else
|
||||
fe_ctrl_gui (current_sess, FE_GUI_SHOW, 0);
|
||||
{
|
||||
gtk_window_iconify (gtk_window);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user