aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index fe95426f..df8a79f2 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -69,16 +69,15 @@ static void view_update_output(const struct roots_view *view,
}
}
-void view_set_position(struct roots_view *view, double x, double y) {
+void view_move(struct roots_view *view, double x, double y) {
struct wlr_box before;
view_get_size(view, &before);
- if (view->set_position) {
- view->set_position(view, x, y);
+ if (view->move) {
+ view->move(view, x, y);
} else {
view->x = x;
view->y = y;
}
- view_update_output(view, &before);
}
void view_activate(struct roots_view *view, bool activate) {
@@ -96,6 +95,17 @@ void view_resize(struct roots_view *view, uint32_t width, uint32_t height) {
view_update_output(view, &before);
}
+void view_move_resize(struct roots_view *view, double x, double y,
+ uint32_t width, uint32_t height) {
+ if (view->move_resize) {
+ view->move_resize(view, x, y, width, height);
+ return;
+ }
+
+ view_move(view, x, y);
+ view_resize(view, width, height);
+}
+
void view_close(struct roots_view *view) {
if (view->close) {
view->close(view);
@@ -131,7 +141,7 @@ bool view_center(struct roots_view *view) {
double view_x = (double)(width - box.width) / 2 + l_output->x;
double view_y = (double)(height - box.height) / 2 + l_output->y;
- view_set_position(view, view_x, view_y);
+ view_move(view, view_x, view_y);
return true;
}
@@ -155,7 +165,6 @@ void view_teardown(struct roots_view *view) {
struct roots_view *prev_view = views->items[views->length-2];
struct roots_input *input = prev_view->desktop->server->input;
set_view_focus(input, prev_view->desktop, prev_view);
- wlr_seat_keyboard_notify_enter(input->wl_seat, prev_view->wlr_surface);
}
struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,