mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
commit
d0a24465d7
11 changed files with 151 additions and 60 deletions
|
|
@ -509,8 +509,8 @@ static void surface_at_view(struct sway_container *swayc, double lx, double ly,
|
|||
return;
|
||||
}
|
||||
struct sway_view *sview = swayc->sway_view;
|
||||
double view_sx = lx - sview->x;
|
||||
double view_sy = ly - sview->y;
|
||||
double view_sx = lx - sview->x + sview->geometry.x;
|
||||
double view_sy = ly - sview->y + sview->geometry.y;
|
||||
|
||||
double _sx, _sy;
|
||||
struct wlr_surface *_surface = NULL;
|
||||
|
|
@ -1065,6 +1065,7 @@ void container_set_geometry_from_floating_view(struct sway_container *con) {
|
|||
con->y = view->y - top;
|
||||
con->width = view->width + border_width * 2;
|
||||
con->height = top + view->height + border_width;
|
||||
container_set_dirty(con);
|
||||
}
|
||||
|
||||
bool container_is_floating(struct sway_container *container) {
|
||||
|
|
|
|||
|
|
@ -615,34 +615,16 @@ void view_unmap(struct sway_view *view) {
|
|||
view->surface = NULL;
|
||||
}
|
||||
|
||||
void view_update_position(struct sway_view *view, double lx, double ly) {
|
||||
if (view->x == lx && view->y == ly) {
|
||||
return;
|
||||
}
|
||||
container_damage_whole(view->swayc);
|
||||
view->x = lx;
|
||||
view->y = ly;
|
||||
view->swayc->current.view_x = lx;
|
||||
view->swayc->current.view_y = ly;
|
||||
if (container_is_floating(view->swayc)) {
|
||||
container_set_geometry_from_floating_view(view->swayc);
|
||||
}
|
||||
container_damage_whole(view->swayc);
|
||||
}
|
||||
|
||||
void view_update_size(struct sway_view *view, int width, int height) {
|
||||
if (view->width == width && view->height == height) {
|
||||
if (!sway_assert(container_is_floating(view->swayc),
|
||||
"Expected a floating container")) {
|
||||
return;
|
||||
}
|
||||
container_damage_whole(view->swayc);
|
||||
view->width = width;
|
||||
view->height = height;
|
||||
view->swayc->current.view_width = width;
|
||||
view->swayc->current.view_height = height;
|
||||
if (container_is_floating(view->swayc)) {
|
||||
container_set_geometry_from_floating_view(view->swayc);
|
||||
}
|
||||
container_damage_whole(view->swayc);
|
||||
container_set_geometry_from_floating_view(view->swayc);
|
||||
}
|
||||
|
||||
static void view_subsurface_create(struct sway_view *view,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue