Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback gtk file picker window size automatically set to an extremely large value #1222

Closed
matchatealeaf opened this issue Mar 7, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@matchatealeaf
Copy link

System Information

  • niri version: 25.02

  • Distro: Artix Linux 6.13.5-artix1-1

  • GPU: AMD RX 6600

  • CPU: AMD Ryzen 5 5600X

I've encountered an issue where the y value of xdg-desktop-portal-gtk file picker window size is set to an extremely large value of a few hundred thousand pixels.

This caused programs that uses the fallback gtk file picker to crash whenever the file picker is invoked.

Here's an example error message from these programs:

[Parent 32501, Main Thread] WARNING: Native Windows taller than 65535 pixels are not supported: 'glib warning', file /var/tmp/build/firefox-64d9c39553ae/toolkit/xre/nsSigHandlers.cpp:187

(Mullvad Browser:32501): Gdk-WARNING **: 22:46:46.578: Native Windows taller than 65535 pixels are not supported
[Parent 32501, Main Thread] WARNING: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1446: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.): 'glib warning', file /var/tmp/build/firefox-64d9c39553ae/toolkit/xre/nsSigHandlers.cpp:187

(Mullvad Browser:32501): Gdk-CRITICAL **: 22:46:46.596: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1446: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Exiting due to channel error.
Exiting due to channel error.
zsh: segmentation fault  mullvad-browser

This is solved easily by resetting the window size with gsettings reset org.gtk.Settings.FileChooser window-size.

However, it is weird that this happened suddenly after using niri for a couple of months.
I certainly do not have hundred thousands of monitor resolution to caused the file picker window size to be set to those values manually.

Some extra infos:

  • Output config: output "HDMI-A-2" { mode "1920x1080"; }
  • Monitor resolution: 1920x1080
  • Single HDMI monitor.
@matchatealeaf matchatealeaf added the bug Something isn't working label Mar 7, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Mar 7, 2025

The dialog remembers its size; niri will in most cases just ask it to come up with a size itself. I'm not sure how you got it to remember such a tall size. Could it be that you did a set-window-height with a large % by accident? Either way, I don't see a niri bug here.

@matchatealeaf
Copy link
Author

I did not set the window height manually anywhere.
I've only resize the window via mouse dragging which shouldn't cause it to be such a tall size since I don't have that much screen space anyway.

I would agree that this doesn't seem like a niri bug, but I can't think of any other thing that would resize windows except for niri.

I'm just wondering if there's some edge case where niri's calculation for resizing of windows (e.g., changing to floating, moving to another workspace, drag and drop, tiling or stacking etc.) hit a singularity or division by a small value and caused the height to blow up to a large value.

@YaLTeR
Copy link
Owner

YaLTeR commented Mar 7, 2025

Well unless you find such a case with a reproducer, this bug is not actionable. We don't even know if it exists.

@matchatealeaf
Copy link
Author

Thanks for the help, I will close this as this seems to be the root cause: mullvad/mullvad-browser#418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants