Bug 488571 - Showing panel settings dialog while widget explorer is already open does the wrong thing
Summary: Showing panel settings dialog while widget explorer is already open does the ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: master
Platform: Neon Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2024-06-16 09:35 UTC by cwo
Modified: 2024-06-24 19:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cwo 2024-06-16 09:35:18 UTC
SUMMARY

There is a weird inconsistency in the behavior of the "Show Panel Configuration" context menu action on a panel while the "Add a Widget" interface for that panel is open. Sometimes it shows both the 'Add widget' interface and the Panel Configuration mode, sometimes it closes the add widget mode and the globally active edit mode. 

The behavior is also different if the Desktop "Add Widget" interface (visually indistinguishable from the panel "Add Widget" interface) is open. This could potentially be intentional (they generally behave differently), but it is rather confusing. 

I'll provide replication steps for the major inconsistencies I found


STEPS TO REPRODUCE

Variant A

1. Right-click a panel, "Add widgets..."
2. Right-click the same panel, "Show Panel Configuration"

Variant B

1. Right-click a panel, "Add widgets..."
2. Click a widget (for simplicity, I'll use Analog Clock)
3. Right-click the same panel, "Show Panel Configuration"

Variant C

1. Right-click a panel, "Add widgets..."
2. Drag Analog Clock to the panel
3. Right-click the same panel, "Show Panel Configuration"

Variant D

1.Enter Edit mode through the Desktop context menu
2. Click "Add widgets..." in Edit Mode
3. Right-click a panel, "Show Panel Configuration"

Variant E 

1.Enter Edit mode through the Desktop context menu
2. Click "Add widgets..." in Edit Mode
3. Drag Analog Clock to a panel
4. Right-click a panel, "Show Panel Configuration"

OBSERVED RESULT

Variant A: Add Widget interface closes, Panel Configuration does not open
Variant B: Add Widget interface closes, Panel Configuration does not open
Variant C: Add Widget interface remains open, Panel Configuration opens
Variant D: Add Widget interface closes, Panel Configuration opens
Variant E: Add Widget interface remains open, Panel Configuration opens (Note that adding widgets to the desktop after adding widgets to the desktop in between does not seem to affect this - as soon as one widget was added to the panel, the Add Widget interface remains open)  

EXPECTED RESULT

Contra Variant A and B, the Panel Configuration should always show if the user clicks "Show Panel Configuration". This is (to me) clearly a bug.

Variant A, B, and C should probably have the same result.

I think the correct result for A, B, and C is to show both (as variant C does) - if a user opens both the Panel Configuration and the Add Widgets interfaces, the goal is likely to add several applets and position them, and closing one interface means having to open them again over and over. But see bug #487546 for the contrary argument

Variant D and E likely should behave the same way (to each other), and potentially behave the same way as Variant A-C. I'm not quite confident on this; there may be particular usage patterns where a different behavior might make sense, but this does not seem transparent.  

SOFTWARE/OS VERSIONS

Current Neon DevE.

Linux: 6.5.0-35-generic 
KDE Plasma Version: 6.1.80
KDE Frameworks Version:  6.4.0
Qt Version: 6.7.0
Comment 1 Nate Graham 2024-06-17 18:35:14 UTC
Can confirm all weird variants. The common denominator seems to be showing the panel configuration dialog while the widget explorer sidebar is already open
Comment 2 cwo 2024-06-17 20:45:44 UTC
Another slightly different case; I'll put it here as it seems somewhat similar:

STEPS TO REPRODUCE

1. Right click the panel, click "Add Widgets..."
2. Take a screenshot by pressing the PrintScreen key. (Launching spectacle from the menu and taking a screenshot with delay also triggers the issue).

OBSERVED RESULT

Spectacle appears and is hidden, Widget Explorer closes, Panel Configuration mode launches for some reason (???)

EXPECTED RESULT

Panel Configuration mode should not launch.

(I'm not quite sure what the correct behavior for the other parts should be; both keeping Widget Explorer open/hiding Spectacle and closing Widget Explorer/showing Spectacle seem defensible. If you do this with the Desktop Widget Explorer open (i.e. through right click on the desktop, Open Edit Mode, Add Widgets... Button), the current result is that Spectacle opens and Widget Explorer closes, and I do think both should behave the same way.

And for good measure:

1. Right click the desktop, "Enter Edit Mode", click "Add Widgets".
2. Drag&Drop Analog Clock to a panel
3. Take a screenshot.

This way, both spectacle and Widget Explorer are visible at the same time; instead *Edit Mode* closes (with Widget Explorer still active). If you take another screenshot, however, Widget Explorer closes again.
Comment 3 Bug Janitor Service 2024-06-21 09:05:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2329
Comment 4 Bug Janitor Service 2024-06-24 10:26:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2336
Comment 5 Nate Graham 2024-06-24 18:54:20 UTC
Git commit 01b62897061e1d29538d6e76bbe1665f916c4d0e by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 24/06/2024 at 18:54.
Pushed by ngraham into branch 'master'.

Do not hide panel edit mode dialog when Widget Explorer is closed

If you:
1. Right click on the panel and click Add widgets
2. Click on the panel to enter panel edit mode

Then your click would enter panel edit mode, but the Widget Explorer
would send another "configure" event to the panel, which would then
close panel edit mode, which would close panel edit mode entirely. We
need to make sure that closing the Widget Explorer will never also
close the panel edit mode.

M  +3    -1    desktoppackage/contents/views/Desktop.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/01b62897061e1d29538d6e76bbe1665f916c4d0e
Comment 6 Nate Graham 2024-06-24 19:00:29 UTC
Git commit 2206aa80565e7112a96771d52729a85b8d4f1a84 by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 24/06/2024 at 19:00.
Pushed by ngraham into branch 'master'.

Widget Explorer: ask for focus after drag and drop

Since the Widget Explorer only closes when it loses focus, but
there's an exception during a drag and drop, it might get stuck
open. Immediately reclaiming focus will make sure it closes.

Example to test with:

- Right click on a panel, click "add widgets"
- open panel edit mode
- sidebar closes!

But:

- Right click on a panel, click "add widgets"
- drag and drop a widget to the panel
- open panel edit mode
- sidebar does not close :-(

With this MR it closes.
FIXED-IN: 6.1.1

M  +11   -0    desktoppackage/contents/explorer/WidgetExplorer.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/2206aa80565e7112a96771d52729a85b8d4f1a84
Comment 7 Nate Graham 2024-06-24 19:01:40 UTC
Git commit 6b7a54ba8434e0872c5b7a045a6ae4f7847e1f22 by Nate Graham.
Committed on 24/06/2024 at 19:01.
Pushed by ngraham into branch 'Plasma/6.1'.

Widget Explorer: ask for focus after drag and drop

Since the Widget Explorer only closes when it loses focus, but
there's an exception during a drag and drop, it might get stuck
open. Immediately reclaiming focus will make sure it closes.

Example to test with:

- Right click on a panel, click "add widgets"
- open panel edit mode
- sidebar closes!

But:

- Right click on a panel, click "add widgets"
- drag and drop a widget to the panel
- open panel edit mode
- sidebar does not close :-(

With this MR it closes.
FIXED-IN: 6.1.1


(cherry picked from commit 2206aa80565e7112a96771d52729a85b8d4f1a84)

eb778401 Make add widgets sidebar ask for focus after drag and drop

Co-authored-by: Niccolò Venerandi <niccolo@venerandi.com>

M  +11   -0    desktoppackage/contents/explorer/WidgetExplorer.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/6b7a54ba8434e0872c5b7a045a6ae4f7847e1f22
Comment 8 Nate Graham 2024-06-24 19:06:57 UTC
Git commit 9cc78130ca833bac58b3039ef65f2236679349fa by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 24/06/2024 at 19:05.
Pushed by ngraham into branch 'Plasma/6.1'.

Do not hide panel edit mode dialog when Widget Explorer is closed

If you:
1. Right click on the panel and click Add widgets
2. Click on the panel to enter panel edit mode

Then your click would enter panel edit mode, but the Widget Explorer
would send another "configure" event to the panel, which would then
close panel edit mode, which would close panel edit mode entirely. We
need to make sure that closing the Widget Explorer will never also
close the panel edit mode.
(cherry picked from commit 01b62897061e1d29538d6e76bbe1665f916c4d0e)

M  +3    -1    desktoppackage/contents/views/Desktop.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/9cc78130ca833bac58b3039ef65f2236679349fa