hugolabe / Wike

Wikipedia Reader for the GNOME Desktop
https://hugolabe.github.io/Wike/
GNU General Public License v3.0
231 stars 32 forks source link

Wrong resolution on HiDPI screen in KDE with Wayland #132

Closed spoorun closed 9 months ago

spoorun commented 1 year ago

When running via Flatpak on Manjaro with KDE & Wayland the app works fine generally, though it doesn't appear to set the correct resolution, so on a 4k screen everything is very small and should be 1.5x or 2x the resolution shown.

spoorun commented 1 year ago

Running with "--force-device-scale-factor=2" fails with "Unknown option --force-device-scale-factor=2"

hugolabe commented 1 year ago

Do you mean the UI, the content, or both?

Have you tried other GTK4 applications?

I don't have a high density screen, but I tried changing the global scale (in Manjaro KDE) to 2x on my FHD screen and this is what I get. From what I see KDE increases the size of fonts but not UI elements in GTK applications (the same happens in others).

Screenshot_20230426_153348

spoorun commented 1 year ago

It affects only the content (both text and images), the web content from Wikipedia. The UI is fine, it was set to scale 2.0 x, and the content and UI of other apps scales appropriately. The UI is fine on other GTK apps, I'm just checking the content though. Perhaps it is a KDE Plasma rendering issue. The content on Foliate (eBook app) is showing to small too, and that seems to be GTK3.

Also note I'm running Wike 2.0.1 via Flatpak, with Wayland and KDE running on Manjaro, in case that's relevant. Also, I can zoom in manually to make the content legible, but the zoom resets every time I change page.

Screenshot_20230428_072911

hugolabe commented 1 year ago

It's weird. Comparing with what I get for the same page (on a 1920x1080 screen) I see that it does scale the images but not the text. What font and size is the app using? Does increasing the font size (in View Menu) fix the problem?

Screenshot-2023-04-28-09-23-41

It could be a Webkit rendering problem in KDE (I think Foliate uses Webkit too). It would be interesting to see how GNOME Web behaves.

I can zoom in manually to make the content legible, but the zoom resets every time I change page.

If you change the zoom from the View Menu it should keep it even if you exit the application and re-enter it.

spoorun commented 1 year ago

It's weird. Comparing with what I get for the same page (on a 1920x1080 screen) I see that it does scale the images but not the text. What font and size is the app using? Does increasing the font size (in View Menu) fix the problem?

It could be a Webkit rendering problem in KDE (I think Foliate uses Webkit too). It would be interesting to see how GNOME Web behaves.

I can zoom in manually to make the content legible, but the zoom resets every time I change page.

If you change the zoom from the View Menu it should keep it even if you exit the application and re-enter it.

Yeah, it's very strange.

Changing the resolution through KDE / System Settings on my system doesn't change text or image size.

Changing the font size in View Menu does nothing, it doesn't change (changing the font type does work though).

As you suggested, I tried changing the zoom scale through the View Menu, however changing it that way changes ONLY the image size, has no impact on text size.

Changing the zoom level directly on a page via pinching screen (with touchscreen) or using keyboard or touchpad shortcuts changes both the image and text size, but is reset with every page change as described.

hugolabe commented 1 year ago

Frankly, I think it's not an application problem and there must be something wrong with your system. I have tested it on two distributions with KDE (Manjaro and Neon) and in both cases it works fine, both the zoom and the selection of the font size.

https://user-images.githubusercontent.com/18441950/236171287-79994c4d-7a50-402c-9082-5d754e1ff81e.mp4

archisman-panigrahi commented 9 months ago

Can you try running wike with the environment variable GDK_SCALE=2? If that works for you, then you can edit the .desktop file to add the environment variable.

I don't know if this is possible with the Flatpak, but this is definitely possible with the natively packaged app installed with pacman.

MasterKia commented 9 months ago

I don't know if this is possible with the Flatpak

Add it as an environment variable in Flatseal or from Flatpak cli.

spoorun commented 9 months ago

GDK_SCALE=2

Yeah tried that, it makes no difference. The content of the wikipedia pages doesn't change size (the UI)

spoorun commented 9 months ago

Frankly, I think it's not an application problem and there must be something wrong with your system. I have tested it on two distributions with KDE (Manjaro and Neon) and in both cases it works fine, both the zoom and the selection of the font size. Neon.mp4

I've tested it on two systems, both Manjaro, one a clean install, when you did the tests you mentioned was it on a 4k system?

