https://bugs.kde.org/show_bug.cgi?id=508488

Tomasz <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Tomasz <[email protected]> ---
Still reproducible with Spectacle 6.8.0 (Arch Linux, Plasma 6.8.0, KF 6.31.0,
Qt 6.12.0, Wayland).

I looked at the source (v6.8.0, and master still has the same code) and I
believe I found the cause:

1. The "New Screenshot" menu in the viewer window is implemented in
src/Gui/ScreenshotModeMenu.cpp. Its action handler only calls:

       SpectacleCore::instance()->takeNewScreenshot(mode);

   It never calls Settings::setCaptureMode(mode), so the chosen mode is not
remembered.

2. There is a QML version of this menu, src/Gui/SceenshotModeMenu.qml (note the
typo in the filename), which does set "Settings.captureMode =
model.captureMode", but it does not seem to be used anywhere anymore -
ViewerPage.qml and CaptureOverlay.qml use ScreenshotModeMenuButton, which pops
up the C++ ScreenshotModeMenu.

3. The only place that still updates Settings.captureMode is
CaptureModeButtonsColumn.qml, so the setting only works when using those
buttons.

As a result, with launchAction=UseLastUsedCapturemode, GuiConfig/captureMode is
never written to spectaclerc (it stays at the default, AllScreens), and every
launch captures all screens - in my case all 8 monitors.

A likely fix is to set the capture mode in the ScreenshotModeMenu.cpp handler,
e.g.:

       auto onTriggered = [mode] {
           Settings::setCaptureMode(mode);
           SpectacleCore::instance()->takeNewScreenshot(mode);
       };

The orphaned SceenshotModeMenu.qml could probably be removed.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to