Bug 484429 - Applet not expanding under system tray when preferredRepresentation set.
Summary: Applet not expanding under system tray when preferredRepresentation set.
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-25 04:05 UTC by dhruv8sh
Modified: 2024-08-27 23:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dhruv8sh 2024-03-25 04:05:03 UTC
SUMMARY
For applets which have a set 'preferredRepresentation' property in main.qml do not expand on click in the system tray.
Contrasting to the behavior, they expand when outside the tray or the property is undefined.

STEPS TO REPRODUCE
1. Create a test applet.
2. In main.qml make sure to use preferredRepresentation property and set it to compactRepresentation/fullRepresentation.
3. Install and notice that applet refuses to expand only when in system tray.

STEPS TO REPRODUCE (Alternative)
1. Copy any applet from /usr/share/plasma/plasmoids/
2. Paste it in some other folder.
3. Open metadata.json, change id and name.
4. Set preferredRepresentation property in main.qml.
5. Install and notice the applet does not expand in the tray.

OBSERVED RESULT
Applet does not expand in the system tray.

EXPECTED RESULT
Applet should expand irrespective of this property.

SOFTWARE/OS VERSIONS
Linux: Arch Linux 6.8.1-arch1-1 (64-bit)
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Comment 1 Nate Graham 2024-08-18 23:19:15 UTC
If you can still reproduce this in Plasma 6.1.4, can you attach your test widget? System-default widgets don't exhibit this, so I suspect the code is slightly wrong in some subtle way, but let's find out.
Comment 2 Nate Graham 2024-08-18 23:34:40 UTC
Specifically, what are you setting the preferredRepresentation property to? I suspect the `compactRepresentation` value indeed it simply incompatible with being in the system tray's expanded view.
Comment 3 dhruv8sh 2024-08-19 01:40:43 UTC
(In reply to Nate Graham)
> System-default widgets don't exhibit this
To test this, I went ahead and added the preferredRepresentation value to the org.kde.plasma.battery applet.
The issue is definitely reproducible.

> Specifically, what are you setting the preferredRepresentation property to?
Setting it to either value breaks this functionality.

Users of my applet were reporting this but it was not reproducible for me. Maybe it had to do something with the KF5 stuff that I had installed.
After a reinstall of Arch, the issue persisted for me as well.
Comment 4 Nate Graham 2024-08-27 23:21:57 UTC
Ultimately I think this is a case of developer/user error. The purpose of this property is to force the applet to always show a particular representation. In the System Tray this only makes sense for applets implemented as a simple on/off toggle for something, with no expanded view, such as Input Method or Keyboard Layout. For something like Battery Monitor, it doesn't make sense.