Bug 482297 - Mouse marks sometimes unintentionally drawn when moving windows via shortcut
Summary: Mouse marks sometimes unintentionally drawn when moving windows via shortcut
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
: 482644 485619 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-03 12:34 UTC by Arek Guzinski
Modified: 2024-04-21 16:43 UTC (History)
4 users (show)

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


Attachments
"Mouse Mark" effect being triggered without the hotkey being pressed. (2.28 MB, video/webm)
2024-03-28 21:17 UTC, Craig Leinoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arek Guzinski 2024-03-03 12:34:16 UTC
SUMMARY
Occasionally, when I move a window to a different screen or virtual desktop using a keyboard shortcut, a red line (mouse mark) is drawn from a position where the mouse cursor recently rested to it's current position.

The shortcuts I use have the same modifiers (Meta+Shift) that are configured for drawing a line. After changing the modifiers for mouse marks, no lines are drawn.

STEPS TO REPRODUCE
1. Activate mouse marks and set free draw modifiers to Meta + Shift
2. Set shortcut for "Window to Next Desktop" to Meta + Shift + V (or other key)
3. Focus any window
4. Move mouse somewhere
5. Stop moving mouse
6. Press the shortcut set in 2
7. If no mouse mark created yet, repeat from step 4

OBSERVED RESULT
At some point a Line is drawn

EXPECTED RESULT
No line drawn

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-21-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 15,5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 fanzhuyifan 2024-03-07 18:29:51 UTC
*** Bug 482644 has been marked as a duplicate of this bug. ***
Comment 2 Craig Leinoff 2024-03-28 21:17:02 UTC
Created attachment 167904 [details]
"Mouse Mark" effect being triggered without the hotkey being pressed.
Comment 3 Craig Leinoff 2024-03-28 21:24:43 UTC
I am not sure how exactly the KDE Bug Tracker is intended to be used when I have the same issue. (The documentation says: "Look through the Bugzilla tickets that show up in the search results. If you find one that matches, great!" but gives no further advice that I see.) However, I'll add my experience and a screen recording.

I have Mouse Mark configured with shortcuts all of which use either Shift+Meta or Shift+Meta+Ctrl. META is used in both, and ALT is not used in either.

When using my JetBrains IDE I find myself using Alt+Shift+L frequently to reformat code. Sometimes this causes a straight Mouse Mark line to suddenly appear.  I have uploaded a screen recording of this occurring.

After further testing, I see that it actually is triggered by hitting the Alt+Shift keys at exactly the same moment. Somehow a previous mouse position gets remembered and, if I do it "properly", a line will be drawn to the current position of the mouse. If I'm careful, I can draw numerous connecting line segments. I can clear them using my Meta+Shift+F11 Mouse Mark shortcut.

Again, of personal importance: It happens using keys that are not associated with the Mouse Mark Window Effect.

Operating System: EndeavourOS 
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.6.22-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 5600 XT
Comment 4 fanzhuyifan 2024-03-28 23:11:37 UTC
can reproduce following both methods described, using Meta+Shift+Letter or Alt+Shift.
Comment 5 Bug Janitor Service 2024-03-29 15:08:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5535
Comment 6 Vlad Zahorodnii 2024-04-02 09:05:34 UTC
Git commit 5272c243016d6a6abd38e63004c212f3f61897c6 by Vlad Zahorodnii, on behalf of Yifan Zhu.
Committed on 02/04/2024 at 08:52.
Pushed by vladz into branch 'master'.

plugins/mousemark: clear drawing when no modifiers are pressed

Previously when drawing has length 1, it is not cleared. So the
remaining point in drawing can connect with the new point when the user
represses the modifiers, leading to a unexpected mark.

This ammends commit 46807b1a72f1d760b52b92a574face4a7a509a39.

M  +1    -1    src/plugins/mousemark/mousemark.cpp

https://invent.kde.org/plasma/kwin/-/commit/5272c243016d6a6abd38e63004c212f3f61897c6
Comment 7 Vlad Zahorodnii 2024-04-02 10:12:47 UTC
Git commit f53c62494aa132c68a7ebd534a14a05fb44e8524 by Vlad Zahorodnii, on behalf of Yifan Zhu.
Committed on 02/04/2024 at 09:06.
Pushed by vladz into branch 'Plasma/6.0'.

plugins/mousemark: clear drawing when no modifiers are pressed

Previously when drawing has length 1, it is not cleared. So the
remaining point in drawing can connect with the new point when the user
represses the modifiers, leading to a unexpected mark.

This ammends commit 46807b1a72f1d760b52b92a574face4a7a509a39.
(cherry picked from commit 5272c243016d6a6abd38e63004c212f3f61897c6)

M  +1    -1    src/plugins/mousemark/mousemark.cpp

https://invent.kde.org/plasma/kwin/-/commit/f53c62494aa132c68a7ebd534a14a05fb44e8524
Comment 8 fanzhuyifan 2024-04-21 16:43:23 UTC
*** Bug 485619 has been marked as a duplicate of this bug. ***