From a3f27546681a6a92e1e37ed7692428c36b486a8e Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 24 Oct 2017 12:00:43 -0400 Subject: xwm: add surface to rootston on surface commit --- rootston/desktop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rootston/desktop.c') diff --git a/rootston/desktop.c b/rootston/desktop.c index 40d088b8..30b5a519 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -99,10 +99,10 @@ bool view_center(struct roots_view *view) { int width, height; wlr_output_effective_resolution(output, &width, &height); - view->x = (double)(width - size.width) / 2 - + l_output->x; - view->y = (double)(height - size.height) / 2 - + l_output->y; + double view_x = (double)(width - size.width) / 2 + l_output->x; + double view_y = (double)(height - size.height) / 2 + l_output->y; + + view_set_position(view, view_x, view_y); return true; } -- cgit v1.2.3 From 7914f4bda9aa2ea9e57ac36ec0d49e8a2c49d182 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 25 Oct 2017 20:40:55 -0400 Subject: xwm: dont focus override redirect windows --- rootston/cursor.c | 8 +++++--- rootston/desktop.c | 1 - rootston/keyboard.c | 2 -- xwayland/xwm.c | 7 ++++++- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'rootston/desktop.c') diff --git a/rootston/cursor.c b/rootston/cursor.c index b55eab3f..9193f9b7 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -172,6 +172,10 @@ void set_view_focus(struct roots_input *input, struct roots_desktop *desktop, if (!view) { return; } + if (view->type == ROOTS_XWAYLAND_VIEW && + view->xwayland_surface->override_redirect) { + return; + } input->last_active_view = view; size_t index = 0; @@ -187,6 +191,7 @@ void set_view_focus(struct roots_input *input, struct roots_desktop *desktop, // TODO: list_swap wlr_list_del(desktop->views, index); wlr_list_add(desktop->views, view); + wlr_seat_keyboard_notify_enter(input->wl_seat, view->wlr_surface); } static void handle_cursor_motion(struct wl_listener *listener, void *data) { @@ -275,9 +280,6 @@ static void do_cursor_button_press(struct roots_input *input, input->input_events_idx = (i + 1) % (sizeof(input->input_events) / sizeof(input->input_events[0])); set_view_focus(input, desktop, view); - if (view) { - wlr_seat_keyboard_notify_enter(input->wl_seat, surface); - } break; } } diff --git a/rootston/desktop.c b/rootston/desktop.c index 30b5a519..9438ecea 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -112,7 +112,6 @@ void view_initialize(struct roots_view *view) { struct roots_input *input = view->desktop->server->input; set_view_focus(input, view->desktop, view); - wlr_seat_keyboard_notify_enter(input->wl_seat, view->wlr_surface); } struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, diff --git a/rootston/keyboard.c b/rootston/keyboard.c index 61604da0..ef0826aa 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -36,8 +36,6 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, if (server->desktop->views->length > 0) { struct roots_view *view = server->desktop->views->items[0]; set_view_focus(keyboard->input, server->desktop, view); - wlr_seat_keyboard_notify_enter(keyboard->input->wl_seat, - view->wlr_surface); } } else if (strncmp(exec_prefix, command, strlen(exec_prefix)) == 0) { const char *shell_cmd = command + strlen(exec_prefix); diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 27d8bff9..90f2f21c 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -96,6 +96,10 @@ static void xwm_set_net_active_window(struct wlr_xwm *xwm, static void xwm_send_focus_window(struct wlr_xwm *xwm, struct wlr_xwayland_surface *surface) { if (surface) { + if (surface->override_redirect) { + return; + } + xcb_client_message_event_t client_message; client_message.response_type = XCB_CLIENT_MESSAGE; client_message.format = 32; @@ -124,7 +128,8 @@ static void xwm_send_focus_window(struct wlr_xwm *xwm, void xwm_surface_activate(struct wlr_xwm *xwm, struct wlr_xwayland_surface *xsurface) { - if (xwm->focus_surface == xsurface) { + if (xwm->focus_surface == xsurface || + (xsurface && xsurface->override_redirect)) { return; } -- cgit v1.2.3