44 Commits

Author SHA1 Message Date
57f8f97e59 fix syntax error 2026-05-22 01:55:53 -06:00
f0a0ea699d Flatpak: missed changes to flatpak app id. 2026-05-22 01:35:49 -06:00
005d9c6849 Tighten Flatpak D-Bus permissions 2026-05-22 00:34:09 -06:00
115ac17968 Inline Flatpak deps, bump GNOME runtime to 50 2026-05-22 00:29:13 -06:00
d8600a2237 Prep Flatpak manifest for Flathub stable submission 2026-05-22 00:23:42 -06:00
6535810ca3 Rename app IDs to org.zoitechat.ZoiteChat 2026-05-22 00:08:54 -06:00
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
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
556cfc3036 Use new GTK3 bundle zip in Windows CI 2026-05-20 21:25:37 -06:00
c49b757be6 Clamp Win32 sysinfo UTF length casts 2026-05-20 15:51:07 -06:00
cec7e2caf3 Use size_t for strlen length temporaries 2026-05-20 15:34:19 -06:00
9a0c07a461 Clean up Win32 size/length casts 2026-05-20 15:22:06 -06:00
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
5944849326 Guard fullscreen menu sync against null session 2026-05-20 10:34:35 -06:00
1255f1e6c7 Fix Win taskbar toggle restore check 2026-05-20 10:19:51 -06:00
d7bc09d859 Fix Win minimize-to-tray taskbar bounce 2026-05-20 09:46:33 -06:00
f84a448351 Fix Win tray restore timer loop/reentry 2026-05-19 21:39:02 -06:00
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
4ad84cb5e5 Guard GTK drag/drop handlers against null GdkWindow 2026-05-19 15:46:06 -06:00
19e0946717 Make native file chooser modal on Windows 2026-05-19 15:11:55 -06:00
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
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
deepend-tildeclub
dcb35fb80f Merge pull request #230 from ZoiteChat/fix-scrollbar-consistency
UI Consistency: Use native GTK scrollbars across main panes
2026-05-10 08:31:15 -06:00
b1768854c3 Tighten userlist count/pane width behavior 2026-05-09 12:53:35 -06:00
4ed4eaf8e8 fix FSF address. 2026-05-08 20:50:51 -06:00
deepend-tildeclub
d167b53b17 Merge pull request #227 from ZoiteChat/fix-tab-scroll-skip
Consume handled tab wheel events
2026-05-08 07:52:37 -06:00
18eff80a30 UI Consistency: Use native GTK scrollbars across main panes 2026-05-07 13:29:22 -06:00
a44ec5f624 Consume handled tab wheel events 2026-05-07 12:03:41 -06:00
deepend-tildeclub
5da518f50e Merge pull request #226 from mlt/close-file-stream
fix(checksum): Make sure file stream is closed
2026-05-07 09:21:28 -06:00
Mikhail Titov
ebb11a8ac5 fix(checksum): Make sure file stream is closed 2026-05-07 09:11:10 -05:00
deepend-tildeclub
dd9c5db1aa Merge pull request #224 from ZoiteChat/channel_switcher_mouse_wheel_fix
Fix and Enable mouse wheel channel switching by default
2026-05-06 13:35:13 -06:00
984ac9763e Fix and Enable mouse wheel channel switching by default 2026-05-06 13:10:30 -06:00
deepend-tildeclub
ad67af2f8f Merge pull request #222 from ZoiteChat/fix-autocorrect-replace
Fix auto-replace to respect whole-word matches
2026-05-05 17:32:29 -06:00
cc8460d366 Fix auto-replace to respect whole-word matches 2026-05-05 17:22:56 -06:00
1dc9b9c956 Use Lua 5.4 deps in CI 2026-04-29 16:21:01 -06:00
46 changed files with 572 additions and 269 deletions

View File

@@ -34,7 +34,7 @@ jobs:
libwayland-client0 libwayland-cursor0 libwayland-egl1 \ libwayland-client0 libwayland-cursor0 libwayland-egl1 \
libxkbcommon0 \ libxkbcommon0 \
libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \ libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \
libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \ liblua5.4-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \ perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \
fonts-noto-color-emoji breeze-gtk-theme \ fonts-noto-color-emoji breeze-gtk-theme \
patchelf file curl patchelf file curl
@@ -261,8 +261,8 @@ jobs:
./linuxdeploy-x86_64.AppImage \ ./linuxdeploy-x86_64.AppImage \
--appdir AppDir \ --appdir AppDir \
--desktop-file AppDir/usr/share/applications/net.zoite.Zoitechat.desktop \ --desktop-file AppDir/usr/share/applications/org.zoitechat.ZoiteChat.desktop \
--icon-file AppDir/usr/share/icons/hicolor/48x48/apps/net.zoite.Zoitechat.png \ --icon-file AppDir/usr/share/icons/hicolor/48x48/apps/org.zoitechat.ZoiteChat.png \
--custom-apprun ./AppRun \ --custom-apprun ./AppRun \
--plugin gtk \ --plugin gtk \
--output appimage --output appimage

View File

@@ -33,7 +33,7 @@ jobs:
uses: flatpak/flatpak-github-actions/flatpak-builder@v6 uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with: with:
bundle: zoitechat.flatpak bundle: zoitechat.flatpak
manifest-path: flatpak/net.zoite.Zoitechat.json manifest-path: flatpak/org.zoitechat.ZoiteChat.json
cache: false cache: false
restore-cache: false restore-cache: false

View File

