diff --git a/.clangd b/.clangd index 8fa0dca0a..532ac7794 100644 --- a/.clangd +++ b/.clangd @@ -1,2 +1,2 @@ CompileFlags: - Add: [-D,KINC_EDITOR_SUPPORT] \ No newline at end of file + Add: [-D,KINC_EDITOR_SUPPORT, -Wall] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 15e2ef7f8..1fe51d81c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,6 @@ Backends/System/Linux/Sources/kinc/backend/wayland/wayland-protocol.* Backends/System/Linux/Sources/kinc/backend/wayland/wayland-viewporter.* Backends/System/Linux/Sources/kinc/backend/wayland/xdg-decoration.* Backends/System/Linux/Sources/kinc/backend/wayland/xdg-shell.* -Backends/System/Linux/Sources/kinc/backend/wayland/wayland-tablet.* \ No newline at end of file +Backends/System/Linux/Sources/kinc/backend/wayland/wayland-tablet.* +Backends/System/Linux/Sources/kinc/backend/wayland/wayland-pointer-constraint.* +Backends/System/Linux/Sources/kinc/backend/wayland/wayland-relative-pointer.* \ No newline at end of file diff --git a/Backends/System/Linux/Sources/kinc/backend/linuxunit.c b/Backends/System/Linux/Sources/kinc/backend/linuxunit.c index 7f1876c22..a0f067090 100644 --- a/Backends/System/Linux/Sources/kinc/backend/linuxunit.c +++ b/Backends/System/Linux/Sources/kinc/backend/linuxunit.c @@ -8,12 +8,14 @@ #ifndef KINC_NO_WAYLAND #include "wayland/display.c.h" #include "wayland/system.c.h" +#include "wayland/wayland-pointer-constraint.c.h" #include "wayland/wayland-protocol.c.h" +#include "wayland/wayland-relative-pointer.c.h" +#include "wayland/wayland-tablet.c.h" #include "wayland/wayland-viewporter.c.h" #include "wayland/window.c.h" #include "wayland/xdg-decoration.c.h" #include "wayland/xdg-shell.c.h" -#include "wayland/wayland-tablet.c.h" #endif #ifndef KINC_NO_X11 @@ -49,6 +51,14 @@ void kinc_linux_init_procs() { procs.window_hide = kinc_wayland_window_hide; procs.count_windows = kinc_wayland_count_windows; + procs.mouse_can_lock = kinc_wl_mouse_can_lock; + procs.mouse_lock = kinc_wl_mouse_lock; + procs.mouse_unlock = kinc_wl_mouse_unlock; + procs.mouse_show = kinc_wl_mouse_show; + procs.mouse_hide = kinc_wl_mouse_hide; + procs.mouse_set_position = kinc_wl_mouse_set_position; + procs.mouse_get_position = kinc_wl_mouse_get_position; + procs.display_init = kinc_wayland_display_init; procs.display_available = kinc_wayland_display_available; procs.display_available_mode = kinc_wayland_display_available_mode; diff --git a/Backends/System/Linux/Sources/kinc/backend/wayland/system.c.h b/Backends/System/Linux/Sources/kinc/backend/wayland/system.c.h index 604dfd269..1be7a2ab3 100644 --- a/Backends/System/Linux/Sources/kinc/backend/wayland/system.c.h +++ b/Backends/System/Linux/Sources/kinc/backend/wayland/system.c.h @@ -1,6 +1,9 @@ +#include "kinc/backend/wayland/wayland-pointer-constraint.h" +#include "kinc/backend/wayland/wayland-relative-pointer.h" #include "kinc/backend/wayland/wayland-tablet.h" #include "kinc/backend/wayland/xdg-shell.h" #include "kinc/input/pen.h" +#include "kinc/log.h" #include "kinc/memory.h" #include "wayland.h" @@ -268,50 +271,55 @@ void wl_pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, uint32_ mouse->x = x; mouse->y = y; - const char *cursor_name = "default"; + if (!window->decorations.server_side) { + const char *cursor_name = "default"; - switch (window->decorations.focus) { - case KINC_WL_DECORATION_FOCUS_MAIN: - kinc_internal_mouse_trigger_move(mouse->current_window, x, y); - break; - case KINC_WL_DECORATION_FOCUS_TOP: - if (y < KINC_WL_DECORATION_TOP_HEIGHT / 2) - cursor_name = "n-resize"; - else - cursor_name = "left_ptr"; - break; - case KINC_WL_DECORATION_FOCUS_LEFT: - if (y < KINC_WL_DECORATION_WIDTH) - cursor_name = "nw-resize"; - else if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT - KINC_WL_DECORATION_WIDTH) - cursor_name = "sw-resize"; - else - cursor_name = "w-resize"; - break; - case KINC_WL_DECORATION_FOCUS_RIGHT: - if (y < KINC_WL_DECORATION_WIDTH) - cursor_name = "ne-resize"; - else if (mouse->y > KINC_WL_DECORATION_RIGHT_HEIGHT - KINC_WL_DECORATION_WIDTH) - cursor_name = "se-resize"; - else - cursor_name = "e-resize"; - break; - case KINC_WL_DECORATION_FOCUS_BOTTOM: - if (x < 10) - cursor_name = "sw-resize"; - else if (x > window->width + 10) - cursor_name = "se-resize"; - else - cursor_name = "s-resize"; - break; - case KINC_WL_DECORATION_FOCUS_CLOSE_BUTTON: - break; - default: - break; - } + switch (window->decorations.focus) { + case KINC_WL_DECORATION_FOCUS_MAIN: + kinc_internal_mouse_trigger_move(mouse->current_window, x, y); + break; + case KINC_WL_DECORATION_FOCUS_TOP: + if (y < KINC_WL_DECORATION_TOP_HEIGHT / 2) + cursor_name = "n-resize"; + else + cursor_name = "left_ptr"; + break; + case KINC_WL_DECORATION_FOCUS_LEFT: + if (y < KINC_WL_DECORATION_WIDTH) + cursor_name = "nw-resize"; + else if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT - KINC_WL_DECORATION_WIDTH) + cursor_name = "sw-resize"; + else + cursor_name = "w-resize"; + break; + case KINC_WL_DECORATION_FOCUS_RIGHT: + if (y < KINC_WL_DECORATION_WIDTH) + cursor_name = "ne-resize"; + else if (mouse->y > KINC_WL_DECORATION_RIGHT_HEIGHT - KINC_WL_DECORATION_WIDTH) + cursor_name = "se-resize"; + else + cursor_name = "e-resize"; + break; + case KINC_WL_DECORATION_FOCUS_BOTTOM: + if (x < 10) + cursor_name = "sw-resize"; + else if (x > window->width + 10) + cursor_name = "se-resize"; + else + cursor_name = "s-resize"; + break; + case KINC_WL_DECORATION_FOCUS_CLOSE_BUTTON: + break; + default: + break; + } - if (mouse->previous_cursor_name != cursor_name) { - kinc_wayland_set_cursor(mouse, cursor_name); + if (mouse->previous_cursor_name != cursor_name) { + kinc_wayland_set_cursor(mouse, cursor_name); + } + } + else { + kinc_internal_mouse_trigger_move(mouse->current_window, x, y); } } @@ -334,59 +342,60 @@ void wl_pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_ default: break; } - - if (kinc_button == 0) { - enum xdg_toplevel_resize_edge edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; - switch (window->decorations.focus) { - case KINC_WL_DECORATION_FOCUS_MAIN: - break; - case KINC_WL_DECORATION_FOCUS_TOP: - if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT / 2) - edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP; - else { - xdg_toplevel_move(window->toplevel, wl_ctx.seat.seat, serial); - } - break; - case KINC_WL_DECORATION_FOCUS_LEFT: - if (mouse->y < KINC_WL_DECORATION_TOP_HEIGHT / 2) - edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT; - else if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT - (KINC_WL_DECORATION_TOP_HEIGHT / 2)) - edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT; - else - edges = XDG_TOPLEVEL_RESIZE_EDGE_LEFT; - break; - case KINC_WL_DECORATION_FOCUS_RIGHT: - if (mouse->y < KINC_WL_DECORATION_TOP_HEIGHT / 2) - edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT; - else if (mouse->y > KINC_WL_DECORATION_RIGHT_HEIGHT - (KINC_WL_DECORATION_TOP_HEIGHT / 2)) - edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT; - else - edges = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT; - break; - case KINC_WL_DECORATION_FOCUS_BOTTOM: - edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM; - break; - case KINC_WL_DECORATION_FOCUS_CLOSE_BUTTON: - if (kinc_button == 0) { - if (kinc_internal_call_close_callback(window->window_id)) { - kinc_window_destroy(window->window_id); - if (wl_ctx.num_windows <= 0) { - // no windows left, stop - kinc_stop(); + if (!window->decorations.server_side) { + if (kinc_button == 0) { + enum xdg_toplevel_resize_edge edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; + switch (window->decorations.focus) { + case KINC_WL_DECORATION_FOCUS_MAIN: + break; + case KINC_WL_DECORATION_FOCUS_TOP: + if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT / 2) + edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP; + else { + xdg_toplevel_move(window->toplevel, wl_ctx.seat.seat, serial); + } + break; + case KINC_WL_DECORATION_FOCUS_LEFT: + if (mouse->y < KINC_WL_DECORATION_TOP_HEIGHT / 2) + edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT; + else if (mouse->y > KINC_WL_DECORATION_TOP_HEIGHT - (KINC_WL_DECORATION_TOP_HEIGHT / 2)) + edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT; + else + edges = XDG_TOPLEVEL_RESIZE_EDGE_LEFT; + break; + case KINC_WL_DECORATION_FOCUS_RIGHT: + if (mouse->y < KINC_WL_DECORATION_TOP_HEIGHT / 2) + edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT; + else if (mouse->y > KINC_WL_DECORATION_RIGHT_HEIGHT - (KINC_WL_DECORATION_TOP_HEIGHT / 2)) + edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT; + else + edges = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT; + break; + case KINC_WL_DECORATION_FOCUS_BOTTOM: + edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM; + break; + case KINC_WL_DECORATION_FOCUS_CLOSE_BUTTON: + if (kinc_button == 0) { + if (kinc_internal_call_close_callback(window->window_id)) { + kinc_window_destroy(window->window_id); + if (wl_ctx.num_windows <= 0) { + // no windows left, stop + kinc_stop(); + } } } + break; + default: + break; + } + if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE) { + xdg_toplevel_resize(window->toplevel, wl_ctx.seat.seat, serial, edges); } - break; - default: - break; - } - if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE) { - xdg_toplevel_resize(window->toplevel, wl_ctx.seat.seat, serial, edges); } - } - else if (kinc_button == 1) { - if (window->decorations.focus == KINC_WL_DECORATION_FOCUS_TOP) { - xdg_toplevel_show_window_menu(window->toplevel, mouse->seat->seat, serial, mouse->x, mouse->y); + else if (kinc_button == 1) { + if (window->decorations.focus == KINC_WL_DECORATION_FOCUS_TOP) { + xdg_toplevel_show_window_menu(window->toplevel, mouse->seat->seat, serial, mouse->x, mouse->y); + } } } @@ -411,6 +420,20 @@ static const struct wl_pointer_listener wl_pointer_listener = { wl_pointer_handle_enter, wl_pointer_handle_leave, wl_pointer_handle_motion, wl_pointer_handle_button, wl_pointer_handle_axis, 0, 0, 0, 0, }; +void zwp_relative_pointer_v1_handle_relative_motion(void *data, struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, uint32_t utime_hi, uint32_t utime_lo, + wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t dx_unaccel, wl_fixed_t dy_unaccel) { + struct kinc_wl_mouse *mouse = data; + if (mouse->locked) { + mouse->x += wl_fixed_to_int(dx); + mouse->y += wl_fixed_to_int(dy); + kinc_internal_mouse_trigger_move(mouse->current_window, mouse->x, mouse->y); + } +} + +static const struct zwp_relative_pointer_v1_listener zwp_relative_pointer_v1_listener = { + zwp_relative_pointer_v1_handle_relative_motion, +}; + #include #include @@ -520,6 +543,10 @@ void wl_seat_capabilities(void *data, struct wl_seat *wl_seat, uint32_t capabili seat->mouse.surface = wl_compositor_create_surface(wl_ctx.compositor); seat->mouse.seat = seat; wl_pointer_add_listener(seat->mouse.pointer, &wl_pointer_listener, &seat->mouse); + if (wl_ctx.relative_pointer_manager) { + seat->mouse.relative = zwp_relative_pointer_manager_v1_get_relative_pointer(wl_ctx.relative_pointer_manager, seat->mouse.pointer); + zwp_relative_pointer_v1_add_listener(seat->mouse.relative, &zwp_relative_pointer_v1_listener, &seat->mouse); + } } if (capabilities & WL_SEAT_CAPABILITY_TOUCH) { seat->touch = wl_seat_get_touch(wl_seat); @@ -948,6 +975,12 @@ static void wl_registry_handle_global(void *data, struct wl_registry *registry, zwp_tablet_seat_v2_add_listener(wl_ctx.seat.tablet_seat.seat, &zwp_tablet_seat_v2_listener, &wl_ctx.seat.tablet_seat); } } + else if (kinc_string_compare(interface, zwp_pointer_constraints_v1_interface.name) == 0) { + wl_ctx.pointer_constraints = wl_registry_bind(registry, name, &zwp_pointer_constraints_v1_interface, 1); + } + else if (kinc_string_compare(interface, zwp_relative_pointer_manager_v1_interface.name) == 0) { + wl_ctx.relative_pointer_manager = wl_registry_bind(registry, name, &zwp_relative_pointer_manager_v1_interface, 1); + } } static void wl_registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { @@ -1086,4 +1119,126 @@ VkBool32 kinc_wayland_vulkan_get_physical_device_presentation_support(VkPhysical return vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, wl_ctx.display); } #undef VK_USE_PLATFORM_WAYLAND_KHR -#endif \ No newline at end of file +#endif + +void zwp_locked_pointer_v1_handle_locked(void *data, struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1) { + struct kinc_wl_mouse *mouse = data; + mouse->locked = true; +} + +void zwp_locked_pointer_v1_handle_unlocked(void *data, struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1) { + struct kinc_wl_mouse *mouse = data; + mouse->locked = false; +} + +static const struct zwp_locked_pointer_v1_listener zwp_locked_pointer_v1_listener = { + zwp_locked_pointer_v1_handle_locked, + zwp_locked_pointer_v1_handle_unlocked, +}; + +void kinc_wl_mouse_show() { + kinc_wayland_set_cursor(&wl_ctx.seat.mouse, "default"); // TODO: should use the last set cursor instead +} + +void kinc_wl_mouse_hide() { + wl_pointer_set_cursor(wl_ctx.seat.mouse.pointer, wl_ctx.seat.mouse.serial, NULL, 0, 0); +} + +void kinc_wl_mouse_lock(int window) { + struct kinc_wl_mouse *mouse = &wl_ctx.seat.mouse; + struct wl_region *region = wl_compositor_create_region(wl_ctx.compositor); + wl_region_add(region, mouse->x, mouse->y, 0, 0); + mouse->lock = zwp_pointer_constraints_v1_lock_pointer(wl_ctx.pointer_constraints, wl_ctx.windows[window].surface, wl_ctx.seat.mouse.pointer, region, + ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT); + zwp_locked_pointer_v1_add_listener(mouse->lock, &zwp_locked_pointer_v1_listener, mouse); + +} + +void kinc_wl_mouse_unlock(void) { + zwp_locked_pointer_v1_destroy(wl_ctx.seat.mouse.lock); + wl_ctx.seat.mouse.lock = NULL; + wl_ctx.seat.mouse.locked = false; + kinc_wl_mouse_show(); +} + +bool kinc_wl_mouse_can_lock(void) { + return true; +} + +void kinc_wl_mouse_set_cursor(int cursorIndex) { + const char *name; + switch (cursorIndex) { + case 0: { + name = "arrow"; + break; + } + case 1: { + name = "hand1"; + break; + } + case 2: { + name = "xterm"; + break; + } + case 3: { + name = "sb_h_double_arrow"; + break; + } + case 4: { + name = "sb_v_double_arrow"; + break; + } + case 5: { + name = "top_right_corner"; + break; + } + case 6: { + name = "bottom_right_corner"; + break; + } + case 7: { + name = "top_left_corner"; + break; + } + case 8: { + name = "bottom_left_corner"; + break; + } + case 9: { + name = "grab"; + break; + } + case 10: { + name = "grabbing"; + break; + } + case 11: { + name = "not-allowed"; + break; + } + case 12: { + name = "watch"; + break; + } + case 13: { + name = "crosshair"; + break; + } + default: { + name = "arrow"; + break; + } + } + if (!wl_ctx.seat.mouse.hidden) { + kinc_wayland_set_cursor(&wl_ctx.seat.mouse, name); + } +} + +void kinc_wl_mouse_set_position(int window_index, int x, int y) { + kinc_log(KINC_LOG_LEVEL_ERROR, "Wayland: cannot set the mouse position."); +} + +void kinc_wl_mouse_get_position(int window_index, int *x, int *y) { + *x = wl_ctx.seat.mouse.x; + *y = wl_ctx.seat.mouse.y; +} \ No newline at end of file diff --git a/Backends/System/Linux/Sources/kinc/backend/wayland/wayland.h b/Backends/System/Linux/Sources/kinc/backend/wayland/wayland.h index 24d9037b0..2689716dc 100644 --- a/Backends/System/Linux/Sources/kinc/backend/wayland/wayland.h +++ b/Backends/System/Linux/Sources/kinc/backend/wayland/wayland.h @@ -135,6 +135,8 @@ struct kinc_wl_procs { extern struct kinc_wl_procs wl; +#include "wayland-pointer-constraint.h" +#include "wayland-relative-pointer.h" #include "wayland-tablet.h" #include "wayland-viewporter.h" #include "xdg-decoration.h" @@ -271,6 +273,11 @@ struct kinc_wl_mouse { const char *previous_cursor_name; struct wl_pointer *pointer; struct wl_surface *surface; + bool hidden; + bool locked; + struct zwp_locked_pointer_v1 *lock; + struct zwp_relative_pointer_v1 *relative; + int serial; }; struct kinc_wl_keyboard { @@ -370,6 +377,8 @@ struct wayland_context { struct zxdg_decoration_manager_v1 *decoration_manager; struct wl_data_device_manager *data_device_manager; struct zwp_tablet_manager_v2 *tablet_manager; + struct zwp_pointer_constraints_v1 *pointer_constraints; + struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; struct wl_cursor_theme *cursor_theme; int cursor_size; int num_windows; diff --git a/Backends/System/Linux/Sources/kinc/backend/wayland/window.c.h b/Backends/System/Linux/Sources/kinc/backend/wayland/window.c.h index 534b1a51f..42444011d 100644 --- a/Backends/System/Linux/Sources/kinc/backend/wayland/window.c.h +++ b/Backends/System/Linux/Sources/kinc/backend/wayland/window.c.h @@ -16,8 +16,6 @@ #endif static void xdg_surface_handle_configure(void *data, struct xdg_surface *surface, uint32_t serial) { - struct kinc_wl_window *window = data; - xdg_surface_ack_configure(surface, serial); } @@ -27,11 +25,18 @@ void kinc_wayland_resize_decoration(struct kinc_wl_decoration *, int x, int y, i static void xdg_toplevel_handle_configure(void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height, struct wl_array *states) { struct kinc_wl_window *window = data; if ((width <= 0 || height <= 0) || (width == window->width + (KINC_WL_DECORATION_WIDTH * 2) && - height == window->height + KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT)) { + height == window->height + KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT)) { return; } - window->width = width - (KINC_WL_DECORATION_WIDTH * 2); - window->height = height - KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT; + if (window->decorations.server_side) { + window->width = width; + window->height = height; + } + else { + window->width = width - (KINC_WL_DECORATION_WIDTH * 2); + window->height = height - KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT; + } + enum xdg_toplevel_state *state; wl_array_for_each(state, states) { switch (*state) { @@ -47,8 +52,14 @@ static void xdg_toplevel_handle_configure(void *data, struct xdg_toplevel *tople } } kinc_internal_resize(window->window_id, window->width, window->height); - xdg_surface_set_window_geometry(window->xdg_surface, KINC_WL_DECORATION_LEFT_X, KINC_WL_DECORATION_TOP_Y, window->width + (KINC_WL_DECORATION_WIDTH * 2), - window->height + KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT); + if (window->decorations.server_side) { + xdg_surface_set_window_geometry(window->xdg_surface, 0, 0, window->width, window->height); + } + else { + xdg_surface_set_window_geometry(window->xdg_surface, KINC_WL_DECORATION_LEFT_X, KINC_WL_DECORATION_TOP_Y, + window->width + (KINC_WL_DECORATION_WIDTH * 2), + window->height + KINC_WL_DECORATION_TOP_HEIGHT + KINC_WL_DECORATION_BOTTOM_HEIGHT); + } #ifdef KINC_EGL wl_egl_window_resize(window->egl_window, window->width, window->height, 0, 0); #endif @@ -395,7 +406,6 @@ int kinc_wayland_window_height(int window_index) { } void kinc_wayland_window_resize(int window_index, int width, int height) { - struct kinc_wl_window *window = &wl_ctx.windows[window_index]; kinc_log(KINC_LOG_LEVEL_WARNING, "TODO: resizing windows"); } diff --git a/Backends/System/Linux/Sources/kinc/backend/x11/display.c.h b/Backends/System/Linux/Sources/kinc/backend/x11/display.c.h index d3bf29994..0ba32da48 100644 --- a/Backends/System/Linux/Sources/kinc/backend/x11/display.c.h +++ b/Backends/System/Linux/Sources/kinc/backend/x11/display.c.h @@ -6,7 +6,6 @@ void kinc_x11_display_init(void) { int eventBase; int errorBase; - int displayCounter; bool hasXinerama = (xlib.XineramaQueryExtension(x11_ctx.display, &eventBase, &errorBase) && xlib.XineramaIsActive(x11_ctx.display)); XineramaScreenInfo *xinerama_screens = NULL; diff --git a/Tests/MultiWindow/kfile.js b/Tests/MultiWindow/kfile.js index b8a13b1e7..b10d3edcb 100644 --- a/Tests/MultiWindow/kfile.js +++ b/Tests/MultiWindow/kfile.js @@ -4,7 +4,6 @@ await project.addProject('../../'); project.addFile('Sources/**'); project.addDefine("VALIDATE"); -project.addDefine("KINC_WAYLAND_FORCE_CSD"); project.setDebugDir('Deployment'); project.flatten(); diff --git a/kfile.js b/kfile.js index 17fb0f5d3..6bacb473f 100644 --- a/kfile.js +++ b/kfile.js @@ -344,6 +344,8 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) { wl_protocol("stable/xdg-shell/xdg-shell.xml", "xdg-shell"); wl_protocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", "xdg-decoration"); wl_protocol("unstable/tablet/tablet-unstable-v2.xml", "wayland-tablet"); + wl_protocol("unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", "wayland-pointer-constraint"); + wl_protocol("unstable/relative-pointer/relative-pointer-unstable-v1.xml", "wayland-relative-pointer"); if (platform === Platform.Linux) { project.addLib('udev'); diff --git a/kincfile.js b/kincfile.js index b6d99ea37..703f545aa 100644 --- a/kincfile.js +++ b/kincfile.js @@ -343,6 +343,9 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) { wl_protocol("stable/viewporter/viewporter.xml", "wayland-viewporter"); wl_protocol("stable/xdg-shell/xdg-shell.xml", "xdg-shell"); wl_protocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", "xdg-decoration"); + wl_protocol("unstable/tablet/tablet-unstable-v2.xml", "wayland-tablet"); + wl_protocol("unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", "wayland-pointer-constraint"); + wl_protocol("unstable/relative-pointer/relative-pointer-unstable-v1", "wayland-relative-pointer"); if (platform === Platform.Linux) { project.addLib('udev');