Skip to content

Commit

Permalink
Check we have a buffer size before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGriffiths committed Feb 20, 2025
1 parent 0ebe2b5 commit 73de77f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/frontend_wayland/wl_data_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,11 @@ mf::WlDataDevice::DragIconSurface::DragIconSurface(WlSurface* icon, std::shared_
icon->set_role(this);

auto spec = shell::SurfaceSpecification();
spec.width = surface.value().buffer_size()->width;
spec.height = surface.value().buffer_size()->height;
if (auto const size = surface.value().buffer_size())
{
spec.width = size->width;
spec.height = size->height;
}
spec.streams = std::vector<shell::StreamSpecification>{};
spec.input_shape = std::vector<Rectangle>{};
spec.depth_layer = mir_depth_layer_overlay;
Expand Down

0 comments on commit 73de77f

Please sign in to comment.