wlserver: avoid accessing mouse_focus_surface after destruction
We should also set the focus to something else that makes sense, which means there's another bug in a higher-level layer somewhere, but at least don't crash.
This commit is contained in:
parent
a4f3a19480
commit
e25f871d87
1 changed files with 5 additions and 0 deletions
|
@ -801,6 +801,11 @@ void wlserver_surface_set_wl_id( struct wlserver_surface *surf, long id )
|
|||
|
||||
void wlserver_surface_finish( struct wlserver_surface *surf )
|
||||
{
|
||||
if ( surf->wlr == wlserver.mouse_focus_surface )
|
||||
{
|
||||
wlserver.mouse_focus_surface = nullptr;
|
||||
}
|
||||
|
||||
surf->wl_id = 0;
|
||||
surf->wlr = nullptr;
|
||||
wl_list_remove( &surf->pending_link );
|
||||
|
|
Loading…
Reference in a new issue