From 8369f5e13736e3e56f20f34a7d0abe6a5b226d45 Mon Sep 17 00:00:00 2001 From: korei999 Date: Mon, 22 Jan 2024 14:41:46 +0200 Subject: [PATCH] return cursorwarptohint --- config.def.h | 13 +++++++------ dwl.c | 15 +++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/config.def.h b/config.def.h index 4c90ca2..d0bbea1 100644 --- a/config.def.h +++ b/config.def.h @@ -51,6 +51,7 @@ static const Rule rules[] = { { NULL, "Confirm to replace files", 0, 1, -1}, { NULL, "File Operation Progress", 0, 1, -1}, { NULL, "Seer Console", 0, 1, -1}, + { "file-roller", NULL, 0, 1, -1}, }; /* layout(s) */ @@ -169,9 +170,9 @@ static const char* PrintSave[] = { "PrintDwl.sh", "Save", NULL }; static const char* PrintSelSave[] = { "PrintDwl.sh", "SelectSave", NULL }; static const char* BMonUp[] = { "light", "-T", "1.4", NULL }; static const char* BMonDown[] = { "light", "-T", "0.72", NULL }; -static const char* BufferSave[] = { "buffer-save.sh", NULL }; -static const char* BufferToggle[] = { "buffer-toggle.sh", NULL }; -static const char* RecToggle[] = { "rec-toggle.sh", NULL }; +// static const char* BufferSave[] = { "buffer-save.sh", NULL }; +// static const char* BufferToggle[] = { "buffer-toggle.sh", NULL }; +// static const char* RecToggle[] = { "rec-toggle.sh", NULL }; static const char* ScreenLock[] = { "Lock.sh", "lock", NULL }; static const char* Swayidle[] = { "Lock.sh", "toggle", NULL }; static const char* Thunar[] = { "Thunar", NULL }; @@ -231,9 +232,9 @@ static const Key keys[] = { { SUPER, Key_w, killclient, { 0 } }, { ALT, Key_Escape, spawn, { .v = PowerMenu } }, { ALT, Key_Caps_Lock, spawn, { .v = PowerMenu } }, - { SUPER, Key_Home, spawn, { .v = BufferToggle } }, - { SUPER, Key_End, spawn, { .v = BufferSave } }, - { SUPER, Key_F12, spawn, { .v = RecToggle } }, + // { SUPER, Key_Home, spawn, { .v = BufferToggle } }, + // { SUPER, Key_End, spawn, { .v = BufferSave } }, + // { SUPER, Key_F12, spawn, { .v = RecToggle } }, { SUPER | SHIFT, Key_BackSpace, spawn, { .v = ScreenLock } }, { SUPER, Key_comma, focusmon, { .i = WLR_DIRECTION_LEFT } }, { SUPER, Key_period, focusmon, { .i = WLR_DIRECTION_RIGHT }}, diff --git a/dwl.c b/dwl.c index 9b1018b..d23a63f 100644 --- a/dwl.c +++ b/dwl.c @@ -1027,8 +1027,9 @@ createpointerconstraint(struct wl_listener *listener, void *data) if (active_constraint == pointer_constraint->constraint) return; - if (active_constraint) + if (active_constraint) { wlr_pointer_constraint_v1_send_deactivated(active_constraint); + } active_constraint = pointer_constraint->constraint; wlr_pointer_constraint_v1_send_activated(pointer_constraint->constraint); @@ -1158,14 +1159,16 @@ void cursorwarptohint(void) { Client *c = NULL; - double sx, sy; + double lx, ly; + double sx = active_constraint->current.cursor_hint.x; + double sy = active_constraint->current.cursor_hint.y; toplevel_from_wlr_surface(active_constraint->surface, &c, NULL); /* TODO: wlroots 0.18: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4478 */ if (c && (active_constraint->current.committed & WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT)) { - sx = active_constraint->current.cursor_hint.x + c->mon->m.x + c->bw; - sy = active_constraint->current.cursor_hint.y + c->mon->m.y + c->bw; - wlr_cursor_warp(cursor, NULL, sx - c->geom.x, sy - c->geom.y); + lx = sx + c->mon->m.x + c->geom.x + c->bw; + ly = sy + c->mon->m.y + c->geom.y + c->bw; + wlr_cursor_warp(cursor, NULL, lx, ly); wlr_seat_pointer_warp(seat, sx, sy); } } @@ -1176,7 +1179,7 @@ destroypointerconstraint(struct wl_listener *listener, void *data) PointerConstraint *pointer_constraint = wl_container_of(listener, pointer_constraint, destroy); if (active_constraint == pointer_constraint->constraint) { - // cursorwarptohint(); + cursorwarptohint(); active_constraint = NULL; }