<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>386271</bug_id>
          
          <creation_ts>2017-10-27 22:27:42 +0000</creation_ts>
          <short_desc>[Wayland] Implement &quot;Active window&quot; mode in the KWin screenshot plugin</short_desc>
          <delta_ts>2022-04-05 21:19:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>general</component>
          <version>git master</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=452309</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>usability, wayland-only</keywords>
          <priority>HI</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Silva">bugseforuns</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>alexander.reimelt</cc>
    
    <cc>andrea.ippo</cc>
    
    <cc>indecisiveautomator</cc>
    
    <cc>jm.ouwerkerk</cc>
    
    <cc>m.weghorn</cc>
    
    <cc>meven29</cc>
    
    <cc>mspehar</cc>
    
    <cc>nate</cc>
    
    <cc>null</cc>
    
    <cc>xpamych</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/spectacle/commit/9db9ace43a386e07df15a8d3fd28a343c83e6d66</cf_commitlink>
          <cf_versionfixedin>Spectacle 21.12 with Plasma 5.24</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1708574</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2017-10-27 22:27:42 +0000</bug_when>
    <thetext>neon dev unstable
Nothing happens when meta+print shortcut is pressed under Wayland.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1708582</commentid>
    <comment_count>1</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2017-10-28 01:12:51 +0000</bug_when>
    <thetext>Does Active Window mode also not work when invoked from the app&apos;s main window, or is this just a case of the keyboard shortcut not doing what it&apos;s supposed to?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1708583</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2017-10-28 01:29:16 +0000</bug_when>
    <thetext>Also It does not work when I open spectacle from apps menu, select &quot;Active window&quot; in &quot;Area&quot; drop down, set delay and click &quot;take a new screenshot&quot;.
Spectacle takes an empty &quot;screenshot&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1708584</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2017-10-28 01:34:18 +0000</bug_when>
    <thetext>Thanks for the info!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1724293</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2018-01-23 13:10:38 +0000</bug_when>
    <thetext>same problem with spectacle 17.12.1 + plasma 5.12 beta on Arch Linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1737343</commentid>
    <comment_count>5</comment_count>
    <who name="">jm.ouwerkerk</who>
    <bug_when>2018-03-11 21:39:32 +0000</bug_when>
    <thetext>Note that by contrast &quot;window under cursor&quot; mode does work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743390</commentid>
    <comment_count>6</comment_count>
    <who name="Andrius Štikonas">andrius</who>
    <bug_when>2018-04-05 19:13:52 +0000</bug_when>
    <thetext>*** Bug 392585 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1753499</commentid>
    <comment_count>7</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2018-05-18 21:49:55 +0000</bug_when>
    <thetext>same bug on Arch Linux, plasma 5.13 beta, spectacle 18.04.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1753501</commentid>
    <comment_count>8</comment_count>
    <who name="null">null</who>
    <bug_when>2018-05-18 21:52:14 +0000</bug_when>
    <thetext>&gt; same bug on Arch Linux, plasma 5.13 beta, spectacle 18.04.1.
This is now the third bug you added this message to. Please stop spamming Bugzilla, because as I&apos;ve explained to you before, we are only interested in //new// information, e.g. new steps to reproduce, or whether the bug has been solved but is still marked as open.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1820742</commentid>
    <comment_count>9</comment_count>
    <who name="Aleix Pol">aleixpol</who>
    <bug_when>2018-11-22 16:09:46 +0000</bug_when>
    <thetext>Git commit 053e903727138c30609b9cc92aeeab46101b148f by Aleix Pol.
Committed on 22/11/2018 at 16:07.
Pushed by apol into branch &apos;master&apos;.

Don&apos;t advertise on Wayland features that aren&apos;t available

Summary:
It&apos;s quite stressful and it clearly doesn&apos;t push developers to implement the features.
Related: bug 377157

Test Plan: Now I don&apos;t choose to take a screenshot of the active window and get sad when I can&apos;t.

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: hein, ngraham, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D17082

M  +3    -3    src/Gui/KSMainWindow.cpp
M  +1    -1    src/Gui/KSMainWindow.h
M  +13   -7    src/Gui/KSWidget.cpp
M  +1    -1    src/Gui/KSWidget.h
M  +1    -0    src/PlatformBackends/DummyImageGrabber.h
M  +1    -0    src/PlatformBackends/ImageGrabber.h
M  +1    -0    src/PlatformBackends/KWinWaylandImageGrabber.h
M  +1    -0    src/PlatformBackends/X11ImageGrabber.h
M  +1    -1    src/SpectacleConfig.cpp
M  +1    -1    src/SpectacleCore.cpp

