diff options
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/cursor.c | 47 | ||||
-rw-r--r-- | rootston/desktop.c | 11 | ||||
-rw-r--r-- | rootston/main.c | 2 | ||||
-rw-r--r-- | rootston/xdg_shell.c | 4 |
4 files changed, 22 insertions, 42 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c index 1fdf1dbb..b7ecc813 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -7,11 +7,7 @@ #include <wlr/util/edges.h> #include <wlr/util/log.h> #include <wlr/util/region.h> -#ifdef __linux__ #include <linux/input-event-codes.h> -#elif __FreeBSD__ -#include <dev/evdev/input-event-codes.h> -#endif #include "rootston/cursor.h" #include "rootston/desktop.h" #include "rootston/view.h" @@ -35,7 +31,8 @@ void roots_cursor_destroy(struct roots_cursor *cursor) { // TODO } -static void seat_view_deco_motion(struct roots_seat_view *view, double deco_sx, double deco_sy) { +static void seat_view_deco_motion(struct roots_seat_view *view, + double deco_sx, double deco_sy) { struct roots_cursor *cursor = view->seat->cursor; double sx = deco_sx; @@ -305,40 +302,18 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, } } -static void notify_relative_motion(struct roots_seat *seat, uint64_t time_msec, - double dx, double dy, double dx_unaccel, double dy_unaccel) { - struct wlr_relative_pointer_manager_v1 *relative_pointer_manager = - seat->input->server->desktop->relative_pointer_manager; - - struct wlr_seat_client *client = seat->seat->pointer_state.focused_client; - if (client == NULL) { - return; - } - - struct wlr_relative_pointer_v1 *pointer; - wl_list_for_each(pointer, &relative_pointer_manager->relative_pointers, link) { - struct wlr_seat_client *relative_pointer_client = - wlr_seat_client_from_pointer_resource(pointer->pointer); - - if (seat->seat == pointer->seat && - client == relative_pointer_client) { - wlr_relative_pointer_v1_send_relative_motion(pointer, - time_msec, dx, dy, dx_unaccel, dy_unaccel); - } - - } -} - void roots_cursor_handle_motion(struct roots_cursor *cursor, struct wlr_event_pointer_motion *event) { double dx = event->delta_x; double dy = event->delta_y; - double unaccel_dx = event->unaccel_dx; - double unaccel_dy = event->unaccel_dy; + double dx_unaccel = event->unaccel_dx; + double dy_unaccel = event->unaccel_dy; - notify_relative_motion(cursor->seat, - (uint64_t)event->time_msec * 1000, dx, dy, unaccel_dx, unaccel_dy); + wlr_relative_pointer_manager_v1_send_relative_motion( + cursor->seat->input->server->desktop->relative_pointer_manager, + cursor->seat->seat, (uint64_t)event->time_msec * 1000, dx, dy, + dx_unaccel, dy_unaccel); if (cursor->active_constraint) { struct roots_view *view = cursor->pointer_view->view; @@ -381,9 +356,9 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor, double dx = lx - cursor->cursor->x; double dy = ly - cursor->cursor->y; - - notify_relative_motion(cursor->seat, - (uint64_t)event->time_msec * 1000, dx, dy, dx, dy); + wlr_relative_pointer_manager_v1_send_relative_motion( + cursor->seat->input->server->desktop->relative_pointer_manager, + cursor->seat->seat, (uint64_t)event->time_msec * 1000, dx, dy, dx, dy); if (cursor->pointer_view) { struct roots_view *view = cursor->pointer_view->view; diff --git a/rootston/desktop.c b/rootston/desktop.c index 77a52571..d65266e5 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -7,24 +7,25 @@ #include <wlr/types/wlr_box.h> #include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_cursor.h> +#include <wlr/types/wlr_data_control_v1.h> #include <wlr/types/wlr_export_dmabuf_v1.h> -#include <wlr/types/wlr_gamma_control.h> #include <wlr/types/wlr_gamma_control_v1.h> +#include <wlr/types/wlr_gamma_control.h> +#include <wlr/types/wlr_gtk_primary_selection.h> #include <wlr/types/wlr_idle_inhibit_v1.h> #include <wlr/types/wlr_idle.h> #include <wlr/types/wlr_input_inhibitor.h> #include <wlr/types/wlr_layer_shell_v1.h> #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_pointer_constraints_v1.h> -#include <wlr/types/wlr_gtk_primary_selection.h> #include <wlr/types/wlr_server_decoration.h> +#include <wlr/types/wlr_tablet_v2.h> #include <wlr/types/wlr_wl_shell.h> #include <wlr/types/wlr_xcursor_manager.h> #include <wlr/types/wlr_xdg_output_v1.h> +#include <wlr/types/wlr_xdg_output_v1.h> #include <wlr/types/wlr_xdg_shell_v6.h> #include <wlr/types/wlr_xdg_shell.h> -#include <wlr/types/wlr_xdg_output_v1.h> -#include <wlr/types/wlr_tablet_v2.h> #include <wlr/util/log.h> #include "rootston/layers.h" #include "rootston/seat.h" @@ -1084,6 +1085,8 @@ struct roots_desktop *desktop_create(struct roots_server *server, desktop->relative_pointer_manager = wlr_relative_pointer_manager_v1_create(server->wl_display); + wlr_data_control_manager_v1_create(server->wl_display); + return desktop; } diff --git a/rootston/main.c b/rootston/main.c index 7e25dab1..b14989fa 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -73,6 +73,8 @@ int main(int argc, char **argv) { wl_display_run(server.wl_display); #if WLR_HAS_XWAYLAND + // We need to shutdown Xwayland before disconnecting all clients, otherwise + // wlroots will restart it automatically. wlr_xwayland_destroy(server.desktop->xwayland); #endif wl_display_destroy_clients(server.wl_display); diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index da8909ba..918f90ab 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -248,9 +248,9 @@ static void close(struct roots_view *view) { struct wlr_xdg_surface *surface = view->xdg_surface; struct wlr_xdg_popup *popup = NULL; wl_list_for_each(popup, &surface->popups, link) { - wlr_xdg_surface_send_close(popup->base); + wlr_xdg_popup_destroy(popup->base); } - wlr_xdg_surface_send_close(surface); + wlr_xdg_toplevel_send_close(surface); } static void destroy(struct roots_view *view) { |