Skip to content

Commit

Permalink
Merge #1281
Browse files Browse the repository at this point in the history
1281: Fix XWaylandSurface::property_notify() r=wmww a=wmww

We need to fully process properties before consuming the pending spec, and should be reading properties even when we do not have a scene surface.

Co-authored-by: William Wold <[email protected]>
  • Loading branch information
2 people authored and AlanGriffiths committed Feb 17, 2020
1 parent 842c56c commit ac3f416
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/server/frontend_xwayland/xwayland_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ void mf::XWaylandSurface::property_notify(xcb_atom_t property)
auto const handler = property_handlers.find(property);
if (handler != property_handlers.end())
{
auto completion = handler->second();
completion();

std::shared_ptr<scene::Surface> scene_surface;
std::experimental::optional<std::unique_ptr<shell::SurfaceSpecification>> spec;

Expand All @@ -480,14 +483,9 @@ void mf::XWaylandSurface::property_notify(xcb_atom_t property)
spec = consume_pending_spec(lock);
}

if (scene_surface)
if (spec && scene_surface)
{
auto completion = handler->second();
completion();
if (spec)
{
shell->modify_surface(scene_surface->session().lock(), scene_surface, *spec.value());
}
shell->modify_surface(scene_surface->session().lock(), scene_surface, *spec.value());
}
}
}
Expand Down

0 comments on commit ac3f416

Please sign in to comment.