https://commits.kde.org/spectacle/053e903727138c30609b9cc92aeeab46101b148f</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862209</commentid>
    <comment_count>10</comment_count>
    <who name="Boudhayan Gupta">me</who>
    <bug_when>2019-06-11 23:28:35 +0000</bug_when>
    <thetext>This is a feature that has to be implemented in KWin. Once the feature is available, it&apos;s simply a matter of invoking the right DBus call into KWin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862278</commentid>
    <comment_count>11</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2019-06-12 08:53:23 +0000</bug_when>
    <thetext>Hmm, it seems like there are several ways to take a screenshot of the active window:

* either by pressing Meta+PrtScr shortcut. This one seems to be straightforward to implement. Spectacle calls a method to take a screenshot and kwin spews pixel data to a pipe;

* or by pressing PrtScr and then selecting &quot;Active window&quot; capture mode. This one is not straightforward. Spectacle would need to ensure that its window is closed before asking kwin to take a screenshot.

Also, I wonder what security implications this feature will have.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862403</commentid>
    <comment_count>12</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2019-06-12 19:42:29 +0000</bug_when>
    <thetext>From a security perspective the best way would be KWin to handle the shortcut and launch spectacle (or any other tool) and pipe it the screenshot. The alternative would be spectacle asking and KWin showing the same user interaction pattern to click the window or some other way to have the user confirm that it wants a screenshot to be taken. From a security perspective having a call to take screenshots is terrible. That was one of the biggest security issues on X11 (it allowed e.g. to take over a browser instance).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1997273</commentid>
    <comment_count>13</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2021-01-24 16:51:25 +0000</bug_when>
    <thetext>This feature is still missing from Plasma 5.21 beta. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070182</commentid>
    <comment_count>14</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-10-19 13:53:37 +0000</bug_when>
    <thetext>*** Bug 443942 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070742</commentid>
    <comment_count>15</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2021-10-20 20:10:19 +0000</bug_when>
    <thetext>*** Bug 444120 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071532</commentid>
    <comment_count>16</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2021-10-23 12:20:07 +0000</bug_when>
    <thetext>*** Bug 437782 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071554</commentid>
    <comment_count>17</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-10-23 14:48:18 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/82</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071556</commentid>
    <comment_count>18</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-10-23 14:48:20 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/82</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072924</commentid>
    <comment_count>19</comment_count>
    <who name="Méven Car">meven29</who>
    <bug_when>2021-10-28 14:55:07 +0000</bug_when>
    <thetext>In fact since we have a copy whole screen option that is slightly guarded by the key in the desktop files, KWin should allow to take ActiveWindow screenshots as well.

https://invent.kde.org/graphics/spectacle/-/merge_requests/82 could be merged in the meantime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073180</commentid>
    <comment_count>20</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-10-29 08:56:24 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1582</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073184</commentid>
    <comment_count>21</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-10-29 09:07:15 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/90</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073211</commentid>
    <comment_count>22</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2021-10-29 12:07:04 +0000</bug_when>
    <thetext>Git commit b135a1c7b09182dd48b42cc81db6e088bb561901 by Vlad Zahorodnii.
Committed on 29/10/2021 at 12:06.
Pushed by vladz into branch &apos;master&apos;.

effects/screenshot: Add org.kde.KWin.ScreenShot2.CaptureActiveWindow

M  +42   -0    src/effects/screenshot/org.kde.KWin.ScreenShot2.xml
M  +26   -0    src/effects/screenshot/screenshotdbusinterface2.cpp
M  +2    -0    src/effects/screenshot/screenshotdbusinterface2.h

https://invent.kde.org/plasma/kwin/commit/b135a1c7b09182dd48b42cc81db6e088bb561901</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073212</commentid>
    <comment_count>23</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2021-10-29 12:07:16 +0000</bug_when>
    <thetext>Git commit 9db9ace43a386e07df15a8d3fd28a343c83e6d66 by Vlad Zahorodnii.
Committed on 29/10/2021 at 09:46.
Pushed by vladz into branch &apos;master&apos;.

Add support for Active Window mode on Wayland

M  +27   -1    src/Platforms/PlatformKWinWayland2.cpp
M  +15   -0    src/Platforms/PlatformKWinWayland2.h

https://invent.kde.org/graphics/spectacle/commit/9db9ace43a386e07df15a8d3fd28a343c83e6d66</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2091844</commentid>
    <comment_count>24</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2022-01-10 20:41:28 +0000</bug_when>
    <thetext>*** Bug 448205 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>