diff options
author | Mark Jansen <mark.jansen@reactos.org> | 2017-11-14 21:47:17 +0100 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2018-03-09 13:24:08 -0500 |
commit | 9b8a7eaa0147c6a564c1d1401d57cc685461e320 (patch) | |
tree | dac6421083b173c1b89c2a1e733abdc6627ddab0 | |
parent | cdefb8e2d65f94aa5f1e88dda487dcf72f92ef34 (diff) |
win32: Respond to WM_TIMECHANGE by updating the CRT timezone info
Closes #2090 Fixes #1851
-rw-r--r-- | src/fe-gtk/maingui.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index d0c59aa0..7ac65c5a 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -3200,11 +3200,29 @@ mg_tabwindow_de_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) return TRUE; } +#ifdef G_OS_WIN32 +static GdkFilterReturn +mg_time_change (GdkXEvent *xevent, GdkEvent *event, gpointer data) +{ + MSG *msg = (MSG*)xevent; + + if (msg->message == WM_TIMECHANGE) + { + _tzset(); + } + + return GDK_FILTER_CONTINUE; +} +#endif + static void mg_create_tabwindow (session *sess) { GtkWidget *win; GtkWidget *table; +#ifdef G_OS_WIN32 + GdkWindow *parent_win; +#endif win = gtkutil_window_new ("HexChat", NULL, prefs.hex_gui_win_width, prefs.hex_gui_win_height, 0); @@ -3269,6 +3287,11 @@ mg_create_tabwindow (session *sess) mg_place_userlist_and_chanview (sess->gui); gtk_widget_show (win); + +#ifdef G_OS_WIN32 + parent_win = gtk_widget_get_window (win); + gdk_window_add_filter (parent_win, mg_time_change, NULL); +#endif } void |