diff --git a/patches/primaryselection/README.md b/patches/primaryselection/README.md index 1154452..8f50004 100644 --- a/patches/primaryselection/README.md +++ b/patches/primaryselection/README.md @@ -3,7 +3,8 @@ Adds a config option to disable/enable primary selection (middle-click paste). ### Download - [git branch](https://codeberg.org/nullsystem/dwl/src/branch/main_primaryselection) -- [2024-04-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/primaryselection/primaryselection.patch) +- [2025-11-19](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/primaryselection/primaryselection.patch) +- [2024-04-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/primaryselection/primaryselection-2024-04-06.patch) ### Authors - [nullsystem](https://codeberg.org/nullsystem) diff --git a/patches/primaryselection/primaryselection-2024-04-06.patch b/patches/primaryselection/primaryselection-2024-04-06.patch new file mode 100644 index 0000000..ab6bb64 --- /dev/null +++ b/patches/primaryselection/primaryselection-2024-04-06.patch @@ -0,0 +1,50 @@ +From 4fc77fde2f6015564544e029f9905fc1678fcb59 Mon Sep 17 00:00:00 2001 +From: nullsystem +Date: Sat, 6 Apr 2024 14:19:44 +0100 +Subject: [PATCH] primaryselection - disable/enable primary selection + +* Just simply adds a config to disable/enable primary selection +--- + config.def.h | 1 + + dwl.c | 6 ++++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 8847e58..057e1c3 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -66,6 +66,7 @@ static const int natural_scrolling = 0; + static const int disable_while_typing = 1; + static const int left_handed = 0; + static const int middle_button_emulation = 0; ++static const int enable_primary_selection = 0; + /* You can choose between: + LIBINPUT_CONFIG_SCROLL_NO_SCROLL + LIBINPUT_CONFIG_SCROLL_2FG +diff --git a/dwl.c b/dwl.c +index bf763df..7e8d8f2 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -2339,7 +2339,8 @@ setup(void) + wlr_export_dmabuf_manager_v1_create(dpy); + wlr_screencopy_manager_v1_create(dpy); + wlr_data_control_manager_v1_create(dpy); +- wlr_primary_selection_v1_device_manager_create(dpy); ++ if (enable_primary_selection) ++ wlr_primary_selection_v1_device_manager_create(dpy); + wlr_viewporter_create(dpy); + wlr_single_pixel_buffer_manager_v1_create(dpy); + wlr_fractional_scale_manager_v1_create(dpy, 1); +@@ -2449,7 +2450,8 @@ setup(void) + seat = wlr_seat_create(dpy, "seat0"); + LISTEN_STATIC(&seat->events.request_set_cursor, setcursor); + LISTEN_STATIC(&seat->events.request_set_selection, setsel); +- LISTEN_STATIC(&seat->events.request_set_primary_selection, setpsel); ++ if (enable_primary_selection) ++ LISTEN_STATIC(&seat->events.request_set_primary_selection, setpsel); + LISTEN_STATIC(&seat->events.request_start_drag, requeststartdrag); + LISTEN_STATIC(&seat->events.start_drag, startdrag); + +-- +2.44.0 + diff --git a/patches/primaryselection/primaryselection.patch b/patches/primaryselection/primaryselection.patch index ab6bb64..b25b083 100644 --- a/patches/primaryselection/primaryselection.patch +++ b/patches/primaryselection/primaryselection.patch @@ -1,19 +1,20 @@ -From 4fc77fde2f6015564544e029f9905fc1678fcb59 Mon Sep 17 00:00:00 2001 -From: nullsystem -Date: Sat, 6 Apr 2024 14:19:44 +0100 -Subject: [PATCH] primaryselection - disable/enable primary selection +From 57d50147a2ffd91e6c10c12162dd4a55c451485c Mon Sep 17 00:00:00 2001 +From: nullsystem +Date: Wed, 19 Nov 2025 22:35:24 +0000 +Subject: [PATCH] [PATCH] primaryselection - disable/enable primary selection * Just simply adds a config to disable/enable primary selection +* 2025-11-19 update --- config.def.h | 1 + dwl.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h -index 8847e58..057e1c3 100644 +index 95c2afa..1d143db 100644 --- a/config.def.h +++ b/config.def.h -@@ -66,6 +66,7 @@ static const int natural_scrolling = 0; +@@ -71,6 +71,7 @@ static const int natural_scrolling = 0; static const int disable_while_typing = 1; static const int left_handed = 0; static const int middle_button_emulation = 0; @@ -22,10 +23,10 @@ index 8847e58..057e1c3 100644 LIBINPUT_CONFIG_SCROLL_NO_SCROLL LIBINPUT_CONFIG_SCROLL_2FG diff --git a/dwl.c b/dwl.c -index bf763df..7e8d8f2 100644 +index 12f441e..3a026b4 100644 --- a/dwl.c +++ b/dwl.c -@@ -2339,7 +2339,8 @@ setup(void) +@@ -2517,7 +2517,8 @@ setup(void) wlr_export_dmabuf_manager_v1_create(dpy); wlr_screencopy_manager_v1_create(dpy); wlr_data_control_manager_v1_create(dpy); @@ -35,16 +36,16 @@ index bf763df..7e8d8f2 100644 wlr_viewporter_create(dpy); wlr_single_pixel_buffer_manager_v1_create(dpy); wlr_fractional_scale_manager_v1_create(dpy, 1); -@@ -2449,7 +2450,8 @@ setup(void) +@@ -2634,7 +2635,8 @@ setup(void) seat = wlr_seat_create(dpy, "seat0"); - LISTEN_STATIC(&seat->events.request_set_cursor, setcursor); - LISTEN_STATIC(&seat->events.request_set_selection, setsel); -- LISTEN_STATIC(&seat->events.request_set_primary_selection, setpsel); + wl_signal_add(&seat->events.request_set_cursor, &request_cursor); + wl_signal_add(&seat->events.request_set_selection, &request_set_sel); +- wl_signal_add(&seat->events.request_set_primary_selection, &request_set_psel); + if (enable_primary_selection) -+ LISTEN_STATIC(&seat->events.request_set_primary_selection, setpsel); - LISTEN_STATIC(&seat->events.request_start_drag, requeststartdrag); - LISTEN_STATIC(&seat->events.start_drag, startdrag); ++ wl_signal_add(&seat->events.request_set_primary_selection, &request_set_psel); + wl_signal_add(&seat->events.request_start_drag, &request_start_drag); + wl_signal_add(&seat->events.start_drag, &start_drag); -- -2.44.0 +2.52.0