@@ -34,7 +34,6 @@ jobs:
openssl \ openssl \
libcanberra \ libcanberra \
libayatana-appindicator \ libayatana-appindicator \
luajit \
iso-codes \ iso-codes \
lua \ lua \
perl \ perl \

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()"

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.

View File

@@ -1,11 +1,11 @@
icondir = join_paths(get_option('datadir'), 'icons/hicolor') icondir = join_paths(get_option('datadir'), 'icons/hicolor')
install_data( install_data(
'zoitechat.png', 'zoitechat.png',
rename: 'net.zoite.Zoitechat.png', rename: 'org.zoitechat.ZoiteChat.png',
install_dir: join_paths(icondir, '48x48/apps') install_dir: join_paths(icondir, '48x48/apps')
) )
install_data( install_data(
'zoitechat.svg', 'zoitechat.svg',
rename: 'net.zoite.Zoitechat.svg', rename: 'org.zoitechat.ZoiteChat.svg',
install_dir: join_paths(icondir, 'scalable/apps') install_dir: join_paths(icondir, 'scalable/apps')
) )

View File

@@ -6,8 +6,8 @@ desktop_utils = find_program('desktop-file-validate', required: false)
if get_option('gtk-frontend') if get_option('gtk-frontend')
if get_option('install-appdata') if get_option('install-appdata')
zoitechat_appdata = i18n.merge_file( zoitechat_appdata = i18n.merge_file(
input: 'net.zoite.Zoitechat.appdata.xml.in', input: 'org.zoitechat.ZoiteChat.metainfo.xml.in',
output: 'net.zoite.Zoitechat.appdata.xml', output: 'org.zoitechat.ZoiteChat.metainfo.xml',
po_dir: '../../po', po_dir: '../../po',
install: true, install: true,
install_dir: metainfodir install_dir: metainfodir
@@ -15,7 +15,7 @@ if get_option('gtk-frontend')
appstreamcli = find_program('appstreamcli', required: false) appstreamcli = find_program('appstreamcli', required: false)
if appstreamcli.found() if appstreamcli.found()
test('Validate net.zoite.Zoitechat.appdata.xml', appstreamcli, test('Validate org.zoitechat.ZoiteChat.metainfo.xml', appstreamcli,
args: ['validate', zoitechat_appdata] args: ['validate', zoitechat_appdata]
) )
endif endif
@@ -29,14 +29,14 @@ if get_option('gtk-frontend')
endif endif
desktop_file = configure_file( desktop_file = configure_file(
input: 'net.zoite.Zoitechat.desktop.in.in', input: 'org.zoitechat.ZoiteChat.desktop.in.in',
output: 'net.zoite.Zoitechat.desktop.in', output: 'org.zoitechat.ZoiteChat.desktop.in',
configuration: desktop_conf configuration: desktop_conf
) )
zoitechat_desktop = i18n.merge_file( zoitechat_desktop = i18n.merge_file(
input: desktop_file, input: desktop_file,
output: 'net.zoite.Zoitechat.desktop', output: 'org.zoitechat.ZoiteChat.desktop',
po_dir: '../../po', po_dir: '../../po',
type: 'desktop', type: 'desktop',
install: true, install: true,
@@ -44,7 +44,7 @@ if get_option('gtk-frontend')
) )
if desktop_utils.found() if desktop_utils.found()
test('Validate net.zoite.Zoitechat.desktop', desktop_utils, test('Validate org.zoitechat.ZoiteChat.desktop', desktop_utils,
args: [zoitechat_desktop] args: [zoitechat_desktop]
) )
endif endif
@@ -98,14 +98,14 @@ if get_option('plugin')
conf.set('LICENSE', metainfo[2]) conf.set('LICENSE', metainfo[2])
plugin_appdata = configure_file( plugin_appdata = configure_file(
input: 'net.zoite.Zoitechat.Plugin.metainfo.xml.in', input: 'org.zoitechat.ZoiteChat.Plugin.metainfo.xml.in',
output: 'net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name), output: 'org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name),
configuration: conf, configuration: conf,
install_dir: get_option('install-plugin-metainfo') ? metainfodir : '', install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
) )
if appstreamcli.found() if appstreamcli.found()
test('Validate net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli, test('Validate org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli,
args: ['validate', plugin_appdata] args: ['validate', plugin_appdata]
) )
endif endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="addon"> <component type="addon">
<id>net.zoite.Zoitechat.Plugin.@NAME@</id> <id>org.zoitechat.ZoiteChat.Plugin.@NAME@</id>
<extends>net.zoite.Zoitechat</extends> <extends>org.zoitechat.ZoiteChat</extends>
<name>@NAME@ Plugin</name> <name>@NAME@ Plugin</name>
<summary>@SUMMARY@</summary> <summary>@SUMMARY@</summary>
<url type="homepage">https://zoitechat.org/</url> <url type="homepage">https://zoitechat.org/</url>

View File

