Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-01 00:13:29 +03:00
parent 670848e924
commit df00037296
2 changed files with 17 additions and 4 deletions

6
flake.lock generated
View File

@@ -97,11 +97,11 @@
]
},
"locked": {
"lastModified": 1759215258,
"narHash": "sha256-Y7aXk0Zxu+X2BbO5MLkCvClrPsKfZ2sm34N2n7tXx4I=",
"lastModified": 1759266345,
"narHash": "sha256-BJ+CTRXaFArVFgJfL19QpoR7Ebk8HU63Lz0+jQvhV3Y=",
"owner": "slendidev",
"repo": "wlroots-lunar",
"rev": "a9abd5a6e4fb4e5ac6c410e1fb1ad438d3b12001",
"rev": "1179ca07821decbff320eafd7ffb3caaadcefbf4",
"type": "github"
},
"original": {

View File

@@ -3,10 +3,11 @@
#include "LunarWM_core.h"
#include "LunarWM_render.h"
#include "common.h"
#include "raylib.h"
#include "vec.h"
#include <pixman.h>
#include <wlr/backend/wayland.h>
#include <wlr/backend/x11.h>
#include <wlr/render/color.h>
#include <wlr/render/pass.h>
@@ -22,6 +23,7 @@
#include <xkbcommon/xkbcommon-keysyms.h>
#include <xkbcommon/xkbcommon.h>
#include <raylib.h>
#include <rlgl.h>
static void handle_new_output(struct wl_listener *listener, void *data);
@@ -1293,6 +1295,17 @@ static void Pointer_motion_notify(struct wl_listener *listener, void *data)
struct wlr_pointer_motion_event *ev = data;
auto dev = (struct wlr_input_device *)p->wlr_pointer;
if (wlr_backend_is_wl(p->server->wayland.backend)) {
if (!wlr_wl_pointer_is_locked(dev)) {
assert(wlr_wl_pointer_set_locked(dev, true));
}
} else if (wlr_backend_is_x11(p->server->wayland.backend)) {
if (!wlr_x11_pointer_is_locked(dev)) {
assert(wlr_x11_pointer_set_locked(dev, true));
}
}
float dx = (float)ev->delta_x;
float dy = (float)ev->delta_y;
if (p->server->cman->cfg.input.mouse.invert_x) {