PWAsForFirefox icon indicating copy to clipboard operation
PWAsForFirefox copied to clipboard

Extension menu truncated on Linux with display scaling

Open NotBigIntoBooks opened this issue 2 years ago • 5 comments

Description

The extension menu when manually installing PWAs or configuring the extension is truncated on Linux Wayland when using display scaling.

Additional Information

This appears to be caused by the fact that the maximum length of the application/extension menu in Firefox is a function of resolution and display scale. When the display is scaled up from native, the length of the menu is capped. The extension menu is allowed to scroll, but the lower limit doesn't seem to be set correctly to this limited value, and so is cut off. If display scaling is set back to 100%, the menu displays correctly.

Steps to Reproduce

  1. Install extension on Firefox under Wayland with 125% display scaling.
  2. Open extension menu
  3. Observe issue
  4. Attempt to install as PWA
  5. Observe issue

Additional Information

image image image

Environment

  • Operating system: Fedora 36
  • System architecture: 86-64
  • Desktop environment: Gnome
  • Installation method: RPM
  • PWAsForFirefox extension version: 2.1.0
  • PWAsForFirefox native version: 2.1.0
  • Firefox version: 105.0.2 (64-bit)

NotBigIntoBooks avatar Oct 08 '22 12:10 NotBigIntoBooks

Whilst this could be a Firefox issue, other extensions display their menus correctly with display scaling enabled.

NotBigIntoBooks avatar Oct 08 '22 12:10 NotBigIntoBooks

The only special code related to the popup sizes is this function which, if I remember correctly, is needed to resize the popup in some cases. Otherwise, I think it's pretty much the normal Bootstrap UI.

Can you try to remove that function, build the extension and temporarily load it to check if this is what causes the problem? Unfortunately, I can't test it as I can't enable fractional scaling for some reason.

filips123 avatar Oct 08 '22 16:10 filips123

That's a bit over my head tbh. I think Wayland fractional scaling is still hidden by a gsetting by default.

NotBigIntoBooks avatar Oct 08 '22 17:10 NotBigIntoBooks

image I get a weirder thing on my linux install (could be related?). It doesn't do that if the extension is not outdated btw

Midou36O avatar Oct 19 '22 11:10 Midou36O

The only special code related to the popup sizes is this function which, if I remember correctly, is needed to resize the popup in some cases. Otherwise, I think it's pretty much the normal Bootstrap UI.

Can you try to remove that function, build the extension and temporarily load it to check if this is what causes the problem? Unfortunately, I can't test it as I can't enable fractional scaling for some reason.

root@24056260451d:/data/PWAsForFirefox/extension# git diff
diff --git a/extension/package.json b/extension/package.json
index 00351c1..f901353 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -2,7 +2,7 @@
   "name": "firefoxpwa",
   "description": "The browser extension part of the PWAsForFirefox project",
   "license": "MPL-2.0",
-  "version": "0.0.0",
+  "version": "2.12.1",
   "homepage": "https://pwasforfirefox.filips.si/",
   "repository": "https://github.com/filips123/PWAsForFirefox",
   "bugs": "https://github.com/filips123/PWAsForFirefox/issues",
diff --git a/extension/src/manifest.json b/extension/src/manifest.json
index e3ab334..f30942e 100644
--- a/extension/src/manifest.json
+++ b/extension/src/manifest.json
@@ -4,7 +4,7 @@
   "short_name": "__MSG_appShortName__",
   "description": "__MSG_appDescription__",
   "homepage_url": "https://pwasforfirefox.filips.si/",
-  "version": "0.0.0",
+  "version": "2.12.1",
   "default_locale": "en",
   "browser_specific_settings": {
     "gecko": {
diff --git a/extension/src/utils.js b/extension/src/utils.js
index f5054d7..ad9ba58 100644
--- a/extension/src/utils.js
+++ b/extension/src/utils.js
@@ -315,16 +315,4 @@ export function getIcon (icons, size) {
  * Sets the popup size to fit into the popup menu if needed.
  */
 export async function setPopupSize () {
-  const nextFrames = async n => {
-    for (let i = 0; i < n; i++) {
-      await new Promise(resolve => { self.requestAnimationFrame(() => { resolve() }) })
-    }
-  }
-
-  await nextFrames(4)
-
-  if (window.innerWidth < document.body.offsetWidth) {
-    document.documentElement.style.minWidth = 'initial'
-    document.body.style.minWidth = 'initial'
-  }
 }

Added the built extension to FF (Librewolf) and nothing changed, the install button is still missing on zoom levels above 100%

SinnySupernova avatar Aug 12 '24 13:08 SinnySupernova