https://bugs.kde.org/show_bug.cgi?id=502740
Bug ID: 502740 Summary: KStatusNotifierItem has no associated window when initializing in parent constructor because no native window exists Classification: Frameworks and Libraries Product: frameworks-kstatusnotifieritem Version: 6.12.0 Platform: Arch Linux OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: general Assignee: alexander.loh...@gmx.de Reporter: mahas...@gmail.com Target Milestone: --- SUMMARY When a KStatusNotifierItem is constructed e.g. from the main-window constructor, passing the main window as parent, the expected behavior of showing/hiding the main window on activation no longer works. This is because at this point no native window has been created yet, i.e. windowHandle() returns nullptr. Therefore the KStatusNotifierItem doesn't get any associated window. This is a regression and likely has to do with the changes of using associatedWindow instead of associatedWidget, but possibly also to later changes in QMainWindow or KMainWindow behavior. Possible workarounds include calling show() or setVisible(true) from the main-window c'tor before creating the KStatusNotifierItem or deferring creation until after the window becomes visible. However, I feel that these are rather clumsy (especially for applications that should start minimized to the system tray) and the issue really should be handled correctly by KStatusNotifierItem itself. STEPS TO REPRODUCE 1. Construct KStatusNotifierItem in main-window c'tor, passing main window as parent 2. Click on notifier item in system tray OBSERVED RESULT Nothing happens EXPECTED RESULT Main window should show/hide SOFTWARE/OS VERSIONS Linux: 6.12.21-1-lts KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.12.0 Qt Version: 6.9.0 ADDITIONAL INFORMATION This also happens on another system with Frameworks 6.12.0 and Qt 6.8.3, so it probably isn't related to any recent changes in Qt. -- You are receiving this mail because: You are watching all bug changes.