@@ -4,12 +4,12 @@ GenericName=IRC Client
Comment=Chat with other people online Comment=Chat with other people online
Keywords=IM;Chat; Keywords=IM;Chat;
Exec=@exec_command@ Exec=@exec_command@
Icon=net.zoite.Zoitechat Icon=org.zoitechat.ZoiteChat
Terminal=false Terminal=false
Type=Application Type=Application
Categories=GTK;Network;IRCClient; Categories=GTK;Network;IRCClient;
StartupNotify=true StartupNotify=true
StartupWMClass=net.zoite.Zoitechat StartupWMClass=org.zoitechat.ZoiteChat
X-GNOME-UsesNotifications=true X-GNOME-UsesNotifications=true
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs; MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
Actions=SafeMode; Actions=SafeMode;

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application"> <component type="desktop-application">
<id>net.zoite.Zoitechat</id> <id>org.zoitechat.ZoiteChat</id>
<name>ZoiteChat</name> <name>ZoiteChat</name>
<launchable type="desktop-id">net.zoite.Zoitechat.desktop</launchable> <launchable type="desktop-id">org.zoitechat.ZoiteChat.desktop</launchable>
<developer id="net.zoite"> <developer id="org.zoitechat">
<name translate="no">ZoiteChat</name> <name translate="no">ZoiteChat</name>
</developer> </developer>
@@ -26,9 +26,31 @@
</screenshot> </screenshot>
</screenshots> </screenshots>
<provides> <provides>
<id>zoitechat.desktop</id> <id>org.zoitechat.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>
@@ -317,7 +339,7 @@
<description> <description>
<p>This is largely a bug fix release though it has some large behind the scenes changes:</p> <p>This is largely a bug fix release though it has some large behind the scenes changes:</p>
<ul> <ul>
<li>Rename data files to use *net.zoite.Zoitechat* name</li> <li>Rename data files to use *org.zoitechat.ZoiteChat* name</li>
<li>Add option (irc_reconnect_rejoin) to disable auto-rejoin on reconnect</li> <li>Add option (irc_reconnect_rejoin) to disable auto-rejoin on reconnect</li>
<li>Add ability to set custom tray icon separate of app icon</li> <li>Add ability to set custom tray icon separate of app icon</li>
<li>Fix Enchant 2.0+ support</li> <li>Fix Enchant 2.0+ support</li>

View File

@@ -1,25 +1,17 @@
From 918503d57c6740d20be68a6717158673a2a8b25f Mon Sep 17 00:00:00 2001
From: Patrick Griffis <tingping@tingping.se>
Date: Sat, 17 Mar 2018 05:57:49 -0400
Subject: [PATCH] Support loading Flatpak extensions
---
src/common/plugin.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 3ad3c558..6addf962 100644
--- a/src/common/plugin.c --- a/src/common/plugin.c
+++ b/src/common/plugin.c +++ b/src/common/plugin.c
@@ -450,6 +450,8 @@ plugin_auto_load (session *sess) @@ -470,7 +470,14 @@
lib_dir = plugin_get_libdir (); if (libdir && *libdir)
sub_dir = g_build_filename (get_xdir (), "addons", NULL); return libdir;
else
+ for_files ("/app/extensions/lib/zoitechat/plugins", "*.so", plugin_auto_load_cb); + {
+ if (g_file_test ("/app/extensions/lib/zoitechat/plugins", G_FILE_TEST_IS_DIR))
+ {
+ return "/app/extensions/lib/zoitechat/plugins";
+ }
+ +
#ifdef WIN32 return ZOITECHATLIBDIR;
/* a long list of bundled plugins that should be loaded automatically, + }
* user plugins should go to <config>, leave Program Files alone! */ }
--
2.14.3
void

View File

@@ -1,82 +0,0 @@
{
"app-id": "net.zoite.Zoitechat",
"branch": "master",
"runtime": "org.gnome.Platform",
"runtime-version": "49",
"sdk": "org.gnome.Sdk",
"command": "zoitechat",
"finish-args": [
"--share=ipc",
"--socket=wayland",
"--socket=fallback-x11",
"--share=network",
"--socket=pulseaudio",
"--filesystem=xdg-download",
"--filesystem=xdg-data/themes:ro",
"--filesystem=xdg-data/icons:ro",
"--filesystem=xdg-run/tray-icon:create",
"--env=GTK_CSD=1",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar",
"--talk-name=org.mpris.MediaPlayer2.*"
],
"add-extensions": {
"net.zoite.Zoitechat.Plugin": {
"version": "49",
"directory": "extensions",
"add-ld-path": "lib",
"merge-dirs": "lib/zoitechat/plugins",
"subdirectories": true,
"no-autodownload": true,
"autodelete": true
}
},
"modules": [
"shared-modules/lua5.4/lua-5.4.json",
"shared-modules/libcanberra/libcanberra.json",
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
"python3-cffi.json",
"perl.json",
{
"name": "lgi",
"buildsystem": "meson",
"sources": [
{
"type": "archive",
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
}
]
},
{
"name": "zoitechat",
"buildsystem": "meson",
"config-opts": [
"-Ddbus-service-use-appid=true",
"-Dwith-perl=perl",
"-Dwith-python=python3",
"-Dwith-lua=lua"
],
"build-options": {
"cflags": "-Wno-error=missing-include-dirs"
},
"cleanup": [
"/share/man"
],
"post-install": [
"install -d /app/extensions"
],
"sources": [
{
"type": "dir",
"path": ".."
},
{
"type": "patch",
"path": "Load-plugins-from-Flatpak-extensions.patch"
}
]
}
]
}

View File

@@ -0,0 +1,127 @@
{
"app-id": "org.zoitechat.ZoiteChat",
"runtime": "org.gnome.Platform",
"runtime-version": "50",
"sdk": "org.gnome.Sdk",
"command": "zoitechat",
"finish-args": [
"--share=ipc",
"--socket=wayland",
"--socket=fallback-x11",
"--share=network",
"--socket=pulseaudio",
"--filesystem=xdg-download",
"--filesystem=xdg-run/tray-icon:create",
"--env=GTK_CSD=1",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar"
],
"add-extensions": {
"org.zoitechat.ZoiteChat.Plugin": {
"version": "50",
"directory": "extensions",
"add-ld-path": "lib",
"merge-dirs": "lib/zoitechat/plugins",
"subdirectories": true,
"no-autodownload": true,
"autodelete": true
}
},
"modules": [
"shared-modules/lua5.4/lua-5.4.json",
"shared-modules/libcanberra/libcanberra.json",
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
{
"name": "python3-cffi",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
}
]
},
{
"name": "perl",
"buildsystem": "simple",
"build-options": {
"no-debuginfo": true
},
"build-commands": [
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
"make -j${FLATPAK_BUILDER_N_JOBS}",
"make install"
],
"cleanup": [
"/share/man",
"/lib/perl5/*/*/CORE/*.a"
],
"sources": [
{
"type": "archive",
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
}
]
},
{
"name": "lgi",
"buildsystem": "meson",
"sources": [
{
"type": "archive",
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
}
]
},
{
"name": "zoitechat",
"buildsystem": "meson",
"config-opts": [
"-Ddbus-service-use-appid=true",
"-Dwith-perl=perl",
"-Dwith-python=python3",
"-Dwith-lua=lua"
],
"build-options": {
"cflags": "-Wno-error=missing-include-dirs"
},
"cleanup": [
"/share/man"
],
"post-install": [
"install -d /app/extensions"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ZoiteChat/zoitechat.git",
"tag": "zoitechat-2.18.1",
"commit": "479f1649efa0e5b166a7c7c9d86214b42ec9f794"
},
{
"type": "file",
"url": "https://publicsuffix.org/list/public_suffix_list.dat",
"sha256": "6f7f7d9e8c68447f1c74095a12574b7fee46b0cd759c518a659aee0615d8e118",
"dest": "src/common",
"dest-filename": "public_suffix_list.dat"
},
{
"type": "patch",
"path": "Load-plugins-from-Flatpak-extensions.patch"
}
]
}
]
}

View File

@@ -1,20 +0,0 @@
{
"name": "perl",
"buildsystem": "simple",
"build-commands": [
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
"make -j${FLATPAK_BUILDER_N_JOBS}",
"make install"
],
"cleanup": [
"/share/man",
"/lib/perl5/*/*/CORE/*.a"
],
"sources": [
{
"type": "archive",
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
}
]
}

View File

@@ -1,19 +0,0 @@
{
"name": "python3-cffi",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
}
]
}

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',

View File

@@ -104,12 +104,14 @@ thread_sha256_file (GTask *task, GFile *file, gpointer task_data, GCancellable *
g_checksum_update (checksum, buffer, ret); g_checksum_update (checksum, buffer, ret);
if (error) { if (error) {
g_checksum_free (checksum);
g_task_return_error (task, error); g_task_return_error (task, error);
return; goto cleanup;
} }
g_task_return_pointer (task, g_strdup (g_checksum_get_string (checksum)), g_free); g_task_return_pointer (task, g_strdup (g_checksum_get_string (checksum)), g_free);
cleanup:
g_input_stream_close(G_INPUT_STREAM(istream), NULL, NULL);
g_object_unref(istream);
g_checksum_free (checksum); g_checksum_free (checksum);
} }

View File

