Widgets not always rendering correctly at 300% scale?

I’ve got a user who is having issues with my app. Apparently they normally run it at 300% scale (a combination of high-DPI screen and readability of text sizes) and it looks like this:

There’s supposed to be text above that image, more text in several widgets beside and below “Lincoln’s Bible”, avatar images in the top-right of each item, and several icons in other GtkImage widgets.

If they use the GTK inspector then widgets do get rendered as they click on them (GIF recording). After a bit more debugging, they’ve also found that everything works fine at 200% scaling, but that’s not large enough for their normal use. They’re apparently not getting any warnings from GTK on the console, so whatever it is then GTK doesn’t obviously think there’s a problem.

Does anyone know what might cause this? They’re not seeing the same issues with other apps, but it seems odd that it’s only 300% scaling that triggers it. I’m not aware of anything particularly strange that I’m doing (no custom rendering for the widgets on display here).

Things like https://github.com/IBBoard/cawbird/blob/master/src/widgets/AvatarWidget.vala#L220-L221 don’t work if gtk_wiget_get_scale_factor() returns 3 and there are only 4 elements in the array. So that will read invalid memory and potentially corrupt the drawing of later widgets.

Double check all uses of gtk_widget_get_scale_factor() and maybe just run under valgrind with scale=3?

Ah, yes, of course. I hadn’t considered that. And I’d probably have assumed that they’d only break the current widget, not everything else.

Thanks for all the prior work you did on the app as well :slightly_smiling_face:

Just to confirm that fixing various assumptions of scale factor being 1 or 2 and nothing else appears to have fixed it for the user.

I know C doesn’t care about going beyond the end of an array, but I thought Vala might have picked some of this up and emitted a warning. I guess it adds overhead, though.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.