Closed Bug 2022183 Opened 8 months ago Closed 6 months ago

[Wayland] Implement xx-session-management-v1

Categories

(Core :: Widget: Gtk, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 4 external files, 2 obsolete files)

We may implement xx_ variant of the protocol as it's seems to be available in KDE/Mutter.

Flags: needinfo?(stransky)
Priority: -- → P3

There is now an official xdg- variant decided upon and ACKed by KDE, GNOME and Chromium (and I guess implemented in those soon), see https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/18#note_3375004

Cool. But we need to have them available in compositors to implement it. AFAIK Mutter 50 doesn't ship that yet, right?

No idea about Mutter, I followed that from the KDE side (as a user eager to have session restore supported under Wayland so I can finally switch to that), and the kwin bug https://bugs.kde.org/show_bug.cgi?id=436318 (which is hard to follow as it's tons of me-too messages) just mentioned the protocol link above and the kwin merge request at https://invent.kde.org/plasma/kwin/-/merge_requests/8985 which should make this available in Plasma 6.7 (expected in June). I hope Mutter is similarly quick to support this.

Okay. The xx- variant is mentioned here as it may be available now.

The patch here depends on custom tweak gdk_wayland_window_get_xdg_toplevel(). I'll investigate how it works.

xx- protocol variant

The main problem here is to get workspace/window ID before the toplevel is mapped. Looks like other platforms rather move window to workspace after it's shown and that's different on Wayland. I guess we have some options here:

  1. Postpone window shown after nsWindowWayland::MoveToWorkspace() call. That may be tricky as the nsWindowWayland::MoveToWorkspace() may not come (for new windows? If restore data is missing?)
  2. Get WorkspaceID somehow on our own before window map or add extra window flag which will be stored/saved?

We can postpone the window show after restore but that needs fiddle with vsync - to fire painting events before the windows is shown to kick off rendering pipeline.

Another issue is that xdg_toplevel has to be added to restore state before first commit to wl_surface (wtf???). So we'd need to use a kind of gtk3 callback here.

Attached file working gtk3 patch —

We need to put something like this to gtk3 to get xdg_toplevel before is committed.

Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: NEW → ASSIGNED

Realized that it also needs VSync update to fire rendering when we're waiting to session restore.

Flags: needinfo?(stransky)
Attachment #9571041 - Attachment is obsolete: true
Attachment #9571025 - Attachment is obsolete: true
Flags: needinfo?(stransky)

Bug 2000840 may be continue of this one - we'd need to run sw vsync before first paint.

Depends on: 2000840
Pushed by csabou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b4aca26df8ee https://hg.mozilla.org/integration/autoland/rev/7aa44f4e4aa4 Revert "Bug 2022183: apply code formatting via Lando" for causing build bustages on nsWindowWayland

Backed out for causing build bustages on nsWindowWayland

Push with failures

Failure log

Backout link

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
QA Whiteboard: [qa-triage-done-c153/b152]
Blocks: 2044701
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: