Report Date: November 16, 2025
Analysis Purpose: Identify key differences to resolve Wayland segfaults and navigation issues
The Debian spacefm-gtk3 1.0.6-10 package and the gameblabla/spacefm fork are both based on SpaceFM version 1.0.6 (released March 4, 2018). However, they have diverged significantly in their patch sets:
- Debian focuses on: Build system compatibility (GCC 10/14, C23, glibc 2.28), bug fixes, and packaging requirements
- gameblabla focuses on: Runtime functionality (Wayland support, drag-and-drop fixes, activation fixes), plus some build compatibility
The gameblabla fork includes comprehensive Wayland support that is completely absent from the Debian package. This is the most likely cause of your segfaults and navigation issues under Wayland.
Commit: 40ba5e3 (August 6, 2022) by Dima Krasner
Merged via: Pull Request #2 from dimkr/wayland
This is the most critical difference and directly addresses your Wayland segfault issues.
The patch adds comprehensive Wayland detection and avoids X11-specific calls when running under Wayland. It checks if the display is using X11 or Wayland and adjusts behavior accordingly.
-
src/desktop/desktop.c- Checks
GDK_IS_X11_DISPLAY()before proceeding with desktop icon functionality - Returns early if not running under X11
gdpy = gdk_display_get_default(); #if GTK_CHECK_VERSION (3, 0, 0) if( ! GDK_IS_X11_DISPLAY( gdpy ) ) return; #endif
- Checks
-
src/desktop/working-area.c- Checks if display is X11 before getting X display
- Prevents X11-specific workspace detection under Wayland
#if GTK_CHECK_VERSION(3, 0, 0) if(!g_display || !GDK_IS_X11_DISPLAY(g_display)) #else if(!g_display) #endif return FALSE;
-
src/main-window.c- Checks if display is X11 before calling
gdk_x11_window_lookup_for_display() - Prevents segfaults when trying to access X11 window properties under Wayland
#if GTK_CHECK_VERSION (3, 0, 0) if ( display && GDK_IS_X11_DISPLAY (display ) ) #else if ( display ) #endif window = gdk_x11_window_lookup_for_display( display, gdk_x11_get_default_root_xwindow() );
- Checks if display is X11 before calling
-
src/main.c- Uses
WAYLAND_DISPLAYenvironment variable when running under Wayland - Creates proper socket names for IPC under Wayland
#if GTK_CHECK_VERSION(3, 0, 0) const char* tmp = g_getenv( "WAYLAND_DISPLAY" ); if ( tmp ) dpy = g_strdup( tmp ); else #endif
- Uses
-
src/vfs/vfs-execute.c- Multiple checks for Wayland vs X11 when executing applications
- Handles
WAYLAND_DISPLAYvsDISPLAYenvironment variables - Disables startup notification under Wayland (X11-specific feature)
#if GTK_CHECK_VERSION (3, 0, 0) if ( ! GDK_IS_X11_SCREEN ( screen ) ) return ws_num; #endif
HIGH - This is almost certainly the root cause of your Wayland segfaults. Without these checks, SpaceFM attempts to call X11-specific functions like:
gdk_x11_window_lookup_for_display()gdk_x11_get_default_root_xwindow()- X11 workspace detection
- X11 startup notification
These functions fail or return NULL under Wayland, leading to segmentation faults.
Commit (in upstream 1.0.6): 3089c4d (January 30, 2018) by IgnorantGuru/Teklad
Issue: #649, #670
Both versions include this fix since it was part of the 1.0.6 release.
Fixes segfaults when dragging files to directory tree under GTK 3.22+. The _GdkDragContext structure changed between GTK3 versions (fields were added/removed), causing crashes.
File Modified: src/ptk/ptk-dir-tree-view.c
The fix adds version-specific fields to the _GdkDragContext structure:
#if GTK_CHECK_VERSION (3, 22, 0)
GdkDisplay *display;
#endif
// ... other fields ...
#if GTK_CHECK_VERSION (3, 22, 0)
guint drop_done : 1;
#endifThis is likely the "pointer type patching" you mentioned doing to make gameblabla work.
These fixes were included in the SpaceFM 1.0.6 release that both versions are based on:
-
Icon view to tree drag fix (
7967bd4)- File:
src/exo/exo-icon-view.c - Checks
GTK_IS_TREE_DRAG_SOURCE()before calling drag functions - Prevents segfaults when dragging from icon view to tree sidebar
- File:
-
Bookmark reorder fix (
3852950)- File:
src/ptk/ptk-location-view.c - Moves list update from
row-deletedtodrag-endevent - Prevents crashes during bookmark reordering
- File:
-
Desktop drag fix (
e74c971)- File:
src/desktop/desktop-window.c - Adds null pointer check:
l->next ? l->next->data : NULL - Prevents segfaults when dragging files/folders on desktop
- File:
-
Dir tree iterator fix (
c0fd7fc)- File:
src/ptk/ptk-dir-tree.c - Adds null pointer check:
!( node && node->next ) - Prevents segfaults when navigating directory tree
- File:
Status: ✅ Present in BOTH
Both versions fix the GCC 10 -fno-common default change:
gameblabla: Commits 581d540 + 1693380 (June 2020)
- Adds variable definitions in
src/settings.c - Adds
externdeclarations insrc/settings.h
Debian: Patch fix-gcc10-fno-common.patch
- Same approach, slightly different implementation
- Based on Fedora patch by Mamoru TASAKA
Both properly handle the multiple definition errors introduced by GCC 10's stricter compilation defaults.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: fix-ftbfs-gcc14.patch
Debian includes additional fixes for GCC 14 compatibility that gameblabla doesn't have.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patches:
fix-c23-function-proto.patch- Fixes function declarations without parameter informationfix-c23-bool-keyword.patch- Handles C23 bool keyword changes
These are forward-compatibility patches that gameblabla doesn't include.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: 0001-glibc-2.28-compatibility.patch
Status: ❌ Missing in Debian | ✅ Present in gameblabla
Commit: f74ee52 (April 26, 2019) by Joseph Lansdowne
Merged via: Pull Request #5 from ikn/master
File: src/exo/exo-icon-view.c
What It Does: Fixes an issue where pressing Enter in compact/icon view modes doesn't open selected files unless there's a focused file.
Impact: QoL improvement for keyboard navigation
Status: ❌ Missing in Debian | ✅ Present in gameblabla
Commits: Multiple commits in PR #4 from szekelyszilv/btrfs-clone (July 2023)
What It Does: Adds support for Btrfs clone ioctl, enabling efficient copy-on-write file copying on Btrfs filesystems.
Impact: Performance improvement for users with Btrfs filesystems
Status: ❌ Missing in Debian | ✅ Present in gameblabla
Commit: 3698cc7 (May 7, 2023) by orbea
Merged via: Pull Request #1 from orbea/dash
File: configure.ac
What It Does: Fixes bad substitutions in configure script when using dash as /bin/sh instead of bash.
Impact: Build system compatibility improvement
Status: ❌ Missing in Debian | ✅ Present in gameblabla
Commits: a5cfdac, ac481b8 (November 2019) by Vladimir-csp
Merged via: Pull Request #3 from Vladimir-csp/patch-2
What It Does: Adds support for aft-mtp-mount (Android File Transfer) and improves FUSE handling.
Impact: Better Android device connectivity
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: add_optional_close_last_tab.patch
Adds an option to prevent closing the last tab, improving usability.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: fix_thumbnails.patch
Fixes thumbnail generation issues.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: update_desktop_files.patch
Updates .desktop files for better desktop environment integration.
Status: ❌ Missing in gameblabla | ✅ Present in Debian
Debian patch: fix-spelling-error.patch
Fixes spelling errors throughout the codebase.
- Based on: SpaceFM 1.0.6 (March 2018)
- Focus: Runtime fixes and Wayland support
- Build compatibility: GCC 10
- Maintained: Yes (last update July 2023)
- Community: Active via pull requests
- Based on: SpaceFM 1.0.6 (March 2018)
- Focus: Build system compatibility and Debian integration
- Build compatibility: GCC 10, GCC 14, C23, glibc 2.28
- Maintained: Yes (last update October 2024)
- Integration: Debian-specific enhancements
Based on this analysis, your Wayland segfaults are almost certainly caused by the missing Wayland support patches in the Debian package.
Without the Wayland detection patches, SpaceFM unconditionally calls X11-specific functions like:
gdk_x11_window_lookup_for_display()- crashes when display is not X11gdk_x11_get_default_root_xwindow()- returns invalid data under Wayland- X11 workspace detection functions - fail under Wayland
- X11-specific IPC socket creation - causes communication issues
The gameblabla fork includes commit 40ba5e3 which adds comprehensive checks:
if ( display && GDK_IS_X11_DISPLAY (display ) )
// Only call X11 functions if we're actually using X11These checks prevent X11 function calls under Wayland, avoiding the segfaults.
You mentioned doing "some pointer type patching" to make gameblabla work. This was likely one or more of:
- The
_GdkDragContextstructure fix (already in both versions) - Null pointer checks in drag-and-drop code (already in both versions)
- Additional runtime fixes you discovered
Apply only the Wayland support patch to Debian package
Pros:
- Directly addresses the root cause of segfaults
- Minimal change scope reduces risk
- Well-tested patch (in use since August 2022)
- Clean, focused fix
Cons:
- Misses other functional improvements from gameblabla
- May need additional patches later
Implementation:
Extract commit 40ba5e3 from gameblabla fork as a patch and add it to Debian's patch series.
Files to patch:
src/desktop/desktop.csrc/desktop/working-area.csrc/main-window.csrc/main.csrc/vfs/vfs-execute.c
Debian patch file: add-wayland-support.patch
Cherry-pick multiple functional improvements from gameblabla
Pros:
- Fixes Wayland issues
- Adds useful features (Btrfs clone, better MTP support, activation fix)
- More future-proof
- Better overall user experience
Cons:
- Larger change scope
- More testing required
- Potential for unexpected interactions
Implementation: Add the following patches to Debian in order:
add-wayland-support.patch(commit40ba5e3) - CRITICALfix-activation-no-focus.patch(commitf74ee52) - Nice to haveadd-btrfs-clone-support.patch(commits in PR #4) - Optionalfix-dash-configure.patch(commit3698cc7) - Optionaladd-enhanced-mtp-support.patch(commitsa5cfdac,ac481b8) - Optional
Replace Debian's base with gameblabla fork
Pros:
- Gets all functional improvements
- Well-maintained fork
- Proven to work under Wayland
Cons:
- Loses Debian-specific patches (GCC 14, C23, thumbnails, etc.)
- Requires re-applying Debian patches on top
- More disruptive change
Implementation:
- Use gameblabla fork as base
- Re-apply Debian-specific patches:
fix-ftbfs-gcc14.patchfix-c23-function-proto.patchfix-c23-bool-keyword.patchfix_thumbnails.patchadd_optional_close_last_tab.patchupdate_desktop_files.patch
Regardless of which option you choose, test the following scenarios under Wayland:
- Launch SpaceFM - Should not segfault on startup
- Navigate directories - Should work without crashes
- Drag and drop files - Between panes, to bookmarks, to desktop
- File operations - Copy, move, delete, rename
- Bookmark management - Add, remove, reorder bookmarks
- Icon/Compact view - Switch between views, activate files with Enter
- Desktop integration - If using desktop mode
- IPC - Multiple instances communication
- External programs - Launching applications from SpaceFM
- MTP devices - If you use Android devices
- X11 session - Verify nothing broke for X11 users
- Build system - Compile with GCC 10, GCC 14
- Standard operations - Everything that worked before should still work
-
Patch extraction from gameblabla:
cd gameblabla_spacefm git format-patch -1 40ba5e3 --stdout > add-wayland-support.patch
-
Add to Debian patch series:
cd debian/patches # Edit series file to add: add-wayland-support.patch
-
Test build:
dpkg-buildpackage -us -uc
-
Update changelog:
spacefm (1.0.6-11) unstable; urgency=medium * Add Wayland support patch from gameblabla fork * Fixes segfaults when running under Wayland (Closes: #XXXXXX) -- Maintainer <email> Date
-
Clone gameblabla fork:
git clone https://github.com/gameblabla/spacefm.git cd spacefm -
Build and install:
./autogen.sh ./configure --prefix=/usr/local make sudo make install
-
Or use Debian build system:
# Download Debian packaging apt source spacefm-gtk3 # Replace source with gameblabla rm -rf spacefm-1.0.6/src cp -r /path/to/gameblabla_spacefm/* spacefm-1.0.6/ # Build package cd spacefm-1.0.6 dpkg-buildpackage -us -uc
| Patch | Priority | Impact | Risk | Recommendation |
|---|---|---|---|---|
| Wayland Support | 🔴 CRITICAL | Fixes segfaults | Low | MUST APPLY |
| Activation Fix | 🟡 Medium | QoL improvement | Low | Apply if easy |
| Btrfs Clone | 🟢 Low | Performance | Medium | Optional |
| Dash Configure | 🟢 Low | Build compatibility | Low | Optional |
| Enhanced MTP | 🟡 Medium | Android support | Medium | Optional |
| GCC 14 compat (Debian) | 🟡 Medium | Build system | Low | Keep Debian's |
| C23 compat (Debian) | 🟢 Low | Future-proofing | Low | Keep Debian's |
| Thumbnails (Debian) | 🟡 Medium | Functionality | Low | Keep Debian's |
The gameblabla fork includes critical Wayland support that is completely missing from the Debian package. This is the root cause of your segfaults under Wayland.
Recommended Action:
- Immediate term: Apply the Wayland support patch (
40ba5e3) to your Debian package - Short term: Test thoroughly and report findings
- Medium term: Consider cherry-picking additional useful features from gameblabla
- Long term: Maintain a hybrid approach - Debian's base with gameblabla's functional improvements
The Wayland patch is well-isolated, well-tested, and directly addresses your issue. It should be safe to apply with minimal risk of breaking existing functionality.
- gameblabla fork: https://github.com/gameblabla/spacefm
- Original SpaceFM: https://github.com/IgnorantGuru/spacefm
- Debian package: https://tracker.debian.org/pkg/spacefm
- Wayland support: https://github.com/gameblabla/spacefm/commit/40ba5e3
- GTK 3.22 drag fix: https://github.com/gameblabla/spacefm/commit/3089c4d
- GCC 10 fixes: https://github.com/gameblabla/spacefm/commit/581d540
- Wayland PR: gameblabla/spacefm#2
- GTK3.22 drag issues: IgnorantGuru/spacefm#649, #670
Analysis performed on:
- gameblabla fork location:
~/spacefm_analysis/gameblabla_spacefm/ - Debian source location:
~/spacefm_analysis/spacefm-1.0.6/ - This report:
~/spacefm_comparison_report.md
To extract the Wayland patch:
cd ~/spacefm_analysis/gameb