spoorun commented 9 months ago

Okay, so Foliate seems to have the same issue:

On KDE both Foliate and Wike:

So it seems to be a bug further up the chain.

Any ideas as to which component, and where it should be reported, would be appreciated.

hugolabe commented 9 months ago

I've tested it on two systems, both Manjaro, one a clean install, when you did the tests you mentioned was it on a 4k system?

No. My screen is 1920x1080.

So it seems to be a bug further up the chain.

Any ideas as to which component, and where it should be reported, would be appreciated.

Wike uses WebKit to display the Wikipedia view. I think Foliate uses it too. You could also try GNOME Web (which also uses WebKit) to make sure.

archisman-panigrahi commented 9 months ago

@spoorun Can you confirm if this is a flatpak bug or a general bug? Try the official Arch package with the environment variable GDK_SCALE=2 instead, and let us know.

spoorun commented 9 months ago

Okay @archisman-panigrahi and @hugolabe @MasterKia thanks for the pointers.

So I've testedthe following apps on 3 systems running KDE Manjaro with Wayland and HiDPI screens

With AUR/Distro/Snap versions:

All the apps behaved correctly with regard to resolution (except Gnome Web did not pick the correct resolution out of the box).

With Flatpak versions:

All the apps displayed the same incorrect behaviour:

So the question that I'd appreciate any help with, is this either:

a) a specific packaging bug in each of Wike, Gnome Web, Foliate (and maybe others)? or b) a generic bug in Flatpak? or c) a generic bug in Flatpak in relation to how it packages Webkit?

archisman-panigrahi commented 9 months ago

This is most likely a flatpak bug and not a packaging bug. You can open an issue with flatpak. From my experience, distro packages tend to have less bugs compared to snap/flatpak apps. On Arch based distros, snap/flatpak are really not necessary. as almost everything is there in the AUR.

On Thu, Oct 12, 2023, 5:56 AM Störm @.***> wrote:

Okay @archisman-panigrahi https://github.com/archisman-panigrahi and @hugolabe https://github.com/hugolabe @MasterKia https://github.com/MasterKia thanks for the pointers.

So I've testedthe following apps on 3 systems running KDE Manjaro with Wayland and HiDPI screens

  • Foliate (Flatpak, Snap, Distro)
  • Wike (AUR, Flatpak, Snap)
  • Gnome Web (Flatpak, Snap, Distro)

With AUR/Distro/Snap versions:

All the apps behaved correctly with regard to resolution (except Gnome Web did not pick the correct resolution out of the box).

  • Wike & Foliate display content at a reasonable resolution on a 4k screen out of the box without any changes (GDK_SCALE=2 etc... not required)
  • Gnome Web needed manually changing in the GUI to start with
  • the zoom buttons (percentage increase) work okay for both text and images as expected
  • increasing the text size works correctly as expected

With Flatpak versions:

All the apps displayed the same incorrect behaviour:

  • displayed content at a small unreadable resolution on a 4k screen out of the box
  • using GDK_SCALE=2 does not help with
  • the zoom buttons (percentage increase) increase image sizes but NOT text sizes
  • increasing the text size has no effect (but changing font type or style does work)

So the question that I'd appreciate any help with, is this either:

a) a specific packaging bug in each of Wike, Gnome Web, Foliate (and maybe others)? or b) a generic bug in Flatpak which I should raise there?

— Reply to this email directly, view it on GitHub https://github.com/hugolabe/Wike/issues/132#issuecomment-1759301075, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXL2XAMBWRDWACHQHQMXO3X665GFANCNFSM6AAAAAAXKZTV7I . You are receiving this because you were mentioned.Message ID: @.***>

archisman-panigrahi commented 9 months ago

Given this is not a wike bug and workarounds (AUR/snap) are available, can we close this issue?

spoorun commented 9 months ago

This is most likely a flatpak bug and not a packaging bug. You can open an issue with flatpak. From my experience, distro packages tend to have less bugs compared to snap/flatpak apps. On Arch based distros, snap/flatpak are really not necessary. as almost everything is there in the AUR.

Sure, agreed. I just wanted to check it wasn't a packaging bug and was more systemic with Flatpak.. I realise I can workaround it with AUR etc... however, it should be resolved for others' sake.

Hence, I'll open a bug in Flatpak, and close this.

Thanks everyone for helping work through to get to the issue.

spoorun commented 9 months ago

Close Opened bug in Flatpak to address this issue: https://github.com/flatpak/flatpak/issues/5557