File picker crashes Brave/Firefox/Tor etc Sway Wayland

expected outcome:

  • When using the system the file picker should work as usual.
    actual outcome:
  • The file picker on Firefox crashes it or does nothing. On brave it crashes the system. But Falkon works fine. (as it is qt I assume)
  • I had issues before with it being very laggy before it completely stopped working
  • Meta information like system and nix versions:
    system.stateVersion = “23.11”;
    flakes/other experimental features disabled

relevant config, copied and pasted from configuration.nix, these settings have been changed around enabled/disabled with no avail:
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
programs.xwayland.enable = true;

xdg.portal.wlr.enable = true;
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-kde
# xdg-desktop-portal-gtk (disabled as it causes errors)
];
};
environment.sessionVariables.XDG_DATA_DIRS = lib.mkAfter [
(builtins.readFile (pkgs.stdenv.mkDerivation {
name = “missing-gsettings-schemas-fix”;
dontUnpack = true;
buildInputs = [ pkgs.gtk3 ];
installPhase = ‘’
printf %s “$GSETTINGS_SCHEMAS_PATH” > “$out”
‘’;
}))
];
systemd.services.xdg-desktop-portal = {
description = “xdg-desktop-portal service”;
after = [ “graphical-session-pre.target” ];
wants = [ “graphical-session-pre.target” ];
partOf = [ “graphical-session.target” ];
serviceConfig = {
ExecStart = “${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal”;
Restart = “always”;
User = “”;
};
wantedBy = [ “graphical-session.target” ];
};
xwayland is enabled
firefox error (not mine but had the same, I just can’t reproduce now)
(firefox:1677716): Gdk-CRITICAL **: 19:45:37.871: …/gdk/wayland/gdkdisplay-wayland.c:1433: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
source: https://www.reddit.com/r/NixOS/comments/1ciarn2/firefox_crashes_when_i_try_to_open_the_file_picker/
similar post: Tor browser cannot show file picker.
for me it is set to 1 and locked.
I also tried disabling hardware acceleration on firefox, didn’t help.
Firefox with portals returns: [user@computer:~]$ GTK_USE_PORTAL=1 firefox
[49478, Main Thread] WARNING: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop: ‘glib warning’, file /build/firefox-125.0.3/toolkit/xre/nsSigHandlers.cpp:187

(firefox:49478): Gdk-WARNING **: 23:11:42.910: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

1 Like