Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Aug 21, 2022
1 parent 3e9a8a7 commit 3cb30e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/managers/XWaylandManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ wlr_surface* CHyprXWaylandManager::getWindowSurface(CWindow* pWindow) {
}

void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate) {
if (wlr_surface_is_xdg_surface(pSurface))
wlr_xdg_toplevel_set_activated(wlr_xdg_surface_from_wlr_surface(pSurface)->toplevel, activate);
else if (wlr_surface_is_xwayland_surface(pSurface)) {
if (wlr_surface_is_xdg_surface(pSurface)) {
const auto PSURF = wlr_xdg_surface_from_wlr_surface(pSurface);

if (PSURF->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
wlr_xdg_toplevel_set_activated(PSURF->toplevel, activate);
}
} else if (wlr_surface_is_xwayland_surface(pSurface)) {
wlr_xwayland_surface_activate(wlr_xwayland_surface_from_wlr_surface(pSurface), activate);

if (activate)
Expand Down

0 comments on commit 3cb30e7

Please sign in to comment.