Bug 426760

Summary: GlobalDrawer fails to appear when resized from a narrow width if hidden
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Bharadwaj Raju <bharadwaj.raju777>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED NOT A BUG    
Severity: normal CC: bharadwaj.raju777
Priority: NOR    
Version First Reported In: 5.74.0   
Target Milestone: Not decided   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screen recording showing the problem

Description Bharadwaj Raju 2020-09-20 05:07:14 UTC
Created attachment 131794 [details]
Screen recording showing the problem

SUMMARY
When GlobalDrawer is used, and the window is resized to a narrow width and the drawer is hidden, subsequent resizing to a wide width will cause it to disappear entirely.

A screen recording which explains this better is attached.


STEPS TO REPRODUCE
1. Use GlobalDrawer, with the modal and handleVisible properties both set to !root.widescreen (code attached)
2. Resize the window to a narrow width, such that the drawer hide button appears
3. Hide the drawer so it collapses into the button
4. Resize the window back to a wide width

OBSERVED RESULT
The drawer disappears entirely. The only way of getting it back is to resize to a narrow width again.

EXPECTED RESULT
The drawer restores to its full size.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0 (package kirigami2-5.74.0-1-x86_64)
Qt Version: 5.15.1

MINIMAL CODE EXAMPLE

import QtQuick.Layouts 1.1
import org.kde.kirigami 2.0 as Kirigami

Kirigami.ApplicationWindow {
    id: root
    visible: true
    width: 800
    height: 500

    globalDrawer: Kirigami.GlobalDrawer {
        id: drawer

        modal: !root.wideScreen
        handleVisible: !root.wideScreen

        header: Kirigami.Heading {
            level: 1
            text: "Header"
            Layout.fillWidth: true
        }
    }
}
Comment 1 Bharadwaj Raju 2020-09-25 12:02:01 UTC
Turns out this is expected behaviour. Applications should use 	onWideScreenChanged: { if (wideScreen) { drawer.open() } }

tested, works. closing.