Commit Graph

2260 Commits

Author SHA1 Message Date
18632bc5fd Added a new tree-store column (COL_UNDERLINE) for channel rows so the UI can track underline state per channel entry in the channel list model.
Initialized each new channel row with PANGO_UNDERLINE_NONE so only the active channel gets emphasized.
Updated tree selection handling to remove underline from the previously focused row and apply PANGO_UNDERLINE_SINGLE to the newly selected row, creating a clear “currently viewed channel” indicator.
Bound the channel name renderer’s underline property to the new model column so underline changes are reflected immediately in the channel list UI.
2026-02-17 20:51:13 -07:00
643ea9c7fb Removed the Windows-specific forced Adwaita icon theme override from win32_configure_icon_theme(), so ZoiteChat will no longer switch to Adwaita at runtime and can use the app’s own icon assets from the configured icon search path.
Removed Adwaita icon bundle copy rules from the Windows packaging project (copy.vcxproj), so share/icons/Adwaita is no longer pulled into Windows build artifacts.
Removed Adwaita icon inclusion from the Windows installer manifest (zoitechat.iss.tt), so installer builds no longer ship Adwaita icon files.
2026-02-17 20:39:12 -07:00
39aa63057e Added a centralized menu_new() helper in the GTK menu code that creates menus and disables GTK3’s reserved toggle gutter (gtk_menu_set_reserve_toggle_size(..., FALSE)), which removes the awkward empty left-side spacing for normal menu items.
Updated menu construction callsites in the main menu paths (top-level, submenus, nick/url/channel context menus) to use menu_new(), so the spacing fix applies broadly across menus instead of only one location.
Committed the change on the current branch (976970f) and created a PR record via the make_pr tool.
2026-02-17 20:37:37 -07:00
5d4eec3b71 updated, fixed or replaced menu icons. 2026-02-17 20:05:13 -07:00
6bd7a309b3 Updated Windows GTK startup environment handling so ZoiteChat always prepends its bundled share directory to XDG_DATA_DIRS (without breaking existing values), which enables GTK to discover packaged runtime data used by icon/theme and emoji resources. Also changed GSETTINGS_SCHEMA_DIR logic so it no longer short-circuits this setup when GSETTINGS_SCHEMA_DIR is already set.
Added a Win32 icon-theme setup helper that appends bundled share/icons to GtkIconTheme search paths and forces Adwaita when available, so the emoji chooser’s category/menu symbolic icons resolve instead of showing placeholder squares.
Invoked the new Win32 icon-theme configuration immediately after gtk_init() so it applies before UI usage, including the emoji chooser popover created from entries.
2026-02-17 18:55:38 -07:00
ee107621c4 Removed the custom emoji picker/menu implementation from maingui.c (including its callbacks and helper declarations), so the old in-app emoji menu is no longer present. The code now transitions directly from emoji font fallback logic to the search-bar section.
updated the input entry creation to stop creating a separate emoji button, and instead enable GTK’s built-in emoji menu icon with show-emoji-icon on GTK3+ builds only (no GTK2 fallback path).
2026-02-17 15:23:03 -07:00
ae50735311 Identified and fixed an obvious UI-path delay in message rendering: when a new line is appended and the user is already at the bottom of the channel buffer (scrollbar_down), the code now renders immediately instead of always waiting for an idle callback. This removes the subtle “sent but appears a moment later” effect in large-scrollback channels.
Preserved the previous idle-batched behavior for users who are not at the bottom (scrolling history), so performance-friendly deferred redraws still apply in that case.
2026-02-17 14:49:15 -07:00
97cbe98b3d added a min_indent threshold and only grow indent when the change is meaningful (greater than one space width), then only run the expensive gtk_xtext_recalc_widths() path when indent truly increased.
I also kept the existing correctness behavior: when indent does materially change, it still fixes/recalculates and updates ent->indent/force_render as before.
2026-02-17 14:33:16 -07:00
eb112f9cd7 appended lines were scheduled with a timer (REFRESH_TIMEOUT * 2 where REFRESH_TIMEOUT is 20), which effectively adds ~40ms before draw in this path. I changed that specific path to render on the next idle cycle (g_idle_add) so locally echoed sent messages appear sooner. 2026-02-17 14:26:02 -07:00
6025195234 fixed the delayed selection paint by changing gtk_xtext_render_ents() to queue a GTK redraw when called outside ::draw on GTK3, instead of attempting direct window painting. This addresses the “double-click/drag selection only appears after some other window change” behavior.
Added an in-code comment explaining why this path is needed (GTK3/Wayland frame-driven presentation).
2026-02-17 13:24:42 -07:00
7fd8e5455d fixing zoitechat/hexchat theme usage. 2026-02-17 10:51:42 -07:00
78754ff194 Added a Windows-only fe_apply_windows_theme(gboolean dark) function under #ifdef G_OS_WIN32 that:
sets gtk-application-prefer-dark-theme when that GtkSettings property exists, and
    applies an app-level GtkCssProvider with dark/light fallback classes (zoitechat-dark / zoitechat-light) to keep non-chat widgets aligned with mode changes.
