This fixes an issue with havoc not having a valid size on map().
Investigation showed that xdg_surface->current.geometry is set only by
the xdg_surface::set_geometry protocol message, which is optional. If
set_geometry is not called, then we are supposed to compute the size
from the surface buffer(s). wlr_xdg_surface_get_geometry() already
accounts for this, so we just need to use wlr_xdg_surface_get_geometry()
instead of reading xdg_surface->current.geometry directly.
* dimensions remain zero until handle_commit().
*/
if (wlr_box_empty(&view->pending)) {
- view->pending.width =
- xdg_surface->current.geometry.width;
- view->pending.height =
- xdg_surface->current.geometry.height;
+ struct wlr_box size;
+ wlr_xdg_surface_get_geometry(xdg_surface, &size);
+ view->pending.width = size.width;
+ view->pending.height = size.height;
}
/*