Commit Graph

147 Commits

Author SHA1 Message Date
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
deepend-tildeclub
ab21af908c Add GDK_SCROLL_MASK to event mask for widget 2026-02-16 03:12:57 -07:00
0349e44856 Guarded the GTK3/Wayland redraw path in gtk_xtext_render_page with #if HAVE_GTK3 so GTK2 builds render immediately instead of waiting for expose events. 2026-02-05 00:03:35 -07:00
e5673e9a7b fix compile errors with GTK3 and Wayland. Now compiles/Runs using GTK3+Wayland. 2026-02-01 14:04:56 -07:00
8abc95205a Replaced GTK3 palette font styling with CSS-compliant properties derived from PangoFontDescription, avoiding the deprecated Pango font: syntax in generated CSS.
Added a GTK3-only helper to translate Pango font fields into font-family, font-size, font-style, font-weight, font-variant, and font-stretch CSS declarations while preserving GTK2 behavior under #if !HAVE_GTK3.
Reused the GTK3 font CSS helper in the main UI font styling path to eliminate remaining Pango font: shorthand usage that triggers GTK3 theme parsing warnings.
Exposed the GTK3 font CSS helper in gtkutil so callers can emit CSS-compliant font properties consistently.
2026-01-31 16:37:15 -07:00
d8a8e6ce73 dded GTK3 draw handling while keeping GTK2 expose handling wrapped under #if !HAVE_GTK3 for the spell entry widget.
Updated gtk_entry_find_position to use GTK3-safe layout offsets and cursor position APIs while preserving GTK2-only field access behind #if !HAVE_GTK3.
2026-01-31 16:22:35 -07:00
5170e037b5 Guarded the GTK2-only set_scroll_adjustments_signal assignment in GtkXText class initialization to avoid GTK3 build errors while preserving GTK2 behavior. 2026-01-31 15:47:49 -07:00
9af54f5ed7 Added a shared size-request helper plus GTK3 preferred-size vfuncs to reuse the existing sizing logic while keeping GTK2’s size_request path intact.
Guarded the GTK2 size_request assignment and wired the new GTK3 preferred-size handlers in class init.
2026-01-31 12:59:58 -07:00
56845a64d9 Added a shared render helper and GTK3 draw handler with clip handling while keeping GTK2 expose wiring behind build guards in xtext.c.
Added a stored GTK3 draw cairo context to the widget struct and initialized it during setup.
2026-01-31 12:09:02 -07:00
9e46407e89 Replaced manual type macros with G_DECLARE_DERIVABLE_TYPE in GtkXText, CustomList, SexySpellEntry, and RemoteObject declarations while aligning parent instance naming.
Switched GtkXText and CustomList implementations to G_DEFINE_TYPE/G_DEFINE_TYPE_WITH_CODE and preserved parent chaining behavior
Added GTK3/GTK2 conditional type declarations for GtkXText while restoring the legacy macro block for GTK2 builds.
Restored GTK2-friendly typedefs/macros and parent field naming for CustomList alongside GTK3 G_DECLARE_DERIVABLE_TYPE usage.
Restored GTK2-friendly typedefs/macros and parent field naming for SexySpellEntry while keeping GTK3 declarations intact.
Restored legacy RemoteObject typedefs and GType macros in the D-Bus plugin to keep GTK2 builds from seeing incomplete types or missing fields/macros.
2026-01-31 10:45:22 -07:00
004786655c Updated GTK3 adjustment assignment to use floating-safe GObject ref handling while preserving GTK2 behavior in the existing path. 2026-01-30 07:43:34 -07:00
1ee2433b28 Cached adjustment value and page size in gtk_xtext_render_page and reused them for start line, pixel offset, page size check, and scroll position calculations to ensure accessor usage for GTK3. 2026-01-30 07:39:09 -07:00
eb7a15dc9d Centralized buffer adjustment updates to use xtext_adjustment_apply when switching buffers, reducing repeated adjustment mutations while preserving existing behavior. 2026-01-30 07:35:18 -07:00
5f8dcd286e Added the xtext_adjustment_apply helper to consolidate GTK2/GTK3 adjustment updates and direct field assignments.
Updated adjustment setup and GTK3 buffer refresh logic to use the new helper and keep page increment/signaling handling consistent.
2026-01-30 07:26:54 -07:00
4cfe5274b5 Updated GtkAdjustment helper guards to use explicit !HAVE_GTK3 branches for direct field access while keeping GTK3 accessors in the HAVE_GTK3 path. 2026-01-30 07:20:43 -07:00
f6613cbad1 Added GtkAdjustment helper accessors for value/upper/lower/page size/page increment to encapsulate GTK3 accessors and GTK2 struct fields.
Updated xtext adjustment logic to use the helpers in adjustment updates and rendering paths, eliminating direct field access in scroll/render flows.
2026-01-30 07:15:06 -07:00
3806b33aab Split GTK3 vs GTK2 setup in gtk_xtext_realize so GTK2-only parent window/colormap access is guarded under #if !HAVE_GTK3. 2026-01-30 06:57:14 -07:00
fa3c7c9059 Consolidated GTK3 realization setup to use parent window/visual and keep GTK2-only colormap/parent window under the GTK2 branch in gtk_xtext_realize. 2026-01-30 06:20:21 -07:00
c0c0b2ec4c Moved GTK2-only parent window and colormap handling into the GTK2 code path while keeping GTK3 setup relying on gtk_widget_get_parent_window and visual-only attributes in gtk_xtext_realize. 2026-01-29 23:06:21 -07:00
d553862e52 Guarded the GtkXText double-buffering toggle behind a GTK3 compile check and added a GTK3 render pipeline note in gtk_xtext_new 2026-01-29 23:01:02 -07:00
7cbd905fae Guarded GTK2-only GtkObjectClass declaration/assignment with explicit #if !HAVE_GTK3 checks in gtk_xtext_class_init. 2026-01-29 22:57:13 -07:00
49e23b7df5 Added a GTK3 finalize handler for GtkXText that chains to the parent class alongside the existing dispose cleanup path.
Registered the GTK3 finalize handler in gtk_xtext_class_init while keeping GTK2 destroy registration intact.
2026-01-29 22:49:13 -07:00
bf529ba1ff Guarded GTK2-only GtkObject includes in the xtext header for GTK2 builds only.
Added a shared cleanup helper plus GTK2 destroy/GTK3 dispose handlers with correct parent chaining for cleanup parity across GTK versions.
Updated class initialization to register GTK3 dispose or GTK2 destroy handlers with appropriate object class setup.
2026-01-29 22:44:54 -07:00
aa0b271aa9 Made GTK2 window access explicitly guarded in scroll/selection update code paths to keep GTK3 using gtk_widget_get_window.
Applied the same explicit GTK3/GTK2 window guards in render paths to keep direct GTK2 field access isolated.
2026-01-29 22:07:58 -07:00
1584764809 Consolidated gtk_xtext_size_allocate to use a guarded window pointer before resizing, preserving GTK3 gtk_widget_get_window and GTK2 direct access paths.
Aligned GTK3/GTK2 window selection blocks in scrolling/selection and render routines (including gtk_xtext_render_page) to use #else guards for GTK2 direct access.
2026-01-29 21:57:50 -07:00
31130197eb Routed window access in scroll/selection helpers through guarded GTK3 window lookups while retaining GTK2 field access under #if !HAVE_GTK3.
Consolidated window handling in layout, render, visibility, and buffer display paths to avoid direct GTK2 window fields in GTK3 builds.
2026-01-29 21:45:57 -07:00
723d8759ff Wrapped size allocation and window resize handling with explicit GTK3/GTK2 guards for allocation/window access while preserving GTK2 field usage under !HAVE_GTK3.
Applied explicit GTK3/GTK2 window access guards across render/scroll/buffer sizing paths, including gtk_xtext_render_page and gdk_window_get_width/height callsites.
2026-01-29 21:35:06 -07:00
667a56ca6c Added GTK3 window guard handling for scrolling/selection height calculations while keeping GTK2 direct window access for those paths.
Switched sizing/visibility calculations and buffer show sizing to use GTK3 window retrieval with GTK2 fallbacks in layout/rendering paths.
2026-01-29 21:21:40 -07:00
c009c30211 Updated size allocation and draw/paint paths to use GTK3 allocation accessors while preserving GTK2 direct field access under guards.
Switched render-page and input/cursor handling to use gtk_widget_get_window on GTK3 with guarded window usage, keeping GTK2 behavior intact.
2026-01-29 21:14:09 -07:00
d4d2483161 Updated the GTK3 adjustment update path in gtk_xtext_buffer_show to explicitly set adjustment bounds/page sizing and emit value-changed, while keeping GTK2 behavior unchanged. 2026-01-25 15:16:37 -07:00
361308962e Routed GTK3 render-time adjustment updates through gtk_xtext_adjustment_set to apply setter updates and emit value-changed, while keeping the GTK2 path on gtk_adjustment_changed 2026-01-25 13:58:11 -07:00
e0c8409971 Updated GTK3 adjustment updates in gtk_xtext_adjustment_set to use GtkAdjustment setters and gtk_adjustment_value_changed, preserving the GTK2 path with gtk_adjustment_changed.
Adjusted GTK3 buffer-show scroll value updates and change signaling to rely on adjustment accessors while keeping the GTK2 flow intact.
2026-01-25 13:07:55 -07:00
08d357dc98 Added explicit GTK3-only branches in gtk_xtext_unrealize() so gtk_widget_get_window() is used without GTK2 struct access leaking into the GTK3 path.
Split the GTK3 and GTK2 initialization paths in gtk_xtext_realize() so the GTK3 branch uses gtk_widget_get_allocation()/gtk_widget_get_parent_window() and the GTK2 branch keeps the direct struct access under #if !HAVE_GTK3.
2026-01-23 22:08:17 -07:00
0df299acf5 Updated gtk_xtext_unrealize() to use GTK3 accessors (gtk_widget_get_window(), gtk_widget_set_window(), and gtk_widget_set_realized()) while keeping the GTK2 struct access in the #if !HAVE_GTK3 branch.
Consolidated the GTK3 vs GTK2 branching in gtk_xtext_realize() so GTK3 uses gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window(), with the existing GTK2 direct struct access preserved under #if !HAVE_GTK3.
2026-01-23 22:00:36 -07:00
00eb2de4c8 Split the GTK3 and GTK2 branches in gtk_xtext_unrealize() so GTK3 uses gtk_widget_get_window() while the GTK2 path remains under #if !HAVE_GTK3 with direct struct access.
Split the GTK3 and GTK2 branches in gtk_xtext_realize() so GTK3 uses gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window(), while keeping the existing GTK2 struct access under #if !HAVE_GTK3.
2026-01-23 21:55:46 -07:00
f65f350965 Moved gtk_widget_set_realized() into the GTK3 branch and used GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED) for GTK2, keeping allocation/parent-window access split by #if HAVE_GTK3 2026-01-23 21:52:40 -07:00
1d32aed8dc Added a GTK3-specific branch in gtk_xtext_unrealize() that clears user data via gtk_widget_get_window() while preserving the GTK2 struct access under #if !HAVE_GTK3.
Updated gtk_xtext_realize() to use gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window() on GTK3, and routed all subsequent window usage through the local window variable instead of direct struct access; the GTK2 path remains intact under #if !HAVE_GTK3.
Adjusted gtk_xtext_clear_background() to use gtk_widget_get_window() on GTK3 rather than widget->window.
2026-01-23 21:40:22 -07:00
5715245080 Updated the GTK3 pointer position query to use gdk_device_get_position without a temporary screen variable while keeping GTK2/GTK3 code paths split by HAVE_GTK3. 2026-01-23 00:38:14 -07:00
796c991dd8 Guarded cursor unref with a null check while keeping GTK2/GTK3-specific cleanup behavior centralized.
Added a helper to clear window backgrounds using GTK2/GTK3-specific APIs and used it during widget realize.
2026-01-23 00:32:59 -07:00
7ac74220c4 Added a GTK3-safe null guard before unrefing cursors while keeping GTK2 behavior under !HAVE_GTK3.
Added a GTK3 pointer-device null fallback in gtk_xtext_get_pointer to safely handle missing devices before using gdk_device_get_position.
2026-01-23 00:27:02 -07:00
5596c8825b Added a GTK2/GTK3-compatible cursor unref helper to centralize cleanup logic.
Switched cursor destruction to use the new helper in the widget teardown path.
2026-01-22 23:32:50 -07:00
a05c064466 Wrapped GTK2-only cursor cleanup with #if !HAVE_GTK3, keeping GTK3 paths on g_object_unref.
Moved GTK2 pointer/background calls into #if !HAVE_GTK3 blocks, leaving GTK3-compatible implementations in #else.
2026-01-22 23:28:24 -07:00
ae86a8db0f Added a GTK3-aware pointer helper that uses gdk_device_get_position while retaining GTK2 behavior under #if !HAVE_GTK3.
Wrapped GTK2-only cursor unref and background pixmap calls with GTK3-compatible g_object_unref and gdk_window_set_background_pattern alternatives.
2026-01-22 23:24:43 -07:00
cf41615cb3 - Reworked GTK window snapshotting in the main GUI to capture into cairo surfaces and convert via gdk_pixbuf_get_from_surface.
- Added a Cairo surface → RGBA pixbuf conversion helper that unpremultiplies ARGB32 data for GTK2 compatibility while keeping window snapshots Cairo-based.
- Updated window snapshotting to use the new Cairo surface conversion instead of gdk_pixbuf_get_from_surface
2026-01-17 22:25:12 -07:00
c1f855c2ab - Updated main GUI color helpers and tab palette generation to use XTextColor, and simplified drag icon snapshotting to use gdk_pixbuf_get_from_window with a null guard.
- Added pixbuf-based cairo surface capture for xtext window scrolling with a fallback to full redraw when capture fails.
2026-01-17 21:56:00 -07:00
4ac836fc66 - Added a shared XTextColor definition and a palette conversion helper for Cairo-ready colors, decoupling renderer palettes from GdkColor usage in the API surface.
- Updated xtext palette APIs to accept internal color arrays directly for rendering setup.
- Wired xtext palette creation through UI entry points to use the new palette helper when constructing or refreshing text views.
2026-01-17 21:39:45 -07:00
0601be026c - Converted text background loading to build Cairo surfaces directly from pixbufs for renderer use.
- Updated the xtext renderer to accept Cairo background surfaces and dropped the GtkStyle attach during realize to keep rendering Cairo/Pango-focused.
- Switched background surface ownership and cleanup to use cairo_surface_t across the shared state and settings update path.
2026-01-17 18:19:00 -07:00
24b0a3d75f - Introduced the XTextColor struct and stored xtext palette/foreground/background colors in internal renderer state rather than GdkColor fields.
- Converted palette colors and background pixmaps into cairo-ready values/surfaces for rendering (including background tiling and separator colors).
2026-01-17 17:44:49 -07:00
2ac5234803 - Added Cairo-based window snapshot conversion (with unpremultiplication) for drag icons and updated drag rendering to use the new helper instead of drawable capture.
- Updated GtkXText to track the draw window and use a pixmap-to-surface helper for Cairo contexts, avoiding drawable references in the struct and rendering flow.
- Added a Cairo helper for capturing window-backed surfaces and used it when blitting during scrolling, fixing the build break from the removed drawable helper.
2026-01-17 17:34:38 -07:00
30e309853c Added the required gdk/gdk.h include before gdkcairo.h in maingui.c to satisfy GDK header include order requirements on Windows builds.
Added cairo surface tracking and context creation helpers for xtext rendering, including state initialization for the new draw surface field.

Replaced GdkPixmap-based offscreen text buffering with cairo surfaces and routed rendering/underline/strikethrough operations through the cairo context helper.
2026-01-17 16:56:35 -07:00