xdg: Use wlr_xdg_surface_get_geometry() to get size

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.
This commit is contained in:
John Lindgren 2023-02-20 17:30:17 -05:00 committed by Consolatis
parent 2e1c360c71
commit 84294c9cfb

View file

@ -325,10 +325,10 @@ xdg_toplevel_view_map(struct view *view)
* dimensions remain zero until handle_commit(). * dimensions remain zero until handle_commit().
*/ */
if (wlr_box_empty(&view->pending)) { if (wlr_box_empty(&view->pending)) {
view->pending.width = struct wlr_box size;
xdg_surface->current.geometry.width; wlr_xdg_surface_get_geometry(xdg_surface, &size);
view->pending.height = view->pending.width = size.width;
xdg_surface->current.geometry.height; view->pending.height = size.height;
} }
/* /*