shell icon indicating copy to clipboard operation
shell copied to clipboard

Multimonitor screenshot broken

Open dalpax opened this issue 1 year ago • 2 comments

Only screenshots on monitor 1 even if the region shaded is on monitor 2.

This did not happen in the old implementation, just the new one with the square in the middle.

dalpax avatar Jun 21 '25 05:06 dalpax

Could you see if this patch fixes it please? I do not have multiple monitors so I can't test this myself.

diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml
index 256085d..31aec02 100644
--- a/modules/areapicker/Picker.qml
+++ b/modules/areapicker/Picker.qml
@@ -77,7 +77,7 @@ MouseArea {
         if (closeAnim.running)
             return;
 
-        Quickshell.execDetached(["sh", "-c", `grim -l 0 -g '${Math.ceil(rsx)},${Math.ceil(rsy)} ${Math.floor(sw)}x${Math.floor(sh)}' - | swappy -f -`]);
+        Quickshell.execDetached(["sh", "-c", `grim -l 0 -g '${screen.x + Math.ceil(rsx)},${screen.y + Math.ceil(rsy)} ${Math.floor(sw)}x${Math.floor(sh)}' - | swappy -f -`]);
         closeAnim.start();
     }
 

soramanew avatar Jun 21 '25 13:06 soramanew

#127 close when merged

dalpax avatar Jun 21 '25 19:06 dalpax