Compare commits

..
Author SHA1 Message Date
deepend 479f1649ef Bump release metadata to 2.18.1 2026-05-21 18:11:33 -06:00
deepend-tildeclub 06f69184b6 Merge pull request #239 from ZoiteChat/size_t_int_fixes
Size t int fixes
2026-05-21 17:10:07 -06:00
deepend-tildeclub 3471d9a57c Merge pull request #241 from ZoiteChat/win32-relax-arch-check
Use x64compatible for Windows installer arch checks
2026-05-21 17:09:51 -06:00
deepend 28d4035477 Use x64compatible for Windows installer arch checks 2026-05-21 02:50:49 -06:00
deepend-tildeclub 3e1d151efd Merge pull request #240 from ZoiteChat/win32-dependency-update
Use new GTK3 bundle zip in Windows CI
2026-05-21 02:21:51 -06:00
deepend 556cfc3036 Use new GTK3 bundle zip in Windows CI 2026-05-20 21:25:37 -06:00
deepend c49b757be6 Clamp Win32 sysinfo UTF length casts 2026-05-20 15:51:07 -06:00
deepend cec7e2caf3 Use size_t for strlen length temporaries 2026-05-20 15:34:19 -06:00
deepend 9a0c07a461 Clean up Win32 size/length casts 2026-05-20 15:22:06 -06:00
deepend c7064c18b9 Clamp spell-provider length casts on Win32 2026-05-20 14:51:06 -06:00
deepend-tildeclub fb897310c8 Merge pull request #238 from ZoiteChat/win32-taskbar-icon-identity
Set Windows AppUserModelID before GTK startup
2026-05-20 11:56:38 -06:00
deepend 5944849326 Guard fullscreen menu sync against null session 2026-05-20 10:34:35 -06:00
deepend 1255f1e6c7 Fix Win taskbar toggle restore check 2026-05-20 10:19:51 -06:00
deepend d7bc09d859 Fix Win minimize-to-tray taskbar bounce 2026-05-20 09:46:33 -06:00
deepend f84a448351 Fix Win tray restore timer loop/reentry 2026-05-19 21:39:02 -06:00
deepend 7e34690e0c Set Windows AppUserModelID before GTK startup 2026-05-19 17:20:08 -06:00
deepend-tildeclub 6f6d378600 Merge pull request #237 from ZoiteChat/ddh-null-gdkwindow
Guard GTK drag/drop handlers against null GdkWindow
2026-05-19 15:55:21 -06:00
deepend-tildeclub 216b463b8f Merge pull request #236 from ZoiteChat/native-dialog-box
Make native file chooser modal on Windows
2026-05-19 15:55:01 -06:00
deepend 4ad84cb5e5 Guard GTK drag/drop handlers against null GdkWindow 2026-05-19 15:46:06 -06:00
deepend 19e0946717 Make native file chooser modal on Windows 2026-05-19 15:11:55 -06:00
deepend 0de1ad06cd Null-safe /set string preference rendering 2026-05-19 15:07:21 -06:00
deepend-tildeclub 72427006dd Merge pull request #231 from mlt/py-eol
fix(python): concatenate bytes in compile_line of py console
2026-05-12 15:34:31 -06:00
deepend-tildeclub 0e5f702651 Merge pull request #233 from ZoiteChat/userlist-button-meter-layout-fix
Tighten userlist button/meter layout
2026-05-11 08:17:02 -06:00
deepend 4f1b0fc838 Tighten userlist button/meter layout 2026-05-11 01:35:57 -06:00
Mikhail Titov 23d0963c2d fix(python): decode the console input to str in _on_say_command 2026-05-10 23:57:43 -05:00
23 changed files with 168 additions and 47 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ jobs:
Download-WithRetry -Url https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe -OutFile deps\innosetup-unicode.exe Download-WithRetry -Url https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe -OutFile deps\innosetup-unicode.exe
& deps\innosetup-unicode.exe /VERYSILENT | Out-Null & deps\innosetup-unicode.exe /VERYSILENT | Out-Null
Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.0-pre1/GTK3_Gvsbuild_zoitechat-2.18.0-pre1_${{ matrix.platform }}.7z -OutFile deps\gtk-${{ matrix.arch }}.7z Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.1/GTK3_Gvsbuild_zoitechat-2.18.1_x64.zip -OutFile deps\gtk-${{ matrix.arch }}.zip
& 7z.exe x deps\gtk-${{ matrix.arch }}.7z -oC:\gtk-build\gtk\x64\release Expand-Archive -LiteralPath deps\gtk-${{ matrix.arch }}.zip -DestinationPath C:\gtk-build\gtk\x64\release -Force
Download-WithRetry -Url https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hicolor-icon-theme-0.18-1-any.pkg.tar.zst -OutFile deps\hicolor-icon-theme.pkg.tar.zst Download-WithRetry -Url https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hicolor-icon-theme-0.18-1-any.pkg.tar.zst -OutFile deps\hicolor-icon-theme.pkg.tar.zst
python -c "import tarfile,zstandard,pathlib;archive=pathlib.Path(r'deps\\hicolor-icon-theme.pkg.tar.zst');target=pathlib.Path(r'C:\\gtk-build\\gtk\\x64\\release');dctx=zstandard.ZstdDecompressor();f=archive.open('rb');reader=dctx.stream_reader(f);tf=tarfile.open(fileobj=reader,mode='r|');[tf.extract(m,path=target) for m in tf if m.name.startswith('mingw64/share/icons/hicolor/')];tf.close();reader.close();f.close()" python -c "import tarfile,zstandard,pathlib;archive=pathlib.Path(r'deps\\hicolor-icon-theme.pkg.tar.zst');target=pathlib.Path(r'C:\\gtk-build\\gtk\\x64\\release');dctx=zstandard.ZstdDecompressor();f=archive.open('rb');reader=dctx.stream_reader(f);tf=tarfile.open(fileobj=reader,mode='r|');[tf.extract(m,path=target) for m in tf if m.name.startswith('mingw64/share/icons/hicolor/')];tf.close();reader.close();f.close()"
+22
View File
@@ -1,7 +1,28 @@
ZoiteChat ChangeLog ZoiteChat ChangeLog
================= =================
2.18.1 (2026-05-21)
-------------------
- Migrated D-Bus handling to GDBus.
- Enabled mouse wheel channel switching by default and consumed handled tab wheel events.
- Switched main panes to native GTK scrollbars.
- Tightened userlist button and meter layout.
- Made the native Windows file chooser modal.
- Set the Windows AppUserModelID before GTK startup.
- Updated Windows CI to use the new GTK3 bundle zip.
- Updated Windows installer architecture checks to use x64-compatible detection.
- Bumped the Flatpak Perl runtime to 5.42.2.
- Fixed palette color reads to preserve base GTK state.
- Fixed auto-replace whole-word matching.
- Fixed checksum file stream cleanup.
- Fixed byte handling in the Python console.
- Guarded GTK drag-and-drop handlers against null windows.
- Fixed size_t and integer handling issues.
- Removed the Winamp plugin.
2.18.0 (2026-04-20) 2.18.0 (2026-04-20)
-------------------
- Added optional close buttons on tabs. - Added optional close buttons on tabs.
- Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs. - Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.
@@ -19,6 +40,7 @@ ZoiteChat ChangeLog
- Improved AppStream metainfo validation. - Improved AppStream metainfo validation.
2.18.0~pre6 (2026-03-30) 2.18.0~pre6 (2026-03-30)
------------------------
- Applied app theme CSS to the menubar consistently across the app. - Applied app theme CSS to the menubar consistently across the app.
- Restored horizontal separator lines in menus. - Restored horizontal separator lines in menus.
@@ -29,6 +29,28 @@
<id>zoitechat.desktop</id> <id>zoitechat.desktop</id>
</provides> </provides>
<releases> <releases>
<release date="2026-05-21" version="2.18.1">
<description>
<ul>
<li>Migrated D-Bus handling to GDBus.</li>
<li>Enabled mouse wheel channel switching by default and consumed handled tab wheel events.</li>
<li>Switched main panes to native GTK scrollbars.</li>
<li>Tightened userlist button and meter layout.</li>
<li>Made the native Windows file chooser modal.</li>
<li>Set the Windows AppUserModelID before GTK startup.</li>
<li>Updated Windows CI to use the new GTK3 bundle zip.</li>
<li>Updated Windows installer architecture checks to use x64-compatible detection.</li>
<li>Bumped the Flatpak Perl runtime to 5.42.2.</li>
<li>Fixed palette color reads to preserve base GTK state.</li>
<li>Fixed auto-replace whole-word matching.</li>
<li>Fixed checksum file stream cleanup.</li>
<li>Fixed byte handling in the Python console.</li>
<li>Guarded GTK drag-and-drop handlers against null windows.</li>
<li>Fixed size_t and integer handling issues.</li>
<li>Removed the Winamp plugin.</li>
</ul>
</description>
</release>
<release date="2026-04-20" version="2.18.0"> <release date="2026-04-20" version="2.18.0">
<description> <description>
<p>Tabs and navigation:</p> <p>Tabs and navigation:</p>
+1 -1
View File
@@ -1,5 +1,5 @@
project('zoitechat', 'c', project('zoitechat', 'c',
version: '2.18.0', version: '2.18.1',
meson_version: '>= 0.55.0', meson_version: '>= 0.55.0',
default_options: [ default_options: [
'c_std=c17', 'c_std=c17',
+3 -3
View File
@@ -19,7 +19,7 @@ else:
if not hasattr(sys, 'argv'): if not hasattr(sys, 'argv'):
sys.argv = ['<zoitechat>'] sys.argv = ['<zoitechat>']
VERSION = b'2.18.0' VERSION = b'2.18.1'
PLUGIN_NAME = ffi.new('char[]', b'Python') PLUGIN_NAME = ffi.new('char[]', b'Python')
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1])) PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
PLUGIN_VERSION = ffi.new('char[]', VERSION) PLUGIN_VERSION = ffi.new('char[]', VERSION)
@@ -320,9 +320,9 @@ def _on_say_command(word, word_eol, userdata):
return 0 return 0
try: try:
python = _cstr(word_eol[1]) python = __decode(_cstr(word_eol[1]))
except Exception: except Exception:
python = b'' python = ''
if not python: if not python:
return 1 return 1
+5 -2
View File
@@ -1168,8 +1168,11 @@ set_showval (session *sess, const struct prefs *var, char *tbuf)
switch (var->type) switch (var->type)
{ {
case TYPE_STR: case TYPE_STR:
sprintf (tbuf + len, "\0033:\017 %s\n", (char *) &prefs + var->offset); {
break; const char *value = (char *) &prefs + var->offset;
sprintf (tbuf + len, "\0033:\017 %s\n", value ? value : "");
}
break;
case TYPE_INT: case TYPE_INT:
sprintf (tbuf + len, "\0033:\017 %d\n", *((int *) &prefs + var->offset)); sprintf (tbuf + len, "\0033:\017 %d\n", *((int *) &prefs + var->offset));
break; break;
+5 -5
View File
@@ -4166,10 +4166,10 @@ const struct commands xc_cmds[] = {
static int static int
command_compare (const void *a, const void *b) command_compare (const void *a, const void *b)
{ {
return g_ascii_strcasecmp (a, ((struct commands *)b)->name); return g_ascii_strcasecmp (a, ((const struct commands *)b)->name);
} }
static struct commands * static const struct commands *
find_internal_command (char *name) find_internal_command (char *name)
{ {
/* the "-1" is to skip the NULL terminator */ /* the "-1" is to skip the NULL terminator */
@@ -4205,7 +4205,7 @@ usercommand_show_help (session *sess, char *name)
static void static void
help (session *sess, char *tbuf, char *helpcmd, int quiet) help (session *sess, char *tbuf, char *helpcmd, int quiet)
{ {
struct commands *cmd; const struct commands *cmd;
if (plugin_show_help (sess, helpcmd)) if (plugin_show_help (sess, helpcmd))
return; return;
@@ -4397,7 +4397,7 @@ void
check_special_chars (char *cmd, int do_ascii) /* check for %X */ check_special_chars (char *cmd, int do_ascii) /* check for %X */
{ {
int occur = 0; int occur = 0;
int len = strlen (cmd); size_t len = strlen (cmd);
char *buf, *utf; char *buf, *utf;
char tbuf[4]; char tbuf[4];
int i = 0, j = 0; int i = 0, j = 0;
@@ -4763,7 +4763,7 @@ handle_command (session *sess, char *cmd, int check_spch)
char *word[PDIWORDS+1]; char *word[PDIWORDS+1];
char *word_eol[PDIWORDS+1]; char *word_eol[PDIWORDS+1];
static int command_level = 0; static int command_level = 0;
struct commands *int_cmd; const struct commands *int_cmd;
char *pdibuf; char *pdibuf;
char *tbuf; char *tbuf;
int len; int len;
+1 -1
View File
@@ -1017,7 +1017,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
char *account; char *account;
char ip[128], nick[NICKLEN]; char ip[128], nick[NICKLEN];
char *text, *ex; char *text, *ex;
int len = strlen (type); size_t len = strlen (type);
/* fill in the "ip" and "nick" buffers */ /* fill in the "ip" and "nick" buffers */
ex = strchr (word[1], '!'); ex = strchr (word[1], '!');
+17 -2
View File
@@ -22,6 +22,7 @@
#include <ctype.h> #include <ctype.h>
#include <inttypes.h> #include <inttypes.h>
#include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
@@ -74,6 +75,18 @@ typedef struct
static bool string_builder_init (StringBuilder *builder); static bool string_builder_init (StringBuilder *builder);
static void string_builder_free (StringBuilder *builder); static void string_builder_free (StringBuilder *builder);
static bool string_builder_append (StringBuilder *builder, const char *text); static bool string_builder_append (StringBuilder *builder, const char *text);
static int size_to_int (size_t value);
static int
size_to_int (size_t value)
{
if (value > (size_t) INT_MAX)
{
return INT_MAX;
}
return (int) value;
}
char * char *
sysinfo_get_cpu (void) sysinfo_get_cpu (void)
@@ -511,6 +524,7 @@ static char *read_hdd_info (IWbemClassObject *object)
static char *bstr_to_utf8 (BSTR bstr) static char *bstr_to_utf8 (BSTR bstr)
{ {
int utf8_len; int utf8_len;
int wide_len;
char *utf8; char *utf8;
if (bstr == NULL) if (bstr == NULL)
@@ -518,7 +532,8 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL; return NULL;
} }
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), NULL, 0, NULL, NULL); wide_len = size_to_int ((size_t) SysStringLen (bstr));
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, NULL, 0, NULL, NULL);
if (utf8_len <= 0) if (utf8_len <= 0)
{ {
return NULL; return NULL;
@@ -530,7 +545,7 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL; return NULL;
} }
if (WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), utf8, utf8_len, NULL, NULL) <= 0) if (WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, utf8, utf8_len, NULL, NULL) <= 0)
{ {
free (utf8); free (utf8);
return NULL; return NULL;
+1 -1
View File
@@ -321,7 +321,7 @@ url_check_line (char *buf)
for (i = 0; i < ARRAY_SIZE (commands); i++) for (i = 0; i < ARRAY_SIZE (commands); i++)
{ {
char *cmd = commands[i]; char *cmd = commands[i];
int len = strlen (cmd); size_t len = strlen (cmd);
if (strncmp (cmd, po, len) == 0) if (strncmp (cmd, po, len) == 0)
{ {
+1 -1
View File
@@ -98,7 +98,7 @@ path_part (char *file, char *path, int pathlen)
char * /* like strstr(), but nocase */ char * /* like strstr(), but nocase */
nocasestrstr (const char *s, const char *wanted) nocasestrstr (const char *s, const char *wanted)
{ {
register const int len = strlen (wanted); register const size_t len = strlen (wanted);
if (len == 0) if (len == 0)
return (char *)s; return (char *)s;
+1 -1
View File
@@ -452,7 +452,7 @@ void
fe_add_chan_list (server *serv, char *chan, char *users, char *topic) fe_add_chan_list (server *serv, char *chan, char *users, char *topic)
{ {
chanlistrow *next_row; chanlistrow *next_row;
int len = strlen (chan) + 1; size_t len = strlen (chan) + 1;
/* we allocate the struct and channel string in one go */ /* we allocate the struct and channel string in one go */
next_row = g_malloc (sizeof (chanlistrow) + len); next_row = g_malloc (sizeof (chanlistrow) + len);
+20
View File
@@ -124,6 +124,25 @@ create_msg_dialog (gchar *title, gchar *message)
static char *win32_argv0_dir; static char *win32_argv0_dir;
static void
win32_set_appusermodelid (void)
{
HMODULE shell32;
HRESULT (WINAPI *set_appid) (PCWSTR);
shell32 = GetModuleHandleW (L"shell32.dll");
if (!shell32)
shell32 = LoadLibraryW (L"shell32.dll");
if (!shell32)
return;
set_appid = (HRESULT (WINAPI *) (PCWSTR)) GetProcAddress (shell32, "SetCurrentProcessExplicitAppUserModelID");
if (!set_appid)
return;
set_appid (L"ZoiteChat.Desktop.Notify");
}
static void static void
win32_set_gsettings_schema_dir (void) win32_set_gsettings_schema_dir (void)
{ {
@@ -422,6 +441,7 @@ fe_args (int argc, char *argv[])
#ifdef WIN32 #ifdef WIN32
win32_set_gsettings_schema_dir (); win32_set_gsettings_schema_dir ();
win32_set_appusermodelid ();
win32_configure_pixbuf_loaders (); win32_configure_pixbuf_loaders ();
/* this is mainly for irc:// URL handling. When windows calls us from */ /* this is mainly for irc:// URL handling. When windows calls us from */
+5 -1
View File
@@ -522,6 +522,10 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
g_signal_connect (native, "response", g_signal_connect (native, "response",
G_CALLBACK (gtkutil_native_file_req_response), freq); G_CALLBACK (gtkutil_native_file_req_response), freq);
if (flags & FRF_MODAL)
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (native), TRUE);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
return; return;
} }
@@ -972,7 +976,7 @@ gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
win = gtk_widget_get_toplevel (GTK_WIDGET (widget)); win = gtk_widget_get_toplevel (GTK_WIDGET (widget));
if (gtk_widget_is_toplevel (win)) if (gtk_widget_is_toplevel (win))
{ {
int len = strlen (str); gint len = (gint) strlen (str);
if (selection) if (selection)
{ {
+33 -7
View File
@@ -902,7 +902,12 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) && if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) && (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
prefs.hex_gui_tray_minimize && prefs.hex_gui_tray && prefs.hex_gui_tray_minimize && prefs.hex_gui_tray &&
gtkutil_tray_icon_supported (wid)) gtkutil_tray_icon_supported (wid)
#ifndef WIN32
)
#else
&& !gtk_window_is_active (wid))
#endif
{ {
tray_toggle_visibility (TRUE); tray_toggle_visibility (TRUE);
} }
@@ -947,7 +952,8 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
if (sess && sess->gui && GTK_IS_WIDGET (sess->gui->window)) if (sess && sess->gui && GTK_IS_WIDGET (sess->gui->window))
gtk_widget_queue_draw (sess->gui->window); gtk_widget_queue_draw (sess->gui->window);
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen); if (current_sess && current_sess->gui)
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
mg_win32_allow_autohide_taskbar (wid, event); mg_win32_allow_autohide_taskbar (wid, event);
@@ -2412,9 +2418,9 @@ mg_userlist_button (GtkWidget * box, char *label, char *cmd,
g_signal_connect (G_OBJECT (wid), "clicked", g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (userlist_button_cb), cmd); G_CALLBACK (userlist_button_cb), cmd);
gtk_widget_set_hexpand (wid, TRUE); gtk_widget_set_hexpand (wid, TRUE);
gtk_widget_set_vexpand (wid, TRUE); gtk_widget_set_vexpand (wid, FALSE);
gtk_widget_set_halign (wid, GTK_ALIGN_FILL); gtk_widget_set_halign (wid, GTK_ALIGN_FILL);
gtk_widget_set_valign (wid, GTK_ALIGN_FILL); gtk_widget_set_valign (wid, GTK_ALIGN_CENTER);
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c); gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
show_and_unfocus (wid); show_and_unfocus (wid);
} }
@@ -3479,7 +3485,7 @@ mg_create_meters (session_gui *gui, GtkWidget *parent_box)
GtkWidget *infbox, *wid, *box; GtkWidget *infbox, *wid, *box;
gui->meter_box = infbox = box = mg_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 1); gui->meter_box = infbox = box = mg_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 1);
gtk_box_pack_start (GTK_BOX (parent_box), box, 0, 0, 0); gtk_box_pack_end (GTK_BOX (parent_box), box, 0, 0, 0);
if ((prefs.hex_gui_lagometer & 2) || (prefs.hex_gui_throttlemeter & 2)) if ((prefs.hex_gui_lagometer & 2) || (prefs.hex_gui_throttlemeter & 2))
{ {
@@ -4727,7 +4733,14 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
{ {
if (strcmp (command, "__WIN32_TASKBAR_TOGGLE__") == 0) if (strcmp (command, "__WIN32_TASKBAR_TOGGLE__") == 0)
{ {
if (gtk_widget_get_visible (current_sess->gui->window)) GdkWindowState state = 0;
GdkWindow *gdk_window = gtk_widget_get_window (current_sess->gui->window);
if (gdk_window)
state = gdk_window_get_state (gdk_window);
if (gtk_widget_get_visible (current_sess->gui->window)
&& (state & GDK_WINDOW_STATE_ICONIFIED) == 0)
fe_ctrl_gui (current_sess, FE_GUI_ICONIFY, 0); fe_ctrl_gui (current_sess, FE_GUI_ICONIFY, 0);
else else
fe_ctrl_gui (current_sess, FE_GUI_SHOW, 0); fe_ctrl_gui (current_sess, FE_GUI_SHOW, 0);
@@ -5241,9 +5254,14 @@ static void
mg_handle_drop (GtkWidget *widget, int y, int *pos, int *other_pos) mg_handle_drop (GtkWidget *widget, int y, int *pos, int *other_pos)
{ {
int height; int height;
GdkWindow *window;
session_gui *gui = current_sess->gui; session_gui *gui = current_sess->gui;
height = gdk_window_get_height (gtk_widget_get_window (widget)); window = gtk_widget_get_window (widget);
if (!window)
return;
height = gdk_window_get_height (window);
if (y < height / 2) if (y < height / 2)
{ {
@@ -5321,6 +5339,9 @@ mg_drag_begin_cb (GtkWidget *widget, GdkDragContext *context, gpointer userdata)
return FALSE; return FALSE;
window = gtk_widget_get_window (widget); window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
width = gdk_window_get_width (window); width = gdk_window_get_width (window);
height = gdk_window_get_height (window); height = gdk_window_get_height (window);
@@ -5398,11 +5419,16 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
width = allocation.width; width = allocation.width;
height = allocation.height; height = allocation.height;
window = gtk_widget_get_window (widget); window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
} }
else else
{ {
ox = oy = 0; ox = oy = 0;
window = gtk_widget_get_window (widget); window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
width = gdk_window_get_width (window); width = gdk_window_get_width (window);
height = gdk_window_get_height (window); height = gdk_window_get_height (window);
} }
+2 -2
View File
@@ -2309,7 +2309,7 @@ menu_reorder (GtkMenu *menu, GtkWidget *item, int pos)
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
{ {
GList *children = gtk_container_get_children (GTK_CONTAINER (menu)); GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
int length = g_list_length (children); gint length = (gint) g_list_length (children);
g_list_free (children); g_list_free (children);
gtk_menu_reorder_child (menu, item, (length + pos) - 1); gtk_menu_reorder_child (menu, item, (length + pos) - 1);
@@ -2381,7 +2381,7 @@ menu_add_sub (GtkWidget *menu, menu_entry *me)
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
{ {
GList *children = gtk_container_get_children (GTK_CONTAINER (menu)); GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
int length = g_list_length (children); gint length = (gint) g_list_length (children);
g_list_free (children); g_list_free (children);
pos = length + pos; pos = length + pos;
+8 -4
View File
@@ -920,7 +920,10 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
{ {
if (!tray_backend_is_embedded ()) if (!tray_backend_is_embedded ())
{ {
tray_restore_timer = g_timeout_add(500, (GSourceFunc)tray_menu_try_restore, NULL); if (!tray_restore_timer)
{
tray_restore_timer = g_timeout_add (500, (GSourceFunc) tray_menu_try_restore, NULL);
}
} }
else else
{ {
@@ -936,9 +939,10 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
static gboolean static gboolean
tray_menu_try_restore (void) tray_menu_try_restore (void)
{ {
tray_cleanup(); tray_restore_timer = 0;
tray_init(); tray_cleanup ();
return TRUE; tray_init ();
return G_SOURCE_REMOVE;
} }
static void static void
+2 -2
View File
@@ -1364,7 +1364,7 @@ setup_entry_cb (GtkEntry *entry, setting *set)
int size; int size;
int pos; int pos;
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry); unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
int len = strlen (p); size_t len = strlen ((const char *) p);
/* need to truncate? */ /* need to truncate? */
if (len >= set->extra) if (len >= set->extra)
@@ -2180,7 +2180,7 @@ unslash (char *dir)
{ {
if (dir[0]) if (dir[0])
{ {
int len = strlen (dir) - 1; size_t len = strlen (dir) - 1;
#ifdef WIN32 #ifdef WIN32
if (dir[len] == '/' || dir[len] == '\\') if (dir[len] == '/' || dir[len] == '\\')
#else #else
+1 -4
View File
@@ -4919,13 +4919,12 @@ gtk_xtext_check_marker_visibility (GtkXText * xtext)
static void static void
gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint maxo) gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint maxo)
{ {
gint off1, off2, curlen; gint off1, off2;
GSList *cursl; GSList *cursl;
offsets_t marks; offsets_t marks;
offlen_t *meta; offlen_t *meta;
off1 = 0; off1 = 0;
curlen = 0;
cursl = slp; cursl = slp;
while (cursl) while (cursl)
{ {
@@ -4935,7 +4934,6 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
off1 = meta->off + start; off1 = meta->off + start;
break; break;
} }
curlen += meta->len;
start -= meta->len; start -= meta->len;
end -= meta->len; end -= meta->len;
cursl = g_slist_next (cursl); cursl = g_slist_next (cursl);
@@ -4950,7 +4948,6 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
off2 = meta->off + end; off2 = meta->off + end;
break; break;
} }
curlen += meta->len;
end -= meta->len; end -= meta->len;
cursl = g_slist_next (cursl); cursl = g_slist_next (cursl);
} }
+2 -1
View File
@@ -313,7 +313,8 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
gboolean no_activity) gboolean no_activity)
{ {
int dotime = FALSE; int dotime = FALSE;
int comma, k, i = 0, j = 0, len = strlen (text); int comma, k, i = 0, j = 0;
size_t len = strlen (text);
unsigned char *newtext = g_malloc (len + 1024); unsigned char *newtext = g_malloc (len + 1024);
+11 -4
View File
@@ -26,12 +26,19 @@
#include <windows.h> #include <windows.h>
#include <cstdlib> #include <cstdlib>
#include <climits>
#include "typedef.h" // for ssize_t #include "typedef.h" // for ssize_t
#include <enchant-provider.h> #include <enchant-provider.h>
ENCHANT_PLUGIN_DECLARE ("win8") ENCHANT_PLUGIN_DECLARE ("win8")
static int
size_to_int (size_t value)
{
return value > static_cast<size_t>(INT_MAX) ? INT_MAX : static_cast<int>(value);
}
static char * static char *
utf16_to_utf8 (const wchar_t * const str, bool from_bcp47) utf16_to_utf8 (const wchar_t * const str, bool from_bcp47)
{ {
@@ -136,7 +143,7 @@ static void
win8_dict_add_to_personal (EnchantDict *dict, const char *const word, size_t len) win8_dict_add_to_personal (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
checker->Add (wword); checker->Add (wword);
std::free (wword); std::free (wword);
@@ -146,7 +153,7 @@ static void
win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len) win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
checker->Ignore (wword); checker->Ignore (wword);
std::free (wword); std::free (wword);
@@ -156,7 +163,7 @@ static int
win8_dict_check (EnchantDict *dict, const char *const word, size_t len) win8_dict_check (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
IEnumSpellingError *errors; IEnumSpellingError *errors;
ISpellingError *error = nullptr; ISpellingError *error = nullptr;
HRESULT hr; HRESULT hr;
@@ -184,7 +191,7 @@ static char **
win8_dict_suggest (EnchantDict *dict, const char *const word, size_t len, size_t *out_n_suggs) win8_dict_suggest (EnchantDict *dict, const char *const word, size_t len, size_t *out_n_suggs)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
IEnumString *suggestions; IEnumString *suggestions;
HRESULT hr; HRESULT hr;
+2 -2
View File
@@ -30,8 +30,8 @@ PrivilegesRequired=none
ShowComponentSizes=no ShowComponentSizes=no
CreateUninstallRegKey=not IsTaskSelected('portable') CreateUninstallRegKey=not IsTaskSelected('portable')
Uninstallable=not IsTaskSelected('portable') Uninstallable=not IsTaskSelected('portable')
ArchitecturesAllowed=x64 ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64 ArchitecturesInstallIn64BitMode=x64compatible
MinVersion=6.1 MinVersion=6.1
WizardImageFile={#PROJECTDIR}wizardimage.bmp WizardImageFile={#PROJECTDIR}wizardimage.bmp
WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp
+1 -1
View File
@@ -1 +1 @@
2.18.0 2.18.1