Closed Bug 1872949 Opened 2 years ago Closed 2 years ago

[Wayland] window.open top/left options aren't respected when generating a popup with explicit author-requested screen position

Categories

(Core :: Widget: Gtk, defect)

All
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1870955

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached file testcase 1 (obsolete) —

STR:

  1. Load the attached testcase.
  2. Click the button in the testcase.

EXPECTED RESULTS:
A popup should appear that's left-aligned on your screen, 300px from the top of your screen (in whatever pixel coordinate space that window.open uses).

ACTUAL RESULTS:
The popup appears at some other position; sometimes snapped to top-left, sometimes at another position on-screen.

I think this is Wayland-specific. I'm not sure if we have any workaround for this, but I wanted to be sure we have a bug open to note the limitation and to have a handy place to post testcases. (Apologies if this is already tracked as a known-issue somewhere.)

Attached file testcase 1 —

(reuploading the testcase; my previous testcase used a data-URI and apparently that makes the popup auto-close in Firefox, which is interesting but unrelated.)

Attachment #9370974 - Attachment is obsolete: true

(This came across my radar when I was poking at testcases related to https://github.com/w3c/csswg-drafts/issues/7693 , BTW.)

Summary: [Wayland] window.open top/left options aren't respected → [Wayland] window.open top/left options aren't respected when generating a popup with explicit author-requested screen position

(In reply to Daniel Holbert [:dholbert] from comment #1)

my previous testcase used a data-URI and apparently that makes the popup auto-close in Firefox, which is interesting but unrelated

I filed bug 1872953 on this^ behavior FWIW.

bug 1870955: Wayland apps can't position their windows, it's a core security feature of Wayland.
IIUC, one can only spawn child windows (context menu, website info, bookmark menu, main menu) in relation to the main window (which has a taskbar icon).
Personally I have set browser.link.open_newwindow.restriction to 0 (bug 103843, bug 803675, bug 55696, bug 269942, bug 565621, bug 1740063, bug 1714939, bug 1369328, bug 565541). Please consider setting it by default to 0 at least for MOZ_WIDGET_GTK or for Wayland.

Blocks: wayland

We can position popup but only relatively to its parent window. If a popup is missing parent it's a toplevel window from Wayland POV and it can't be placed by application.

Let's track this in bug 1870955.

(In reply to Darkspirit from comment #4)

Personally I have set browser.link.open_newwindow.restriction to 0 (bug 103843, bug 803675, bug 55696, bug 269942, bug 565621, bug 1740063, bug 1714939, bug 1369328, bug 565541). Please consider setting it by default to 0 at least for MOZ_WIDGET_GTK or for Wayland.

I don't quite agree with this fwiw. This breaks a lot of legit popups (like e.g., PayPal / log in popups) that would be jarring to do in a separate tab / you'd lose a bunch of context.

Most popups don't specify a window position anyways afaict, because it's not super-reliable even on platforms where it actually works.

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: wayland-window-position
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: