mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
warpcursor: rebase and fixes
- centre pointer on new windows - don't centre pointer when pointer moves between windows
This commit is contained in:
parent
b629632b7c
commit
f51b935639
@ -8,7 +8,7 @@ config flag as I think it is unnecessary.
|
|||||||
|
|
||||||
### Download
|
### Download
|
||||||
- [git branch](https://codeberg.org/bencc/dwl/src/branch/warpcursor)
|
- [git branch](https://codeberg.org/bencc/dwl/src/branch/warpcursor)
|
||||||
- [2024-05-16](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/warpcursor/warpcursor.patch)
|
- [2024-06-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/warpcursor/warpcursor.patch)
|
||||||
|
|
||||||
### Authors
|
### Authors
|
||||||
- [Faerryn](https://github.com/faerryn)
|
- [Faerryn](https://github.com/faerryn)
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
From 8fd10973586e774fb83cc540e3b7a033bec2ca73 Mon Sep 17 00:00:00 2001
|
From fd0c1ff2c8373c9cf76f893b331f383299e6ae38 Mon Sep 17 00:00:00 2001
|
||||||
From: Ben Collerson <benc@benc.cc>
|
From: Ben Collerson <benc@benc.cc>
|
||||||
Date: Thu, 4 Jan 2024 20:30:01 +1000
|
Date: Thu, 4 Jan 2024 20:30:01 +1000
|
||||||
Subject: [PATCH] warpcursor
|
Subject: [PATCH] warpcursor
|
||||||
|
|
||||||
---
|
---
|
||||||
dwl.c | 27 +++++++++++++++++++++++++++
|
dwl.c | 28 ++++++++++++++++++++++++++++
|
||||||
1 file changed, 27 insertions(+)
|
1 file changed, 28 insertions(+)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bf763dfc..6bad7d51 100644
|
index 521b07a6..37ec0b0f 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -343,6 +343,7 @@ static void urgent(struct wl_listener *listener, void *data);
|
@@ -350,6 +350,7 @@ static void urgent(struct wl_listener *listener, void *data);
|
||||||
static void view(const Arg *arg);
|
static void view(const Arg *arg);
|
||||||
static void virtualkeyboard(struct wl_listener *listener, void *data);
|
static void virtualkeyboard(struct wl_listener *listener, void *data);
|
||||||
static void virtualpointer(struct wl_listener *listener, void *data);
|
static void virtualpointer(struct wl_listener *listener, void *data);
|
||||||
@ -19,7 +19,7 @@ index bf763dfc..6bad7d51 100644
|
|||||||
static Monitor *xytomon(double x, double y);
|
static Monitor *xytomon(double x, double y);
|
||||||
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
||||||
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
||||||
@@ -497,6 +498,7 @@ arrange(Monitor *m)
|
@@ -517,6 +518,7 @@ arrange(Monitor *m)
|
||||||
m->lt[m->sellt]->arrange(m);
|
m->lt[m->sellt]->arrange(m);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
checkidleinhibitor(NULL);
|
checkidleinhibitor(NULL);
|
||||||
@ -27,25 +27,26 @@ index bf763dfc..6bad7d51 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1244,6 +1246,9 @@ focusclient(Client *c, int lift)
|
@@ -1314,6 +1316,10 @@ focusclient(Client *c, int lift)
|
||||||
if (locked)
|
if (locked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
+ /* Warp cursor to center of client if it is outside */
|
+ /* Warp cursor to center of client if it is outside */
|
||||||
+ warpcursor(c);
|
+ if (lift)
|
||||||
|
+ warpcursor(c);
|
||||||
+
|
+
|
||||||
/* Raise client in stacking order if requested */
|
/* Raise client in stacking order if requested */
|
||||||
if (c && lift)
|
if (c && lift)
|
||||||
wlr_scene_node_raise_to_top(&c->scene->node);
|
wlr_scene_node_raise_to_top(&c->scene->node);
|
||||||
@@ -1344,6 +1349,7 @@ focusstack(const Arg *arg)
|
@@ -1659,6 +1665,7 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||||
|
focusclient(c, 1);
|
||||||
|
exclusive_focus = c;
|
||||||
|
}
|
||||||
|
+ warpcursor(c);
|
||||||
|
goto unset_fullscreen;
|
||||||
}
|
}
|
||||||
/* If only one client is visible on selmon, then c == sel */
|
|
||||||
focusclient(c, 1);
|
|
||||||
+ warpcursor(focustop(selmon));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We probably should change the name of this, it sounds like
|
@@ -2921,6 +2928,27 @@ virtualpointer(struct wl_listener *listener, void *data)
|
||||||
@@ -2858,6 +2864,27 @@ virtualpointer(struct wl_listener *listener, void *data)
|
|
||||||
wlr_cursor_map_input_to_output(cursor, &pointer.base, event->suggested_output);
|
wlr_cursor_map_input_to_output(cursor, &pointer.base, event->suggested_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,5 +75,5 @@ index bf763dfc..6bad7d51 100644
|
|||||||
xytomon(double x, double y)
|
xytomon(double x, double y)
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.43.0
|
2.45.2
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user