Bug 465524 - Window title filename template (%T) doesn't work on wayland
Summary: Window title filename template (%T) doesn't work on wayland
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: git-master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2023-02-09 23:19 UTC by Noah Davis
Modified: 2023-03-21 13:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noah Davis 2023-02-09 23:19:37 UTC
SUMMARY
Spectacle's `ExportManager` class needs to get a window title from its `Platform` abstract class via a connection to the `Platform::windowTitleChanged(const QString &)` signal in order to generate a screenshot filename with a window title in it. However, Platform's subclasses for Wayland don't emit `windowTitleChanged()` since they can't get a window title for the picked window. Thus, you can't generate a filename with a window title in it on Wayland.

STEPS TO REPRODUCE
1. Open a wayland kwin/plasma session
2. Open Spectacle
3. Open settings dialog by clicking the "Configure..." button
4. Go to the Save page
5. Set text field with "Filename" label to "%T_%Y%M%D_%H%m%S", Click OK
6. Do a Window Under Cursor screenshot on Firefox's new tab page
7. Click Save

OBSERVED RESULT
Filename is "Spectacle_20230209_175949.png", where the date and time can vary as they should.

EXPECTED RESULT
Filename should be the title of the Firefox window, plus the date and time, like "Mozilla Firefox_20230209_175949.png"

SOFTWARE/OS VERSIONS
Spectacle: git master a3c04c69a390fa53a29c6fde1e0c9b2fecfe150b
Comment 1 Noah Davis 2023-03-21 13:04:17 UTC
Git commit 874d6c29cbe0f1d6217e7a4c57b454955c4611da by Noah Davis.
Committed on 21/03/2023 at 12:58.
Pushed by ndavis into branch 'master'.

Fix window title file name template on wayland

This depends on https://invent.kde.org/plasma/kwin/-/merge_requests/3835

M  +24   -0    src/Platforms/PlatformKWinWayland2.cpp

https://invent.kde.org/graphics/spectacle/commit/874d6c29cbe0f1d6217e7a4c57b454955c4611da
Comment 2 Noah Davis 2023-03-21 13:09:02 UTC
Git commit 276c6510073a6c86b7733b109b5953053502175f by Noah Davis.
Committed on 21/03/2023 at 13:08.
Pushed by ndavis into branch 'release/23.04'.

Fix window title file name template on wayland

This depends on https://invent.kde.org/plasma/kwin/-/merge_requests/3835


(cherry picked from commit 874d6c29cbe0f1d6217e7a4c57b454955c4611da)

M  +24   -0    src/Platforms/PlatformKWinWayland2.cpp

https://invent.kde.org/graphics/spectacle/commit/276c6510073a6c86b7733b109b5953053502175f