mirror of
https://github.com/swaywm/sway.git
synced 2024-11-13 05:54:11 +01:00
container: Remove useless surface dimensions
The adjustments to resize logic left them unnecessary.
This commit is contained in:
parent
7670f1a521
commit
5a4a7bc0da
@ -105,7 +105,6 @@ struct sway_container {
|
|||||||
// refuses to resize to the content dimensions then it can be smaller.
|
// refuses to resize to the content dimensions then it can be smaller.
|
||||||
// These are in layout coordinates.
|
// These are in layout coordinates.
|
||||||
double surface_x, surface_y;
|
double surface_x, surface_y;
|
||||||
double surface_width, surface_height;
|
|
||||||
|
|
||||||
enum sway_fullscreen_mode fullscreen_mode;
|
enum sway_fullscreen_mode fullscreen_mode;
|
||||||
|
|
||||||
|
@ -171,8 +171,8 @@ void output_view_for_each_surface(struct sway_output *output,
|
|||||||
- view->geometry.x,
|
- view->geometry.x,
|
||||||
.oy = view->container->surface_y - output->ly
|
.oy = view->container->surface_y - output->ly
|
||||||
- view->geometry.y,
|
- view->geometry.y,
|
||||||
.width = view->container->surface_width,
|
.width = view->container->current.content_width,
|
||||||
.height = view->container->surface_height,
|
.height = view->container->current.content_height,
|
||||||
.rotation = 0, // TODO
|
.rotation = 0, // TODO
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -191,8 +191,8 @@ void output_view_for_each_popup(struct sway_output *output,
|
|||||||
- view->geometry.x,
|
- view->geometry.x,
|
||||||
.oy = view->container->surface_y - output->ly
|
.oy = view->container->surface_y - output->ly
|
||||||
- view->geometry.y,
|
- view->geometry.y,
|
||||||
.width = view->container->surface_width,
|
.width = view->container->current.content_width,
|
||||||
.height = view->container->surface_height,
|
.height = view->container->current.content_height,
|
||||||
.rotation = 0, // TODO
|
.rotation = 0, // TODO
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -267,8 +267,6 @@ static void apply_container_state(struct sway_container *container,
|
|||||||
} else {
|
} else {
|
||||||
container->surface_y = container->current.content_y;
|
container->surface_y = container->current.content_y;
|
||||||
}
|
}
|
||||||
container->surface_width = container->current.content_width;
|
|
||||||
container->surface_height = container->current.content_height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!container->node.destroying) {
|
if (!container->node.destroying) {
|
||||||
|
@ -282,10 +282,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
|||||||
} else {
|
} else {
|
||||||
struct wlr_box new_geo;
|
struct wlr_box new_geo;
|
||||||
wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);
|
wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);
|
||||||
struct sway_container *con = view->container;
|
|
||||||
|
|
||||||
if ((new_geo.width != con->surface_width ||
|
if ((new_geo.width != view->geometry.width ||
|
||||||
new_geo.height != con->surface_height)) {
|
new_geo.height != view->geometry.height)) {
|
||||||
// The view has unexpectedly sent a new size
|
// The view has unexpectedly sent a new size
|
||||||
desktop_damage_view(view);
|
desktop_damage_view(view);
|
||||||
view_update_size(view, new_geo.width, new_geo.height);
|
view_update_size(view, new_geo.width, new_geo.height);
|
||||||
|
@ -371,10 +371,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
|||||||
} else {
|
} else {
|
||||||
struct wlr_box new_geo;
|
struct wlr_box new_geo;
|
||||||
get_geometry(view, &new_geo);
|
get_geometry(view, &new_geo);
|
||||||
struct sway_container *con = view->container;
|
|
||||||
|
|
||||||
if ((new_geo.width != con->surface_width ||
|
if ((new_geo.width != view->geometry.width ||
|
||||||
new_geo.height != con->surface_height)) {
|
new_geo.height != view->geometry.height)) {
|
||||||
// The view has unexpectedly sent a new size
|
// The view has unexpectedly sent a new size
|
||||||
// eg. The Firefox "Save As" dialog when downloading a file
|
// eg. The Firefox "Save As" dialog when downloading a file
|
||||||
desktop_damage_view(view);
|
desktop_damage_view(view);
|
||||||
|
@ -737,8 +737,6 @@ void view_update_size(struct sway_view *view, int width, int height) {
|
|||||||
con->surface_x = fmax(con->surface_x, con->content_x);
|
con->surface_x = fmax(con->surface_x, con->content_x);
|
||||||
con->surface_y = fmax(con->surface_y, con->content_y);
|
con->surface_y = fmax(con->surface_y, con->content_y);
|
||||||
}
|
}
|
||||||
con->surface_width = width;
|
|
||||||
con->surface_height = height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct sway_view_child_impl subsurface_impl;
|
static const struct sway_view_child_impl subsurface_impl;
|
||||||
|
Loading…
Reference in New Issue
Block a user