Commit Graph

4279 Commits

Author SHA1 Message Date
ebb9aa48ae Added GTK2 compatibility macros in fe-gtk.h so calls to gtk_widget_set_hexpand() / gtk_widget_set_vexpand() become no-ops when !HAVE_GTK3, fixing the GTK2 implicit-declaration build failures introduced by GTK3-oriented layout code.
Kept the macros warning-safe using (void) casts and G_STMT_START/G_STMT_END, so they compile cleanly in strict warning configurations.
2026-02-16 19:33:50 -07:00
deepend-tildeclub
99b93d1b71 Merge pull request #60 from ZoiteChat/raw_bytes_keyboard_shortcut
Raw bytes keyboard shortcut
2026-02-16 19:16:11 -07:00
ef87b569d7 Updated the Windows copy project to explicitly include GLib GSettings schema files from $(DepsRoot)\share\glib-2.0\schemas\* and copy them into the release tree at share\glib-2.0\schemas\..., ensuring gschemas.compiled is bundled with portable/release artifacts.
Updated the Inno Setup installer file list to install share\glib-2.0\schemas\* into {app}\share\glib-2.0\schemas under the libs component, so installed builds also ship required schema data.
Updated gtkutil_file_req_response() so only GTK_RESPONSE_ACCEPT runs the file-selection path; all non-accept responses now immediately destroy the dialog via the callback’s dialog pointer, avoiding chooser access on cancel paths.
Kept native chooser handling aligned with that behavior: chooser reads are still gated behind GTK_RESPONSE_ACCEPT, while cleanup remains a single unref path deferred to idle to avoid teardown-in-signal-stack issues on Windows.
2026-02-16 18:57:48 -07:00
3872c4fcdf Updated the GTK3 Help menu icon constant so _Contents now uses help-contents instead of help-browser, which fixes the oversized icon appearance on Linux and keeps it consistent with other menu icons.
Updated menu_setting_foreach() to safely handle sessions where menu_item[id] is still NULL by storing it in a local pointer and only toggling check state when it exists. This avoids GTK/GLib criticals during layout/menu synchronization paths while preserving normal behavior for initialized menu items.
Fixed the a few dialog box layout so the scrolled keybindings list expands to fill available vertical space in the window. It now packs the scroller into the parent GtkBox with expand/fill enabled (gtk_box_pack_start(..., TRUE, TRUE, 0)) instead of adding it as a generic container child. This allows the window height to be fully utilized.
2026-02-16 18:40:15 -07:00
09a4d3923a Fixed the GTK3 unrealize lifecycle in gtk_xtext_unrealize() by removing the early gdk_window_set_user_data(window, NULL) path, so the widget/window ownership remains valid until parent unrealize runs. This matches GTK’s expected unregister flow and addresses the user_data == NULL abort pattern you described.
Kept GTK2 behavior unchanged (#if !HAVE_GTK3 still clears widget->window user data in the legacy path).
Added an in-code comment documenting why GTK3 must preserve user-data until chaining to parent unrealize.
2026-02-16 18:11:37 -07:00
6df8a98fa0 Updated the Windows GTK3 native file-dialog flow to use asynchronous handling (gtk_native_dialog_show + "response" signal) instead of synchronous gtk_native_dialog_run, reducing risky dispose/unrealize timing during dialog close.
Added gtkutil_native_file_req_response() to keep completion semantics consistent: process selected files on accept, send the trailing callback(..., NULL) completion notification, free request state, and defer dialog unref to idle.
2026-02-16 17:29:25 -07:00
a6af143ba7 Fixed the Windows GTK3 native file chooser lifetime handling by adding an idle callback (gtkutil_native_dialog_unref_idle) that performs g_object_unref(native) outside the button-release signal stack. This avoids the crash path when cancelling the Load file dialog.
Updated the native chooser code path to replace immediate unref with deferred unref via g_idle_add(...) after gtk_native_dialog_run, while preserving the existing accept-only file handling behavior.
2026-02-16 15:37:59 -07:00
287afb4b1d Refactored file-selection completion logic so it can operate on any GtkFileChooser object, not only GtkFileChooserDialog, by introducing gtkutil_file_req_done_chooser() and reusing it from the existing dialog path. This keeps validation/callback behavior identical between chooser implementations.
Updated gtkutil_file_req() to resolve an effective_parent (fallback to global parent_window when no parent is passed), which ensures consistent transient parenting and modal assertions in this code path.
Added a Windows GTK3-specific path that uses GtkFileChooserNative (instead of the GTK file chooser dialog widget path implicated by your stack trace), while preserving existing behavior for initial folder/name, filters, multi-select, and overwrite confirmation before invoking the same file-check callback flow.
Left the existing non-Windows / non-GTK3 dialog flow in place unchanged in behavior, so platforms outside the crash scenario continue using the prior implementation.
2026-02-16 15:06:59 -07:00
eb677e412c Fixed Windows RC version generation for prerelease tags by sanitizing each version segment to numeric-only before emitting COMMA_VERSION in zoitechat.rc.tt. This prevents RC2237: numeric value expected for versions like 2.18.0-pre1. 2026-02-16 14:48:05 -07:00
3853343918 Added a new 2.18.0-pre1 top entry in changelog.rst (dated 2026-02-16) for the GTK3/packaging work on this branch, and preserved the existing 2.17.4 entry instead of rewriting it.
Added a new AppStream release block for 2.18.0-pre1 and restored the prior 2.17.4 release record, so release history remains additive.
Fixed Debian changelog handling by prepending a new pre-release entry 2.18.0~pre1-1 and restoring the historical 2.17.0-1 / 2.17.0-0 entries unchanged.
2026-02-16 14:34:23 -07:00
fe55334f5c Updated the Debian CI workflow to collect generated package files into a workspace-local artifacts/ directory before upload, avoiding disallowed ../ path traversal patterns in actions/upload-artifact@v4.
Updated the upload step to use path: artifacts/*, which is compatible with v4 artifact path validation rules.
2026-02-16 14:03:59 -07:00
7ff4cb9b8a Added package install manifests for split binary packages so files previously left in debian/tmp are assigned to the correct outputs:
zoitechat-common (desktop integration, dbus service, icons, locales, appdata, mime).
    zoitechat-dev (plugin development header + pkg-config file).
    zoitechat-lua, zoitechat-perl, zoitechat-plugins, and zoitechat-python3 (plugin/shared module payloads).
Simplified zoitechat.install to only the core executable + man page, with shared data moved to zoitechat-common to match package split intent.
2026-02-16 13:59:59 -07:00
7143aec20d Updated channel tree theming to always apply the current input font (input_style->font_desc) when re-theming, so channel list font type/size stays in sync with font preference changes.
Updated user list creation to apply the current input font in GTK3 when palette styling is applied, so the user list reflects font changes consistently.
Updated channel view creation in GTK3 to always pass the current input font to chanview_new, ensuring channel list typography starts with the configured font.
Updated settings re-apply logic to always include the current input font for the user list in GTK3, so runtime font updates take effect there as well.
2026-02-16 13:58:10 -07:00
65d399fa5b Updated Debian packaging manifest to install the missing manpage (usr/share/man/man1/zoitechat.1) and MIME package XML (usr/share/mime/packages/net.zoite.Zoitechat.mime.xml) so they are no longer left unassigned in debian/tmp and triggering dh_missing errors. 2026-02-16 13:53:54 -07:00
deepend-tildeclub
8ce3787429 Change changelog installation from changelog.txt to changelog.rst 2026-02-16 03:40:14 -07:00
deepend-tildeclub
c4c5964588 Create documentation directories for zoitechat packages
Add directories for documentation of various zoitechat packages.
2026-02-16 03:31:06 -07:00
2d61db57ef Updated the Debian GitHub Actions workflow to use Debian packaging tooling/dependencies (including dpkg-dev, debhelper, fakeroot, iso-codes, and liblua5.3-dev) so the job is set up for Debian package builds from debian/.
Replaced the previous direct Meson configure/build/test/install steps with a Debian package build step using dpkg-buildpackage -us -uc -b.
Added artifact upload for generated Debian package outputs (*.deb, *.changes, *.buildinfo).
2026-02-16 03:26:00 -07:00
a9d8ffe3fe Updated Debian build dependencies to target GTK 3 by replacing libgtk2.0-dev with libgtk-3-dev, and updated the package description text to explicitly say “GTK 3 GUI.”
Updated Debian build rules to pass -Dgtk3=true to Meson during dh_auto_configure, ensuring the GTK3 frontend is selected in package builds.
2026-02-16 03:22:44 -07:00
deepend-tildeclub
ab21af908c Add GDK_SCROLL_MASK to event mask for widget 2026-02-16 03:12:57 -07:00
deepend-tildeclub
fffbe5228c Forward mouse wheel messages to hovered window
Handle mouse wheel messages by forwarding them to the hovered window.
2026-02-16 03:05:43 -07:00
deepend-tildeclub
87ec58f9d3 Fix component selection for Python in installer script 2026-02-16 02:52:46 -07:00
deepend-tildeclub
805baea90b Fix packing order in hex GUI window 2026-02-16 02:47:34 -07:00
deepend-tildeclub
91238d99ae Refactor plugingui_load to improve directory handling 2026-02-16 02:42:00 -07:00
deepend-tildeclub
d5561a21e3 Set hexpand and vexpand for scrolled window and tree view
Enable horizontal and vertical expansion for the scrolled window and tree view.
2026-02-16 02:20:25 -07:00
deepend-tildeclub
f78ae92419 Merge pull request #59 from ZoiteChat/master
sync with master
2026-02-16 02:17:16 -07:00
deepend-tildeclub
cbb233ad06 Fix packing order for GUI panes based on preferences 2026-02-16 02:01:21 -07:00
deepend-tildeclub
07571330ba Remove redundant gtk_paned_pack calls in maingui.c 2026-02-16 02:00:45 -07:00
deepend-tildeclub
0e48187238 Fix packing order for GUI panes based on preferences 2026-02-16 01:59:53 -07:00
deepend-tildeclub
e32574ed9b Enable column expansion in chanview tree 2026-02-16 01:50:23 -07:00
deepend-tildeclub
a41e8a0f5d Disable debug libraries in project properties 2026-02-16 01:27:53 -07:00
c20a6424e5 Added explicit MSVC runtime-check settings in the shared Windows build props so optimized builds don’t inherit /RTC1 and conflict with /Ox: BasicRuntimeChecks=Default and SmallerTypeCheck=false in the ClCompile block of win32/zoitechat.props. 2026-02-16 01:22:47 -07:00
deepend-tildeclub
f5a4d8f84b Enable Whole Program Optimization in project properties 2026-02-16 01:18:40 -07:00
6f97c060b3 Added defensive input validation in waitline() to return -1 when bufsize <= 0, preventing invalid buffer handling paths.
Added a Windows-specific guard in waitline() that checks _get_osfhandle(sok) before calling read() in non-socket mode; if the CRT file descriptor is invalid, it now fails gracefully with -1 instead of hitting the debug CRT assertion you reported.
2026-02-16 01:09:16 -07:00
deepend-tildeclub
2bfd96c9e0 Fix vsnprintf handling for MSVC compiler
Add handling for MSVC's vsnprintf behavior
2026-02-16 00:45:59 -07:00
deepend-tildeclub
c815a4629c Update python3.vcxproj with new configurations 2026-02-15 23:05:59 -07:00
deepend-tildeclub
41f140c971 Fix XML encoding issues in python3.vcxproj
Updated the Python plugin Visual Studio project to also undefine _DEBUG and Py_DEBUG (in both Release|Win32 and Release|x64), alongside the existing Py_REF_DEBUG and Py_TRACE_REFS, to avoid pulling in debug-only Python refcount symbols during linking.
2026-02-15 22:58:35 -07:00
deepend-tildeclub
89b0bc667b Update python3.vcxproj with UndefinePreprocessorDefinitions
Updated the Windows Python plugin project file to explicitly undefine Py_REF_DEBUG and Py_TRACE_REFS in both Release|Win32 and Release|x64 compile settings, preventing the build from pulling in CPython debug-refcount import symbols that are missing from normal Python import libraries.
2026-02-15 22:50:37 -07:00
deepend-tildeclub
d8cbab3bfc Modify python3.vcxproj with new preprocessor definitions
Updated the Python plugin Visual Studio project to define Py_NO_LINK_LIB in both Release|Win32 and Release|x64 configurations, so CPython headers won’t auto-link a debug import library like python314_d.lib.

Kept explicit linker input ("$(Python3Lib).lib") unchanged, so linking continues to use the configured Python library from project properties.
2026-02-15 22:40:12 -07:00
deepend-tildeclub
5a5daf153e Fix optimization settings in zoitechat.props 2026-02-15 22:33:01 -07:00
deepend-tildeclub
bf4782d3e1 Set wide handle for GTK3 horizontal paned widget 2026-02-15 22:31:45 -07:00
deepend-tildeclub
4ba03065bc Enable debug libraries and disable optimizations 2026-02-15 22:24:35 -07:00
747a1dca97 I made a targeted fix for the Plugins/Scripts Load button on Windows: before issuing LOAD ..., the selected file path is now copied and normalized to forward slashes (\ → /) under #ifdef WIN32, then quoted if needed. This keeps Linux behavior unchanged and avoids Windows path parsing issues in the command path.
The load dialog wiring remains the same (same callback and filters), only the command path construction was hardened.
2026-02-15 22:13:13 -07:00
16f2c6cc0d Updated Windows sysinfo HDD querying to use Win32_LogicalDisk filtered to local fixed drives (DriveType = 3) instead of Win32_Volume, with an inline comment explaining this avoids provider/RPC probe failures (such as Plan9/WSL-backed providers) seen in debugger sessions.
Updated the HDD size property read from WMI from Capacity to Size so it matches the new Win32_LogicalDisk query schema.
2026-02-15 16:51:11 -07:00
b569d24cd1 Added a new Windows-only startup helper, win32_set_gsettings_schema_dir(), that sets GSETTINGS_SCHEMA_DIR to <install-dir>/share/glib-2.0/schemas when the environment variable is not already set and the directory exists. This is intended to prevent GTK/GSettings initialization failures (like the file chooser crash path you shared).
Called that helper in fe_args() before gtk_init() on Windows so schema resolution is configured early in process startup.
2026-02-15 16:37:51 -07:00
7f4ffdb1e5 Added defensive path validation in gtkutil_file_req() so the file chooser only receives existing directories for initial/current folder setup, with fallback to get_xdir() when the requested folder is invalid. This is aimed at preventing the Windows crash that occurs immediately on pressing the Plugin GUI Load button (before file selection).
Wrapped shortcut-folder setup with existence checks and explicit GError handling so invalid config paths don’t propagate into GTK chooser failures/crashes on Windows.
Removed an unused get_xdir_fs extern declaration from this function while introducing a single xdir value reused across chooser setup logic.
2026-02-15 16:15:25 -07:00
60c05710b1 Reviewed src/fe-gtk/plugingui.c and fixed several crash-prone assumptions in the plugin GUI code path that can surface on Windows during plugin load/unload lifecycle edges:
Added type guards before using the stored plugin view/model (GTK_IS_TREE_VIEW, GTK_IS_LIST_STORE) so stale or unexpected object data doesn’t get dereferenced.
    Switched plugin list population to always pass non-null strings for name/version/description via plugingui_safe_string, preventing null string propagation into GTK model setters.
    Added an unload guard for empty/null modname before calling unload logic, preventing unsafe calls into plugin teardown paths with invalid identifiers.
2026-02-15 15:57:19 -07:00
3e59822753 Reviewed the plugin GUI code path and fixed two crash-prone null-handling cases that are especially risky on Windows plugin metadata paths:
fe_pluginlist_update() now guards against pl == NULL, pl->version == NULL, and pl->filename == NULL before dereferencing, and uses safe empty-string fallbacks for filename-backed columns. This prevents null dereferences from malformed or partially-populated plugin entries.
plugingui_unload() now early-returns when the selected plugin filepath is NULL/empty before suffix checks and command formatting, preventing invalid string operations in unload flow.
2026-02-15 15:41:28 -07:00
47a9729737 Added a new session guard helper for the plugin GUI so addon commands only run when there is a valid active session, and emit a user-facing error otherwise. This prevents handle_command() calls with an invalid/null session context (a likely crash path on Windows in edge UI states).
Updated plugin Unload and Reload callbacks to use the guarded session helper before issuing command-based unload/reload for script plugins, and to exit cleanly when no session is available.
Fixed plugin list layout sizing by forcing the tree view’s scrolled container to expand/fill inside the plugin window’s vbox, so the loaded-plugins list now uses full available height above the button row.
2026-02-15 15:23:39 -07:00
3f31d9bd5a Fixed the plugin/script load callback to avoid using a potentially stale session pointer from the file dialog callback userdata; it now resolves a safe target session at callback time. This prevents crashes when the original session is no longer valid.
Added a defensive check that reports a user-facing error ("No active session available for loading addons.") and exits early when no valid session exists, instead of calling handle_command() with invalid state.
Updated the file request call to pass NULL userdata for load operations, so the callback no longer retains a stale session pointer while the chooser is open.
2026-02-15 15:12:00 -07:00
95538794e3 Fixed the GTK file chooser handling to avoid dereferencing/processing invalid filenames by adding an early guard in gtkutil_check_file() for NULL/empty selections, which prevents the load flow from continuing with bad input.
Fixed the single-file open path in gtkutil_file_req_done() to fetch the filename once and only call gtkutil_check_file() when a non-NULL filename is returned, preventing the crash path when GTK returns no file on accept/load.
2026-02-15 15:02:26 -07:00