Skip to content

File dialog crash on Wayland (Fedora 43) - NFD_GetNativeWindowFromGLFWWindow fails #946

@scroyroyo

Description

@scroyroyo

Description

ngscopeclient crashes when opening any file save/open dialog on Wayland.

Environment

  • OS: Fedora 43 (Wayland session, KDE Plasma)
  • Desktop portals installed: xdg-desktop-portal, xdg-desktop-portal-gtk, xdg-desktop-portal-kde

Steps to Reproduce

  1. Launch ngscopeclient on Wayland
  2. Try to open any file dialog (File → Save, Export, etc.)
  3. Crash occurs

Error Output

ERROR: failed to get window handle
(ngscopeclient:PID): Gtk-CRITICAL **: gtk_widget_get_window: assertion 'GTK_IS_WIDGET (widget)' failed
Segmentation fault (core dumped)

Backtrace

Crash occurs in GTK widget sizing code after NFD_GetNativeWindowFromGLFWWindow() fails to get a valid window handle on Wayland.

Workarounds Attempted

  • GTK_USE_PORTAL=0 - still crashes
  • GTK_THEME=Adwaita - still crashes
  • GDK_BACKEND=x11 - still crashes

Analysis

The issue appears to be in NFDFileBrowser.cpp:141-142 where NFD_GetNativeWindowFromGLFWWindow() fails on Wayland. The code continues with an invalid parent window handle, causing the subsequent GTK dialog to crash.

Possible Fix

NFD library may need updates for proper Wayland support, or the file dialog code needs a fallback when the native window handle cannot be obtained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguiNew UI features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions