Expected behaviour 1. Single click on background window: raise it 2. Drag on icon in background window: just highlight icon and start dragging, no raise Actual behaviour: There are settings in System Settings → Window Management → Window Actions. There you can set the left click from "Activate, raise and forward click" to "Activate and forward click" and some others but none of them satisfies both expected cases at the same time, because the entire click (mouse down + mouse up) is considered. With the default "Activate, raise and forward click" when you start dragging the item in the background window the background window raises and if it covers the entire previously foreground window we lose the drag target window from sight since it goes into background. If "Activate and forward click" setting (without raise) is selected then if you only click on the window in the background it does not raise and you have to click the second time to raise it.
This is actually a well known (and very old) pattern that is used on both Macs and Win machines. My understanding is that there is a setting to control this behavior but there are two issues: 1. It's off by default 2. Even on, it's not quite implemented right If fixed, having this on has zero negative effects so I'd argue, it should be on by default As it's currently implemented, turning this on requires 2 clicks to raise the background window which is a missed opportunity as it's not required. A much simpler flow is: 1. There are two windows, a background SOURCE window and a foreground TARGET window 2. MouseDown in SOURCE highlights the icon and starts a drag, SOURCE is NOT raised. 3. If the user does a MouseUp at this point, SOURCE raises (and the icon is still selected) 4. If instead the user starts to drag to TARGET and release, SOURCE still does not raise This handles all cases of raising: click still raises a window but dragging a background window is still possible without raising. Better UX overall and no setting needed.
https://invent.kde.org/plasma/kwin/-/merge_requests/6555 implements this
Git commit 5f85280563cc44988c083737acfd7fdc0d607721 by Xaver Hugl. Committed on 25/10/2024 at 13:35. Pushed by zamundaaa into branch 'master'. window: add new inactive mouse action, and make it the default This new option - activates on click - passes clicks - raises only on release This way, if a user starts a drag on a window lower in the stacking order, it does not get raised above other windows immediately, which makes drag and drop less annoying to deal with M +1 -0 autotests/integration/CMakeLists.txt A +126 -0 autotests/integration/mouseactions_test.cpp [License: GPL(v2.0+)] M +6 -6 autotests/integration/x11_window_test.cpp M +4 -4 autotests/integration/xdgshellwindow_test.cpp M +6 -6 src/events.cpp M +46 -20 src/input.cpp M +5 -0 src/kcms/options/actions.ui M +2 -1 src/kcms/options/kwinoptions_settings.kcfg M +2 -2 src/kwin.kcfg M +4 -1 src/options.cpp M +3 -2 src/options.h M +6 -6 src/useractions.cpp M +38 -5 src/window.cpp M +4 -2 src/window.h M +2 -2 src/xdgshellwindow.cpp https://invent.kde.org/plasma/kwin/-/commit/5f85280563cc44988c083737acfd7fdc0d607721