GNOME Bugzilla – Bug 735226
Avoid NULL surface access if a window is shown/hidden within a frame
Last modified: 2014-09-01 20:46:30 UTC
When investigating bug #734374, I've sometimes seen crashes when triggering the xdg_popup misbehaviors on touch. Those seem to be due to the popup window being shown and hidden through popup_done whithin a single frame, so the window GdkFrameClock gets to be started, but impl->surface is already NULL at the time after_paint() is called. I'm attaching a patch to add a check for the window being mapped at that time, in order to avoid NULL access.
Created attachment 284219 [details] [review] wayland: Avoid NULL surface access if the window is shown/hidden within a clock frame In these cases the frame is already scheduled, but impl->surface is already NULL at the time on_frame_clock_after_paint() is called.
wouldn't it be more correct to unset pending_commit when hiding the window ?
Created attachment 285049 [details] [review] wayland: Unset window_impl->commit_pending when hiding the surface A surface may be hidden when a frame is already scheduled, which may cause crashes on on_frame_clock_after_paint() when calling commit() on a NULL surface. To fix this, ensure commit_pending is also set to FALSE when the surface is gone.
Review of attachment 285049 [details] [review]: ok
Attachment 285049 [details] pushed as 7fbac57 - wayland: Unset window_impl->commit_pending when hiding the surface