Skip to content

Commit

Permalink
foreign-toplevel: Fix potential crash when app-id mode is 'full' (#2541)
Browse files Browse the repository at this point in the history
This fixes a potential crash with compositor views when workarounds
option app-id-mode is set to 'full'. The crash can be caused when
attempting to use magnifier, with this option set.
  • Loading branch information
soreau authored Dec 20, 2024
1 parent 220a7a4 commit fe95df1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/protocols/foreign-toplevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ class wayfire_foreign_toplevel
} else if (app_id_mode == "full")
{
#if WF_HAS_XWAYLAND
if (wlr_xwayland_surface *xw_surface =
wlr_xwayland_surface_try_from_wlr_surface(view->get_wlr_surface()))
auto wlr_surface = view->get_wlr_surface();
if (wlr_surface)
{
ev.app_id = nonull(xw_surface->instance);
if (wlr_xwayland_surface *xw_surface =
wlr_xwayland_surface_try_from_wlr_surface(wlr_surface))
{
ev.app_id = nonull(xw_surface->instance);
}
}

#endif
Expand Down

0 comments on commit fe95df1

Please sign in to comment.