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

Window scaling #766

Open
porridgewithraisins opened this issue Nov 9, 2024 · 2 comments
Open

Window scaling #766

porridgewithraisins opened this issue Nov 9, 2024 · 2 comments

Comments

@porridgewithraisins
Copy link

porridgewithraisins commented Nov 9, 2024

First of all, nice terminal! I like the features you have focused on at the initial stages. It's really snappy, and neovim works really well in it especially all my weird mouse bindings.

Now, I have my WM render windows to a 3072x1920 canvas, which I then xrandr downscale by 1.6x to display on a 1920x1200 screen, giving the overall effect of a fractionally scaled desktop. This is a common trick used in X11 environments (and macos does the same, but transparent to applications so you don't have to do anything there) to achieve good looking HiDpi screens.

In rio, while the font size setting is enough to get the text grid scaled per my liking, the overall interface needs it's own zoom setting.

Otherwise, it currently looks like this:

If you squint really hard, you can see the search bar at the bottom there! The same happens with the bookmarks at the top right.

As for the implementation, my suggestion is that you try and make it "automatic" so that it looks great at the user's first launch, by trying in sequence reading the QT_SCALE_FACTOR and GDK_SCALE environment variables. Anyone that has this kind of frac. scaling setup will usually set one or both of those environment variables to their desired scaling. If neither of those exist, you can always fallback to an interface-zoom setting in rio's config.toml and have the user override it there.

@raphamorim
Copy link
Owner

Hey @porridgewithraisins thank you so much for the detailed issue, I really appreciate!

Wow there's actually an user case I never thought about it! Sorry about that.

I am curious about how other terminals and text editors handle it?

@porridgewithraisins
Copy link
Author

porridgewithraisins commented Nov 13, 2024

So GTK/QT apps read those two environment variables I mentioned, and the app developer need not do any work, the framework handles it. The same is true in electron (it reads something from dbus IIRC)

In Kitty, all the interface elements are text, so me adjusting the font size suffices -- the containers all expand accordingly. The same is true in alacritty and wezterm. I think it makes the most sense for rio to take this approach as well, adding an option to scale non-shell-interface text elements (like the search at the bottom) also with the main font size.

Assuming like alacritty and kitty you're not aiming to add a lot of GUI elements, this should be enough I think. The bookmarks thing and other non-text elements could also be scaled with the same factor I think, but that's a little more tricky I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants