Surface::fromWindow are shared! By deleting the Surface pointer copies in
other areas are getting deleted as well. This breaks e.g. KWin in various
ways.
This fixes a regression introduced with d4940fe692c7be10025bfcb6a118c2cb750039d6
mart | |
davidedmundson |
Plasma |
Surface::fromWindow are shared! By deleting the Surface pointer copies in
other areas are getting deleted as well. This breaks e.g. KWin in various
ways.
This fixes a regression introduced with d4940fe692c7be10025bfcb6a118c2cb750039d6
KWin's user action menu can be opened twice again.
No Linters Available |
No Unit Test Coverage |
Whilst this does make sense based on the current design we are effectively building up dead objects during the lifespan of a window doing show/hide/show.
Someone somewhere should delete it. Assuming everyone follows the same design pattern of following QWindow::hideEvent everyone calling deleteLater() would be safe, but it relies on all parties dealing with surfaces to do that.
Well it was designed when Qt didn't behave like that :-(
Someone somewhere should delete it. Assuming everyone follows the same design pattern of following QWindow::hideEvent everyone calling deleteLater() would be safe, but it relies on all parties dealing with surfaces to do that.
No it wouldn't, because KWin doesn't behave like Qt. KWin does not delete a surface when a window gets hidden, but reuses it. Basically KWin behaves exactly as Qt used to, the pattern was taken from QtWayland. Now this diverged.
A possibility could be QSharedPointer, so that every user can discard it's own instance, but that requires also changes all over the place.