@@ -1,7 +1,19 @@
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
lua_dep = cc.find_library('lua51') lua_dep = cc.find_library('lua51')
else else
lua_dep = dependency(get_option('with-lua')) lua_opt = get_option('with-lua')
lua_dep = dependency(lua_opt, required: false)
if not lua_dep.found() and lua_opt == 'lua-5.4'
foreach lua_name : ['lua5.4', 'lua-5.3', 'lua5.3', 'lua']
lua_dep = dependency(lua_name, required: false)
if lua_dep.found()
break
endif
endforeach
endif
if not lua_dep.found()
error('Dependency "' + lua_opt + '" not found')
endif
endif endif
shared_module('lua', 'lua.c', shared_module('lua', 'lua.c',

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

View File

@@ -782,6 +782,7 @@ load_default_config(void)
prefs.hex_gui_tab_middleclose = 1; prefs.hex_gui_tab_middleclose = 1;
prefs.hex_gui_tab_server = 1; prefs.hex_gui_tab_server = 1;
prefs.hex_gui_tab_sort = 1; prefs.hex_gui_tab_sort = 1;
prefs.hex_gui_tab_scrollchans = 1;
prefs.hex_gui_topicbar = 1; prefs.hex_gui_topicbar = 1;
prefs.hex_gui_transparency = 255; prefs.hex_gui_transparency = 255;
prefs.hex_gui_tray = 1; prefs.hex_gui_tray = 1;
@@ -1167,7 +1168,10 @@ 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); {
const char *value = (char *) &prefs + var->offset;
sprintf (tbuf + len, "\0033:\017 %s\n", value ? value : "");
}
break; 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));

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;

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], '!');

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;

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)
{ {

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;

View File

@@ -2,10 +2,10 @@
* Copyright (C) 1998-2010 Peter Zelezny. * Copyright (C) 1998-2010 Peter Zelezny.
* Copyright (C) 2009-2013 Berke Viktor. * Copyright (C) 2009-2013 Berke Viktor.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU General Public License
* the Free Software Foundation; either version 2 of the License, or * as published by the Free Software Foundation; either version 2
* (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,8 +13,8 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * <https://www.gnu.org/licenses/>.
*/ */
/* You can distribute this header with your plugins for easy compilation */ /* You can distribute this header with your plugins for easy compilation */

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);

View File

@@ -304,20 +304,28 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
static gboolean static gboolean
tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv) tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv)
{ {
int direction = cv_scroll_direction (event);
if (prefs.hex_gui_tab_scrollchans) if (prefs.hex_gui_tab_scrollchans)
{ {
if (event->direction == GDK_SCROLL_DOWN) if (direction != 0)
mg_switch_page (1, 1); {
else if (event->direction == GDK_SCROLL_UP) mg_switch_page (1, direction);
mg_switch_page (1, -1); return TRUE;
}
} }
else else
{ {
/* mouse wheel scrolling */ if (direction < 0)
if (event->direction == GDK_SCROLL_UP) {
tab_scroll_left_up_clicked (widget, cv); tab_scroll_left_up_clicked (widget, cv);
else if (event->direction == GDK_SCROLL_DOWN) return TRUE;
}
else if (direction > 0)
{
tab_scroll_right_down_clicked (widget, cv); tab_scroll_right_down_clicked (widget, cv);
return TRUE;
}
} }
return FALSE; return FALSE;
@@ -345,17 +353,17 @@ cv_tabs_init (chanview *cv)
viewport = gtk_scrolled_window_new (0, 0); viewport = gtk_scrolled_window_new (0, 0);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), GTK_SHADOW_NONE); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), GTK_SHADOW_NONE);
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (viewport), FALSE);
if (cv->vertical) if (cv->vertical)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
else else
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
GTK_POLICY_ALWAYS, GTK_POLICY_NEVER); GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (viewport), 1); gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (viewport), 1);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (viewport), 1); gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (viewport), 1);
gtk_widget_set_hexpand (viewport, TRUE); gtk_widget_set_hexpand (viewport, TRUE);
gtk_widget_set_vexpand (viewport, TRUE); gtk_widget_set_vexpand (viewport, TRUE);
cv_add_scroll_events (viewport);
g_signal_connect (G_OBJECT (viewport), "scroll-event", g_signal_connect (G_OBJECT (viewport), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv); G_CALLBACK (tab_scroll_cb), cv);
gtk_box_pack_start (GTK_BOX (outer), viewport, 1, 1, 0); gtk_box_pack_start (GTK_BOX (outer), viewport, 1, 1, 0);
@@ -677,9 +685,11 @@ cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
gtk_widget_set_name (but, "zoitechat-tab"); gtk_widget_set_name (but, "zoitechat-tab");
gtk_widget_set_size_request (but, -1, 14); gtk_widget_set_size_request (but, -1, 14);
gtk_widget_add_events (but, GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); gtk_widget_add_events (but, GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
cv_add_scroll_events (but);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
label = gtk_label_new (name); label = gtk_label_new (name);
close_button = gtk_button_new (); close_button = gtk_button_new ();
cv_add_scroll_events (close_button);
gtk_style_context_add_class (gtk_widget_get_style_context (close_button), "flat"); gtk_style_context_add_class (gtk_widget_get_style_context (close_button), "flat");
close_icon = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU); close_icon = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (GTK_IMAGE (close_icon), 8); gtk_image_set_pixel_size (GTK_IMAGE (close_icon), 8);
@@ -695,6 +705,10 @@ cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
/* used to trap right-clicks */ /* used to trap right-clicks */
g_signal_connect (G_OBJECT (but), "button-press-event", g_signal_connect (G_OBJECT (but), "button-press-event",
G_CALLBACK (tab_click_cb), ch); G_CALLBACK (tab_click_cb), ch);
g_signal_connect (G_OBJECT (but), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv);
g_signal_connect (G_OBJECT (close_button), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv);
g_signal_connect (G_OBJECT (but), "motion-notify-event", g_signal_connect (G_OBJECT (but), "motion-notify-event",
G_CALLBACK (tab_close_motion_cb), ch); G_CALLBACK (tab_close_motion_cb), ch);
g_signal_connect (G_OBJECT (but), "leave-notify-event", g_signal_connect (G_OBJECT (but), "leave-notify-event",

View File

@@ -111,12 +111,12 @@ cv_tree_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer user
{ {
if (prefs.hex_gui_tab_scrollchans) if (prefs.hex_gui_tab_scrollchans)
{ {
if (event->direction == GDK_SCROLL_DOWN) int direction = cv_scroll_direction (event);
mg_switch_page (1, 1);
else if (event->direction == GDK_SCROLL_UP)
mg_switch_page (1, -1);
return TRUE; if (direction != 0)
mg_switch_page (1, direction);
return direction != 0;
} }
return FALSE; return FALSE;
@@ -141,6 +141,7 @@ cv_tree_init (chanview *cv)
win = gtk_scrolled_window_new (0, 0); win = gtk_scrolled_window_new (0, 0);
gtk_widget_set_hexpand (win, TRUE); gtk_widget_set_hexpand (win, TRUE);
gtk_widget_set_vexpand (win, TRUE); gtk_widget_set_vexpand (win, TRUE);
cv_add_scroll_events (win);
/*gtk_container_set_border_width (GTK_CONTAINER (win), 1);*/ /*gtk_container_set_border_width (GTK_CONTAINER (win), 1);*/
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (win), gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (win),
@@ -154,6 +155,7 @@ cv_tree_init (chanview *cv)
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store)); view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store));
gtk_widget_set_hexpand (view, TRUE); gtk_widget_set_hexpand (view, TRUE);
gtk_widget_set_vexpand (view, TRUE); gtk_widget_set_vexpand (view, TRUE);
cv_add_scroll_events (view);
gtk_widget_set_name (view, "zoitechat-tree"); gtk_widget_set_name (view, "zoitechat-tree");
{ {
ThemeWidgetStyleValues style_values; ThemeWidgetStyleValues style_values;

View File

@@ -95,6 +95,37 @@ static chan *cv_find_chan_by_number (chanview *cv, int num);
static int cv_find_number_of_chan (chanview *cv, chan *find_ch); static int cv_find_number_of_chan (chanview *cv, chan *find_ch);
static void cv_find_neighbors_for_removal (chanview *cv, chan *find_ch, chan **left_ch, chan **first_ch); static void cv_find_neighbors_for_removal (chanview *cv, chan *find_ch, chan **left_ch, chan **first_ch);
static void
cv_add_scroll_events (GtkWidget *widget)
{
gtk_widget_add_events (widget, GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
}
static int
cv_scroll_direction (GdkEventScroll *event)
{
gdouble dx;
gdouble dy;
if (event->direction == GDK_SCROLL_SMOOTH && gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
{
if (dy > 0)
return 1;
if (dy < 0)
return -1;
}
switch (event->direction)
{
case GDK_SCROLL_DOWN:
return 1;
case GDK_SCROLL_UP:
return -1;
default:
return 0;
}
}
/* ======= TABS ======= */ /* ======= TABS ======= */

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)
{ {
@@ -301,7 +320,7 @@ fe_args (int argc, char *argv[])
GError *error = NULL; GError *error = NULL;
GOptionContext *context; GOptionContext *context;
char *buffer; char *buffer;
const char *desktop_id = "net.zoite.Zoitechat"; const char *desktop_id = "org.zoitechat.ZoiteChat";
#ifdef WIN32 #ifdef WIN32
char *base_path = NULL; char *base_path = NULL;
char *locale_path = NULL; char *locale_path = NULL;
@@ -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 */

View File

@@ -1973,8 +1973,37 @@ replace_handle (GtkWidget *t)
{ {
ptrdiff_t found_offset = found - text; ptrdiff_t found_offset = found - text;
ptrdiff_t found_end_offset = found_offset + (ptrdiff_t) pop_len; ptrdiff_t found_end_offset = found_offset + (ptrdiff_t) pop_len;
gboolean start_ok;
gboolean end_ok;
int rank; int rank;
ptrdiff_t distance; ptrdiff_t distance;
const char *before = found;
const char *after = found + pop_len;
if (before > text)
{
before = g_utf8_find_prev_char (text, before);
start_ok = !before || (!g_unichar_isalnum (g_utf8_get_char (before)) && g_utf8_get_char (before) != '_');
}
else
{
start_ok = TRUE;
}
if (*after != '\0')
{
end_ok = !g_unichar_isalnum (g_utf8_get_char (after)) && g_utf8_get_char (after) != '_';
}
else
{
end_ok = TRUE;
}
if (!start_ok || !end_ok)
{
found++;
continue;
}
if (cursor_byte_offset >= found_offset && cursor_byte_offset <= found_end_offset) if (cursor_byte_offset >= found_offset && cursor_byte_offset <= found_end_offset)
{ {

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)
{ {

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,6 +952,7 @@ 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);
if (current_sess && current_sess->gui)
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen); menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
@@ -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);
} }
@@ -3413,8 +3419,13 @@ mg_create_textarea (session *sess, GtkWidget *box)
inbox = mg_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2); inbox = mg_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), inbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), inbox, TRUE, TRUE, 0);
frame = gtk_frame_new (NULL); frame = gtk_scrolled_window_new (NULL, NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_widget_set_hexpand (frame, TRUE);
gtk_widget_set_vexpand (frame, TRUE);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (frame),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (frame),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (inbox), frame, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (inbox), frame, TRUE, TRUE, 0);
theme_get_xtext_colors_for_widget (frame, xtext_palette, XTEXT_COLS); theme_get_xtext_colors_for_widget (frame, xtext_palette, XTEXT_COLS);
@@ -3431,9 +3442,7 @@ mg_create_textarea (session *sess, GtkWidget *box)
g_signal_connect (G_OBJECT (xtext), "word_click", g_signal_connect (G_OBJECT (xtext), "word_click",
G_CALLBACK (mg_word_clicked), NULL); G_CALLBACK (mg_word_clicked), NULL);
gui->vscrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, gui->vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (frame));
GTK_XTEXT (xtext)->adj);
gtk_box_pack_start (GTK_BOX (inbox), gui->vscrollbar, FALSE, TRUE, 0);
gtk_drag_dest_set (gui->vscrollbar, 5, dnd_dest_targets, 2, gtk_drag_dest_set (gui->vscrollbar, 5, dnd_dest_targets, 2,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK); GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
@@ -3476,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))
{ {
@@ -3661,8 +3670,14 @@ mg_create_userlist (session_gui *gui, GtkWidget *box)
gtk_box_pack_start (GTK_BOX (box), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box), vbox, TRUE, TRUE, 0);
gui->namelistinfo = gtk_label_new (NULL); gui->namelistinfo = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.0f); gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.5f);
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_START); gtk_label_set_justify (GTK_LABEL (gui->namelistinfo), GTK_JUSTIFY_CENTER);
gtk_label_set_ellipsize (GTK_LABEL (gui->namelistinfo), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (gui->namelistinfo), 1);
gtk_widget_set_margin_start (gui->namelistinfo, 0);
gtk_widget_set_margin_end (gui->namelistinfo, 0);
gtk_widget_set_hexpand (gui->namelistinfo, TRUE);
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_FILL);
if (prefs.hex_gui_ulist_count) if (prefs.hex_gui_ulist_count)
gtk_box_pack_start (GTK_BOX (vbox), gui->namelistinfo, 0, 0, 0); gtk_box_pack_start (GTK_BOX (vbox), gui->namelistinfo, 0, 0, 0);
@@ -4718,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);
@@ -5232,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)
{ {
@@ -5312,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);
@@ -5389,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);
} }

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;

