view: Read geometry directly in view_update_size
This commit is contained in:
parent
82b1019658
commit
63a6635163
|
@ -316,7 +316,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
|
||||||
|
|
||||||
void view_unmap(struct sway_view *view);
|
void view_unmap(struct sway_view *view);
|
||||||
|
|
||||||
void view_update_size(struct sway_view *view, int width, int height);
|
void view_update_size(struct sway_view *view);
|
||||||
void view_center_surface(struct sway_view *view);
|
void view_center_surface(struct sway_view *view);
|
||||||
|
|
||||||
void view_child_init(struct sway_view_child *child,
|
void view_child_init(struct sway_view_child *child,
|
||||||
|
|
|
@ -297,7 +297,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
||||||
desktop_damage_view(view);
|
desktop_damage_view(view);
|
||||||
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
||||||
if (container_is_floating(view->container)) {
|
if (container_is_floating(view->container)) {
|
||||||
view_update_size(view, new_geo.width, new_geo.height);
|
view_update_size(view);
|
||||||
transaction_commit_dirty();
|
transaction_commit_dirty();
|
||||||
transaction_notify_view_ready_immediately(view);
|
transaction_notify_view_ready_immediately(view);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -412,7 +412,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
||||||
desktop_damage_view(view);
|
desktop_damage_view(view);
|
||||||
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
||||||
if (container_is_floating(view->container)) {
|
if (container_is_floating(view->container)) {
|
||||||
view_update_size(view, new_geo.width, new_geo.height);
|
view_update_size(view);
|
||||||
transaction_commit_dirty();
|
transaction_commit_dirty();
|
||||||
} else {
|
} else {
|
||||||
view_center_surface(view);
|
view_center_surface(view);
|
||||||
|
|
|
@ -872,10 +872,10 @@ void view_unmap(struct sway_view *view) {
|
||||||
view->surface = NULL;
|
view->surface = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void view_update_size(struct sway_view *view, int width, int height) {
|
void view_update_size(struct sway_view *view) {
|
||||||
struct sway_container *con = view->container;
|
struct sway_container *con = view->container;
|
||||||
con->content_width = width;
|
con->content_width = view->geometry.width;
|
||||||
con->content_height = height;
|
con->content_height = view->geometry.height;
|
||||||
container_set_geometry_from_content(con);
|
container_set_geometry_from_content(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue