elementary / elementary/applications-menu
DnD an app icon causes the entire wingpanel crashes
- Dominant language
- Vala
- Stars
- 103
- Forks
- 40
- Avg merge
- 32m
- Merged PRs (30d)
- 2
Description
### What Happened?
Regression of GTK 4 porting.
Originally reported at https://github.com/elementary/applications-menu/pull/710#issue-5101257054.
Better to watch the screencast:
https://github.com/user-attachments/assets/d536c548-b7ef-47be-9aad-c4e762638461
---
I suspect this is because the popover (display widget) of Applications Menu would be freed before DnD finishes and would be causing null pointer access, because it gets unparented by PopoverManager of Wingpanel itself when the popover is requested to be closed[^1]. And Application Menu surely requests to close the popover when starting DnD[^2][^3].
I confirmed commenting out the above `popover.unparent ();` in Wingpanel resolves this issue but we need to unparent the popover anyways at some point, right? So probably we might want to keep the popover open while DnD.
[^1]: https://github.com/elementary/wingpanel/blob/acf9a51a8d1de4e136bd72c523099ef650856d84/src/Services/PopoverManager.vala#L76
[^2]: https://github.com/elementary/applications-menu/blob/320297fb25ab8aa60d768eee10a5531ca495308d/src/Widgets/AppButton.vala#L118-L130
[^3]: https://github.com/elementary/applications-menu/blob/320297fb25ab8aa60d768eee10a5531ca495308d/src/Views/GridView.vala#L86
### Steps to Reproduce
1. Open Applications Menu
2. Try dragging an app icon
3. See the entire Wingpanel crashes (and restarts by Gala)
### Expected Behavior
DnD an app icon should not cause the entire wingpanel crashes.
### OS Version
Early Access
### OS Architecture
amd64 (on most hardwares)
### Session Type
Secure Session (Wayland, This is the default)
### Software Version
Early Access or Compiled from git
### Log Output
```shell
```
### Hardware Info
_No response_
Contributor guide
Research direction
First reproduce the crash by dragging an app icon from Applications Menu, then read src/Widgets/AppButton.vala, src/Views/GridView.vala, and Wingpanel's src/Services/PopoverManager.vala at the referenced locations. Trace the popover lifecycle during drag-and-drop and verify that dragging an icon no longer crashes Wingpanel while the popover is closed or unparented.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100