File: upstream_635ea80c_Folder-View-Don-t-show-wrong-context-menu-when-left-and-right-clicking.patch

package info (click to toggle)
plasma-desktop 4%3A6.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 61,044 kB
  • sloc: cpp: 37,691; ansic: 2,617; python: 1,386; javascript: 1,163; xml: 1,082; sh: 128; makefile: 16
file content (43 lines) | stat: -rw-r--r-- 1,704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 635ea80c8f1da2d6e16dda469edde63b2c0ff1b8 Mon Sep 17 00:00:00 2001
From: Nate Graham <nate@kde.org>
Date: Sun, 13 Apr 2025 11:29:32 -0600
Subject: [PATCH] Folder View: Don't show wrong context menu when
 left-and-right-clicking

On devices with physical left and right buttons, it's possible to
right-click while holding down the left button. When doing this on the
desktop, you get the wrong context menu, because Folder View code was
inappropriately handling the event rather than falling back to the
desktop context menu plugin.

To fix this, explicitly handle that case and don't accept the event,
allowing it to fall back properly.

BUG: 501856
FIXED-IN: 6.4.0
---
 containments/desktop/package/contents/ui/FolderView.qml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml
index 0631d182e3..6aa79d6871 100644
--- a/containments/desktop/package/contents/ui/FolderView.qml
+++ b/containments/desktop/package/contents/ui/FolderView.qml
@@ -321,8 +321,12 @@ FocusScope {
 
                 if (mouse.buttons & Qt.RightButton) {
                     clearPressState();
-                    dir.openContextMenu(main, mouse.modifiers);
-                    mouse.accepted = true;
+
+                    // If it's the desktop, fall through to the desktop context menu plugin
+                    if (!dir.usedByContainment) {
+                        dir.openContextMenu(main, mouse.modifiers);
+                        mouse.accepted = true;
+                    }
                 }
             } else {
                 pressedItem = hoveredItem;
-- 
GitLab