[wayland] popup/tooltip windows can be drawn off the screen

NEW
Assigned to

Status

()

P2
normal
a year ago
5 days ago

People

(Reporter: jhorak, Assigned: stransky)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 affected)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

a year ago
In wayland backend the tooltip and popup menu windows are created as subsurface. This breaks correction of their position which ensures that window is not drawn outside of the screen or workarea. This is done by gdk/wayland [1] (and later there [3]) by default when the window type is GDK_WINDOW_TEMP as tested there [2].

[1] https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkwindow-wayland.c?h=gtk-3-22#n2345
[2] https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkwindow-wayland.c?h=gtk-3-22#n2239
[3] https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkwindow-wayland.c?h=gtk-3-22#n2011
(Reporter)

Comment 1

a year ago
Or better GDK_WINDOW_TYPE_HINT_POPUP_MENU, GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU or GDK_WINDOW_TYPE_HINT_COMBO
Severity: normal → minor
Priority: -- → P5
(Assignee)

Comment 2

a year ago
Recent wayland code creates popup windows as subsurface. We need to implement popups as xdg_popup which means we need to use gdk_seat_grab() and show the popup here (Bug 1377084).

We use subsurfaces for popups because of:
https://bugzilla.gnome.org/show_bug.cgi?id=783957
Severity: minor → normal
Depends on: 1377084
Priority: P5 → P2
(Reporter)

Comment 3

a year ago
We need to make gdk_window_move_to_rect() symbol public first to fix this: https://bugzilla.gnome.org/show_bug.cgi?id=791845
(Assignee)

Updated

10 months ago
Blocks: 635134

Comment 4

10 months ago
gdk_window_move_rect() is now public in GTK 3.24 and GTK maste:. https://gitlab.gnome.org/GNOME/gtk/issues/997
(Assignee)

Comment 5

10 months ago
(In reply to wvengen from comment #4)
> gdk_window_move_rect() is now public in GTK 3.24 and GTK maste:.
> https://gitlab.gnome.org/GNOME/gtk/issues/997

Good news everyone!

Comment 6

3 months ago
Just like to inform that on swaywm this is indeed happening on multi-screens displays with positive Y position.

Issue is solved by RedSoxFan as being an deprecation of gtk_menu_popup().  
https://github.com/swaywm/sway/issues/3135#issuecomment-448794177
Duplicate of this bug: 1466386
(Assignee)

Updated

22 days ago
Assignee: jhorak → stransky
(Assignee)

Updated

22 days ago
No longer depends on: 1377084
(Assignee)

Comment 10

22 days ago

Wayland refuses to open two popups with the same parent, so we use the subsurfaces window which are only an emulation of the proper popup behavior and causes the issues here.

When we create multilevel menus (like View -> Toolbars) we need to create "Toolbars" menu with "View" parent and not use a toplevel window as a parent of both.

I wonder if the xul popup code can be adjusted for it or we need to track popup creation at toolkit/widget level.

(Assignee)

Comment 11

22 days ago

As a workaround we can use pointer grab/release - it seems to identify the active popup reliably.

(Assignee)

Updated

21 days ago
Duplicate of this bug: 1528021
(Assignee)

Updated

21 days ago
Duplicate of this bug: 1339920
(Assignee)

Updated

21 days ago
Depends on: 1532643
(Assignee)

Comment 14

17 days ago
Posted patch popup-wip.patch (obsolete) — Splinter Review

WIP patch, almost working, needs better detection of anchor type and Patch from Bug 1532643.

(Assignee)

Updated

13 days ago
Attachment #9049616 - Attachment is obsolete: true

Comment 17

5 days ago

This was working for a few builds in the last week or so, but has reverted back to drawing off screen again :(

You need to log in before you can comment on or make changes to this bug.