Skip to content

Auto cleanup the dangling KWayland::Client::Surface returned from fromWindow

Xuetian Weng requested to merge work/fix-leak-surface into master

Clean up the Surface object returned from fromWindow if the internal wl_surface object is destroyed. Otherwise it will stay there until the QWindow is destroyed.

While we change the behavior of this object, it should generally be fine, because the internal wl_surface pointer won't be valid and cause crash already if the invalid wl_surface is referenced. Grepping through the existing code base in KDE also seems to be ok to make this change.

Some code is moved to a separate file due to QtWayland private API requires qt keyword, but I want to keep QT_NO_KEYWORDS on the rest of the code.

Merge request reports