View File

@@ -56,7 +56,7 @@ notification_backend_show (const char *title, const char *text)
g_variant_builder_init (&params, G_VARIANT_TYPE ("(susssasa{sv}i)")); g_variant_builder_init (&params, G_VARIANT_TYPE ("(susssasa{sv}i)"));
g_variant_builder_add (&params, "s", "zoitechat"); /* App name */ g_variant_builder_add (&params, "s", "zoitechat"); /* App name */
g_variant_builder_add (&params, "u", 0); /* ID, 0 means don't replace */ g_variant_builder_add (&params, "u", 0); /* ID, 0 means don't replace */
g_variant_builder_add (&params, "s", "net.zoite.Zoitechat"); /* App icon */ g_variant_builder_add (&params, "s", "org.zoitechat.ZoiteChat"); /* App icon */
g_variant_builder_add (&params, "s", title); g_variant_builder_add (&params, "s", title);
g_variant_builder_add (&params, "s", text); g_variant_builder_add (&params, "s", text);
g_variant_builder_add (&params, "as", NULL); /* Actions */ g_variant_builder_add (&params, "as", NULL); /* Actions */
@@ -65,7 +65,7 @@ notification_backend_show (const char *title, const char *text)
g_variant_builder_open (&params, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_open (&params, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_open (&params, G_VARIANT_TYPE ("{sv}")); g_variant_builder_open (&params, G_VARIANT_TYPE ("{sv}"));
g_variant_builder_add (&params, "s", "desktop-entry"); g_variant_builder_add (&params, "s", "desktop-entry");
g_variant_builder_add (&params, "v", g_variant_new_string ("net.zoite.Zoitechat")); g_variant_builder_add (&params, "v", g_variant_new_string ("org.zoitechat.ZoiteChat"));
g_variant_builder_close (&params); g_variant_builder_close (&params);
g_variant_builder_close (&params); g_variant_builder_close (&params);

View File

@@ -80,7 +80,7 @@ typedef GIcon *TrayIcon;
typedef GIcon *TrayCustomIcon; typedef GIcon *TrayCustomIcon;
#define tray_icon_free(i) g_object_unref(i) #define tray_icon_free(i) g_object_unref(i)
#define ICON_NORMAL_NAME "net.zoite.Zoitechat" #define ICON_NORMAL_NAME "org.zoitechat.ZoiteChat"
#define ICON_MSG_NAME "mail-unread" #define ICON_MSG_NAME "mail-unread"
#define ICON_HILIGHT_NAME "dialog-warning" #define ICON_HILIGHT_NAME "dialog-warning"
#define ICON_FILE_NAME "folder-download" #define ICON_FILE_NAME "folder-download"
@@ -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

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

View File

@@ -93,23 +93,14 @@ userlist_apply_saved_column_width (GtkTreeViewColumn *column, int width)
static void static void
userlist_update_min_width (session *sess) userlist_update_min_width (session *sess)
{ {
GtkRequisition minimum;
GtkRequisition natural;
GtkWidget *scrolled_window; GtkWidget *scrolled_window;
int width;
if (!sess || !sess->gui || !sess->gui->user_box || !sess->gui->namelistinfo || !sess->gui->user_tree) if (!sess || !sess->gui || !sess->gui->user_tree)
return; return;
gtk_widget_get_preferred_size (sess->gui->namelistinfo, &minimum, &natural);
width = MAX (minimum.width, natural.width);
if (width < 1)
width = 1;
scrolled_window = gtk_widget_get_parent (sess->gui->user_tree); scrolled_window = gtk_widget_get_parent (sess->gui->user_tree);
if (GTK_IS_SCROLLED_WINDOW (scrolled_window)) if (GTK_IS_SCROLLED_WINDOW (scrolled_window))
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), width); gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), 1);
gtk_widget_set_size_request (sess->gui->user_box, width, -1);
} }
GdkPixbuf * GdkPixbuf *
@@ -909,17 +900,19 @@ userlist_create (GtkWidget *box)
}; };
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (sw, TRUE);
gtk_widget_set_vexpand (sw, TRUE);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_ETCHED_IN); GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
prefs.hex_gui_ulist_show_hosts ? GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
GTK_POLICY_AUTOMATIC : gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (sw), 1);
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0);
gtk_widget_show (sw); gtk_widget_show (sw);
treeview = gtk_tree_view_new (); treeview = gtk_tree_view_new ();
gtk_widget_set_hexpand (treeview, TRUE);
gtk_widget_set_vexpand (treeview, TRUE);
gtk_widget_set_name (treeview, "zoitechat-userlist"); gtk_widget_set_name (treeview, "zoitechat-userlist");
gtk_widget_set_can_focus (treeview, TRUE); gtk_widget_set_can_focus (treeview, TRUE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);

View File

@@ -110,6 +110,15 @@ enum
TARGET_COMPOUND_TEXT TARGET_COMPOUND_TEXT
}; };
enum
{
PROP_0,
PROP_HADJUSTMENT,
PROP_VADJUSTMENT,
PROP_HSCROLL_POLICY,
PROP_VSCROLL_POLICY
};
/* Selection targets for PRIMARY selection / copy-paste. /* Selection targets for PRIMARY selection / copy-paste.
* *
@@ -158,7 +167,8 @@ gtk_xtext_install_selection_targets (GtkWidget *widget)
static guint xtext_signals[LAST_SIGNAL]; static guint xtext_signals[LAST_SIGNAL];
G_DEFINE_TYPE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET) G_DEFINE_TYPE_WITH_CODE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
char *nocasestrstr (const char *text, const char *tofind); /* util.c */ char *nocasestrstr (const char *text, const char *tofind); /* util.c */
int xtext_get_stamp_str (time_t, char **); int xtext_get_stamp_str (time_t, char **);
@@ -171,6 +181,10 @@ static void gtk_xtext_adjustment_changed (GtkAdjustment * adj,
GtkXText * xtext); GtkXText * xtext);
static void gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj, static void gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj,
GtkAdjustment *vadj); GtkAdjustment *vadj);
static void gtk_xtext_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gtk_xtext_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static int gtk_xtext_render_ents (GtkXText * xtext, textentry *, textentry *); static int gtk_xtext_render_ents (GtkXText * xtext, textentry *, textentry *);
static void gtk_xtext_recalc_widths (xtext_buffer *buf, int); static void gtk_xtext_recalc_widths (xtext_buffer *buf, int);
static void gtk_xtext_fix_indent (xtext_buffer *buf); static void gtk_xtext_fix_indent (xtext_buffer *buf);
@@ -794,6 +808,9 @@ gtk_xtext_init (GtkXText * xtext)
xtext->recycle = FALSE; xtext->recycle = FALSE;
xtext->dont_render = FALSE; xtext->dont_render = FALSE;
xtext->dont_render2 = FALSE; xtext->dont_render2 = FALSE;
xtext->hadj = NULL;
xtext->hscroll_policy = GTK_SCROLL_MINIMUM;
xtext->vscroll_policy = GTK_SCROLL_MINIMUM;
gtk_xtext_scroll_adjustments (xtext, NULL, NULL); gtk_xtext_scroll_adjustments (xtext, NULL, NULL);
gtk_xtext_install_selection_targets (GTK_WIDGET (xtext)); gtk_xtext_install_selection_targets (GTK_WIDGET (xtext));
@@ -886,6 +903,66 @@ gtk_xtext_adjustment_changed (GtkAdjustment * adj, GtkXText * xtext)
xtext->buffer->old_value = xtext_adj_get_value (adj); xtext->buffer->old_value = xtext_adj_get_value (adj);
} }
static void
gtk_xtext_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GtkXText *xtext = GTK_XTEXT (object);
GtkAdjustment *adj;
switch (prop_id)
{
case PROP_HADJUSTMENT:
adj = g_value_get_object (value);
if (xtext->hadj == adj)
break;
if (xtext->hadj)
g_object_unref (xtext->hadj);
xtext->hadj = adj ? g_object_ref (adj) : NULL;
g_object_notify (object, "hadjustment");
break;
case PROP_VADJUSTMENT:
gtk_xtext_scroll_adjustments (xtext, NULL, g_value_get_object (value));
g_object_notify (object, "vadjustment");
break;
case PROP_HSCROLL_POLICY:
xtext->hscroll_policy = g_value_get_enum (value);
g_object_notify (object, "hscroll-policy");
break;
case PROP_VSCROLL_POLICY:
xtext->vscroll_policy = g_value_get_enum (value);
g_object_notify (object, "vscroll-policy");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_xtext_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GtkXText *xtext = GTK_XTEXT (object);
switch (prop_id)
{
case PROP_HADJUSTMENT:
g_value_set_object (value, xtext->hadj);
break;
case PROP_VADJUSTMENT:
g_value_set_object (value, xtext->adj);
break;
case PROP_HSCROLL_POLICY:
g_value_set_enum (value, xtext->hscroll_policy);
break;
case PROP_VSCROLL_POLICY:
g_value_set_enum (value, xtext->vscroll_policy);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
GtkWidget * GtkWidget *
gtk_xtext_new (const XTextColor *palette, int separator) gtk_xtext_new (const XTextColor *palette, int separator)
{ {
@@ -952,6 +1029,11 @@ gtk_xtext_cleanup (GtkXText *xtext)
xtext->adj = NULL; xtext->adj = NULL;
} }
if (xtext->hadj)
{
g_object_unref (G_OBJECT (xtext->hadj));
xtext->hadj = NULL;
}
if (xtext->hand_cursor) if (xtext->hand_cursor)
{ {
@@ -2924,6 +3006,13 @@ gtk_xtext_class_init (GtkXTextClass * class)
widget_class = (GtkWidgetClass *) class; widget_class = (GtkWidgetClass *) class;
xtext_class = (GtkXTextClass *) class; xtext_class = (GtkXTextClass *) class;
object_class->set_property = gtk_xtext_set_property;
object_class->get_property = gtk_xtext_get_property;
g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment");
g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment");
g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy");
g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy");
xtext_signals[WORD_CLICK] = xtext_signals[WORD_CLICK] =
g_signal_new ("word_click", g_signal_new ("word_click",
G_TYPE_FROM_CLASS (object_class), G_TYPE_FROM_CLASS (object_class),
@@ -4830,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)
{ {
@@ -4846,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);
@@ -4861,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);
} }

View File

@@ -134,6 +134,9 @@ struct _GtkXText
xtext_buffer *selection_buffer; xtext_buffer *selection_buffer;
GtkAdjustment *adj; GtkAdjustment *adj;
GtkAdjustment *hadj;
GtkScrollablePolicy hscroll_policy;
GtkScrollablePolicy vscroll_policy;
cairo_surface_t *background_surface; /* 0 = use palette[19] */ cairo_surface_t *background_surface; /* 0 = use palette[19] */
cairo_surface_t *background_clip_surface; cairo_surface_t *background_clip_surface;
GdkWindow *draw_window; /* points to ->window */ GdkWindow *draw_window; /* points to ->window */

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);

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;

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

View File

@@ -1 +1 @@
2.18.0 2.18.1