[PATCH] containmentlayoutmanager: don't enter edit mode without activefocus
authorChristoph Wolk <cwo.kde@posteo.net>
Tue, 3 Jun 2025 21:04:21 +0000 (21:04 +0000)
committerAurélien COUDERC <coucouf@debian.org>
Mon, 21 Jul 2025 16:21:10 +0000 (18:21 +0200)
commitea12da55c7fa101ba6029c4723e2c03d44be5f48
tree3e03ad7aad076ae47a7f973c1f3e70f52c1adda4
parent16e4edb8c10d3a031b344e3330d24646a0068d26
[PATCH] containmentlayoutmanager: don't enter edit mode without activefocus

ItemContainer enters edit mode on pressAndHold for desktop widgets not
set to immutable. This causes a problem with menus that open on press -
the container will not receive further mouse events that now go to the
menu, so it still considers itself pressed and unmoved the whole time,
and goes into edit mode after a while, exiting the menu. This makes
on-press menus in desktop widgets borderline unusable, and even if the
user manages to be quick enough to activate the desired entry during the
pressAndHold duration, it'll still enter edit mode unless the user also
does a full click on the applet afterward.

We can circumvent this particular case relatively easily by listening to
the container's activefocus changes - the popup opening does not cause
a focusOut event, but it does take activeFocus away from the container,
so if we stop the timer in that case, it works out as it should.

CCBUG: 416909

(cherry picked from commit 3d9dd7fe1a664b6b4f20523d6c4425eb57dc6b4c)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>
Gbp-Pq: Name upstream_8e6b79da_containmentlayoutmanager-don-t-enter-edit-mode-without-activefocus.patch
components/containmentlayoutmanager/itemcontainer.cpp