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

Lagrange on Mobile Linux: Does not adapt well to small screens #618

Open
huntekye opened this issue Aug 31, 2023 · 2 comments
Open

Lagrange on Mobile Linux: Does not adapt well to small screens #618

huntekye opened this issue Aug 31, 2023 · 2 comments
Labels
linux Relates some variant of Linux wayland

Comments

@huntekye
Copy link

Hi!

Thanks for making this great client for Gemini (and friends)! I am experiencing some issues with using Lagrange on a device with a very small screen: A pinephone pro running Linux v6.4.1-1-danctnix (a derivative of Arch) with the sway window manager (Wayland based). The screen causing issues is 720x1440 px, 68x136 mm, with a scaling factor of 2.0 configured in sway

Basically, the Lagrange window is cut off. Changing the UI scaling does not fix the problem (actually setting the scaling to 0.5 creates a huge left margin and the text is still cut off), nor does rotating the screen though this gets close to showing all of the text. There appear to be similar problems with other windows that Lagrange creates, e.g., the preferences window.

I think that potentially there are two things going on: 1) The windows Lagrange makes are not designed to be really small in Linux, though I imagine there must already be some kind of solution for this in iOS and Android; 2) I guess that historically there is only sort of so-so support for Wayland/sway in SDL.

For a bit of background on SDL and window size problems in sway see for example libsdl-org/SDL#3448 . On my laptop running sway I can confirm that even though the Lagrange window has some sort of minimum dimensions, sway is not aware of them, and Lagrange is not fully aware of the window that sway wants it to be in. This means that I can try to make the Lagrange window very small and sway will let me and the window's frame can be as small as I want, but eventually the window that Lagrange renders stops shrinking and renders outside of the frame that sway gives it. Similarly, opening the preferences window (on my laptop), it is tiled by default, generally leading to a window that is far too large. This is handled surprisingly well, and the extra space is filled with a background color, but here again sway allows me to change the size of the window but the rendered window does not react and simply renders outside it's frame (or does not fill the larger frame). This demonstrates that SDL is not correctly communicating minimum and maximum sizes of these windows to sway. These are not really practical issues on a laptop, but I think they provide some context for what is likely happening on a phone screen.

If there's any other information that would be useful, just let me know!

@skyjake
Copy link
Owner

skyjake commented Sep 1, 2023

Unfortunately this seems like a shortcoming in SDL, since it is responsible for the low-level window management. The best chance of fixing this is manually compiling the app using the latest release of SDL.

Also, Lagrange needs to be compiled with the -DENABLE_MOBILE_PHONE=YES CMake option, so the correct UI variant is used. However, this only affects UI layout inside the window, not window management.

@skyjake skyjake added linux Relates some variant of Linux wayland labels Sep 1, 2023
@huntekye
Copy link
Author

huntekye commented Sep 1, 2023

Ah yeah, compiling with that option basically fixes the problem! I guess that that would have been apparent if I had tried reading through CMakeLists.txt, but perhaps that option should be added to the table in the README? Ideally it is nice if this sort of thing is detected dynamically, but with how different the UIs are I get that it probably isn't easy to do. Potentially would it be possible to compile both UIs and switch between them with a runtime flag?

One problem I am still seeing is that it seems I can't open the Settings menu: selecting Settings from the hamburger menu closes the hamburger menu and then nothing happens. Also, ever time I try to close a tab it seg faults, but perhaps these would be better addressed in separate issues if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linux Relates some variant of Linux wayland
Projects
None yet
Development

No branches or pull requests

2 participants