efiboots icon indicating copy to clipboard operation
efiboots copied to clipboard

Incorrect Scaling on High DPI monitor since GTK4 update

Open Kytech opened this issue 3 years ago • 7 comments

Since the switch to GTK4, the application is not scaling properly on a high DPI monitor. I have my system configured for 2x scaling so that everything isn't absolutely tiny (my device has a resolution of 3000X2000 in about 13in, so fairly close to about 3k). The following is a screenshot of the application when I launch it:

Screenshot_20211205_014809

Attempting to override the scaling for this app by running GDK_SCALE=1, the window size is usable, but then all controls are so tiny that they are nearly impossible to use:

Screenshot_20211205_015603

Before the switch from GTK3 to GTK4, everything was scaling fine without issue.

System Configuration: Arch Linux Kernel v5.15.5 Desktop Environment: KDE Plasma 5.23.4-1, X11 efiboots version: 1.0.r7.ga2514cd-1, installed from AUR package

Kytech avatar Dec 05 '21 09:12 Kytech

Maybe this is a duplicate of #23?

Elinvention avatar Dec 05 '21 20:12 Elinvention

I don't think it's related to #23. The wide window that couldn't be resized was still happening to me when this used GTK3, but I never had boot entries long enough to make it overflow off the screen back when this built against GTK3, so it wasn't an issue for me at least.

Additionally, the elements that are not scaling properly extend to outside the Gtk.TreeView control. The scaling issues include the buttons added next to the standard close, minimize, etc buttons in the title bar as well as the buttons used to move boot entries up and down below the GTK.TreeView.

Part of me is wondering if GTK4 just doesn't work too well with high DPI displays at the moment. I came across an issue on the GTK4 project that mentions blurry text (which happens on this app if I don't force the GDK_SCALE to 1 and let it use the system scaling, which results in the top screenshot. In that case, the text looks noticeably blurry on my display, though it's hard to tell in the screenshots). Here's a link to it for reference: https://gitlab.gnome.org/GNOME/gtk/-/issues/3787 Further down in that issue, it seems like GTK4 is needing to change some of their rendering logic for high dpi devices, so I wouldn't be surprised if there's other high dpi issues with GTK4 as well.

The only other possible thing I can think of is if non-GNOME desktop environments/window managers aren't very aware of GTK4 and don't properly adjust the settings. I'd be somewhat surprised at that though since GTK4 has been around for about a year now. I'll have to look at the GTK config files form GTK3 and GTK4 to see if they look similar or not.

Kytech avatar Dec 05 '21 23:12 Kytech

I see. Thanks for reporting this issue, but I'm afraid I can't do much. Maybe I should just revert to GTK3 given that there are bugs with the treeview too (if I resize a column past the window border everything becomes unresponsive).

Elinvention avatar Dec 05 '21 23:12 Elinvention

Oof, that's not a fun bug with column resizing freezing the app. If reverting back to GTK3 fixes that issue as well, then that sounds like it would fix my issue. If you want to try and investigate fixing that other bug without reverting to GTK3, I'd be happy to try tweaking my GTK4 settings in case it helps, but I probably won't have the time to do that for a week or so. If you decide to revert to GTK3, just make sure that gets noted on this issue so that I don't dive into it if the issue's fixed. I'll get notified since I'm subscribed to the issue. Thanks for the quick response!

Kytech avatar Dec 05 '21 23:12 Kytech

Just writing here to report that GTK 4.10 (planned for March 2023) will officially deprecate GtkTreeView, GtkIconView, GtkComboBox, and all the API related to cell renderers. That's a good move because the API is broken and buggy, but it also means that I will have to redesign the UI from scratch.

By the way is this issue still relevant?

Elinvention avatar Oct 15 '22 10:10 Elinvention

Just writing here to report that GTK 4.10 (planned for March 2023) will officially deprecate GtkTreeView, GtkIconView, GtkComboBox, and all the API related to cell renderers. That's a good move because the API is broken and buggy, but it also means that I will have to redesign the UI from scratch.

By the way is this issue still relevant?

If you'll be redesigning the UI from scratch, that may resolve the issue, though I am not 100% sure if it will. GTK4 does not seem to play as nicely as I would hope with high-DPI monitors in general around the time I opened this issue, but if I recall correctly, there may have been some improvements recently. I'll double-check how everything is behaving and I'll get back to you on that. It might be that some parts of the UI are scaling better in GTK4 apps as of late and the GtkTreeView and such are not.

Kytech avatar Oct 25 '22 21:10 Kytech

@Elinvention Looks like its working a bit better compared to last time I tried with 2x scaling on this app, but it's still up-sizing more than it should. It will actually all fit on my display now so I can use it with scaling, but it's still larger than it's probably supposed to be (fills the width of my 13.5in laptop screen). I've attached a screenshot with a comparison to what gtk3 looks like on the exact same scaling settings on my machine for reference.

image

Ultimately, I think that GTK4 just still has some issues with HighDPI in various different desktop environments/window manager environments. It's usable for me now, but not as usable as it was when it used GTK3, which seems to have more robust HighDPI support across the board.

Kytech avatar Oct 27 '22 02:10 Kytech