Updated the shared theme apply path so fe_apply_theme_for_mode() still applies the palette layer (palette_apply_dark_mode) and now also applies the Windows GTK layer, ensuring auto/manual modes flow through one path.
Extended toplevel theme application to add/remove the new dark/light CSS classes on Windows GTK3 windows, while preserving native titlebar dark-mode handling.
Made AUTO mode resolve from the cached auto_dark_mode_enabled state, and initialized that state in fe_init() before the first fe_apply_theme_for_mode() call so initial and subsequent behavior are consistent.
2026-02-16 20:41:27 -07:00
deepend-tildeclub
242f4a6dec Update fe-gtk.vcxproj with new configurations 2026-02-16 20:29:25 -07:00
5460855ea4 Implemented a Windows-specific theme detection path with High Contrast safeguards, including helpers to detect HC mode, read Windows system theme preference from the registry, and gate native titlebar dark mode updates when HC is active. Also added DWM header usage for native titlebar APIs.
Added a unified theme application pipeline via fe_apply_theme_for_mode() and fe_apply_theme_to_toplevel(), and routed auto-mode refresh logic through it so palette + GTK input styling are applied consistently from one place.
Switched startup and settings-apply flows to use the unified theming function, replacing direct palette-only calls so system-mode detection → theme apply is consistent across initialization and preferences changes.
Applied native titlebar updates when top-level windows are shown and during setup reapply across open sessions, and wired Windows builds to link dwmapi in both Meson and MSVC project files.
2026-02-16 20:26:45 -07:00
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
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
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
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
cbb233ad06 Fix packing order for GUI panes based on preferences 2026-02-16 02:01:21 -07:00
deepend-tildeclub
e32574ed9b Enable column expansion in chanview tree 2026-02-16 01:50:23 -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
bf4782d3e1 Set wide handle for GTK3 horizontal paned widget 2026-02-15 22:31:45 -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
173d10f336 revert: back to 874ea99 2026-02-14 17:40:42 -07:00
3e2268b391 chore: normalize line endings 2026-02-14 17:02:11 -07:00
9aceea0134 Fixed the preferences layout packing so the main content region can expand vertically and use the full window height in GTK3 builds by packing the notebook with expand/fill enabled (TRUE, TRUE).
Fixed the top-level preferences window layout so the central horizontal content area expands within the main vertical container, instead of staying at natural height.
2026-02-13 18:45:13 -07:00
e855b9f160 Added Ctrl+Alt+S (<Primary><Alt>s) to the default keyboard shortcut list in fkeys.c and mapped it to Insert in Buffer with D1:\036 (strikethrough control code), so strikethrough is available by default via that shortcut. 2026-02-12 15:19:22 -07:00
54428e9e40 Added a shared escape decoder for keybinding Data fields so key actions can interpret \n, \r, \t, \\, and hex-byte escapes like \x1e (raw byte insertion), with graceful fallback for invalid/unknown escapes. This is what enables entering strikethrough control byte 0x1E via keybindings (e.g., Data 1: \x1e).
Updated Run Command to use the shared decoder instead of its previous newline-only parser, so it now supports the same escape set consistently.
Updated Insert in Buffer to decode escapes before insertion, so \xNN inserts raw bytes rather than literal text.
Updated key action help text to document the supported escape syntax for both Run Command and Insert in Buffer.
2026-02-12 14:34:38 -07:00
45ef2da0ac Added Windows dependency detection to enable/disable the Lua plugin build based on available headers and skip builds when missing.
Updated the Windows build to prefer glib-genmarshal executables with a Python fallback for marshal generation.
Made GTK link dependencies more robust by selecting available ATK library names before assembling GTK libs.
2026-02-06 00:24:24 -07:00