aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-27 15:22:00 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-27 15:22:00 -0400
commitc555a66ddafe3ea06f3abbf38194a8589733082d (patch)
tree2298ce1eb691b3d9d5a8ae69cb77894333f943c1 /rootston/desktop.c
parent325def38418f5caefd6dc23749dd2ca6bae0a36c (diff)
parentb97160238fa5b61fef81316102559c8c3e137cd2 (diff)
Merge branch 'master' into feature/xwm-rewrite
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 9438ecea..f93d1df8 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -7,11 +7,13 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_gamma_control.h>
+#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_wl_shell.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/util/log.h>
-#include "rootston/desktop.h"
+#include <server-decoration-protocol.h>
+#include "rootston/server.h"
#include "rootston/server.h"
void view_destroy(struct roots_view *view) {
@@ -22,9 +24,6 @@ void view_destroy(struct roots_view *view) {
input->active_view = NULL;
input->mode = ROOTS_CURSOR_PASSTHROUGH;
}
- if (input->last_active_view == view) {
- input->last_active_view = NULL;
- }
for (size_t i = 0; i < desktop->views->length; ++i) {
struct roots_view *_view = desktop->views->items[i];
@@ -107,13 +106,25 @@ bool view_center(struct roots_view *view) {
return true;
}
-void view_initialize(struct roots_view *view) {
+void view_setup(struct roots_view *view) {
view_center(view);
- struct roots_input *input = view->desktop->server->input;
+ struct roots_input *input = view->desktop->server->input;
set_view_focus(input, view->desktop, view);
}
+void view_teardown(struct roots_view *view) {
+ struct wlr_list *views = view->desktop->views;
+ if (views->length < 2 || views->items[views->length-1] != view) {
+ return;
+ }
+
+ 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,
struct wlr_surface **surface, double *sx, double *sy) {
for (int i = desktop->views->length - 1; i >= 0; --i) {
@@ -251,6 +262,11 @@ struct roots_desktop *desktop_create(struct roots_server *server,
server->wl_display);
desktop->screenshooter = wlr_screenshooter_create(server->wl_display,
server->renderer);
+ desktop->server_decoration_manager =
+ wlr_server_decoration_manager_create(server->wl_display);
+ wlr_server_decoration_manager_set_default_mode(
+ desktop->server_decoration_manager,
+ ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
return desktop;
}