1
0
Fork 0
forked from wry/wry

config: allow disabling the primary selection

This commit is contained in:
Julian Orth 2025-07-20 11:18:32 +02:00
parent e70be28e22
commit 9c165ab56c
13 changed files with 63 additions and 2 deletions

View file

@ -983,6 +983,10 @@ impl ConfigClient {
show
}
pub fn set_middle_click_paste_enabled(&self, enabled: bool) {
self.send(&ClientMessage::SetMiddleClickPasteEnabled { enabled });
}
pub fn set_show_float_pin_icon(&self, show: bool) {
self.send(&ClientMessage::SetShowFloatPinIcon { show });
}

View file

@ -744,6 +744,9 @@ pub enum ClientMessage<'a> {
SeatFocusTiles {
seat: Seat,
},
SetMiddleClickPasteEnabled {
enabled: bool,
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -343,3 +343,13 @@ pub fn toggle_show_bar() {
pub fn on_unload(f: impl FnOnce() + 'static) {
get!().on_unload(f);
}
/// Enables or disables middle-click pasting.
///
/// This has no effect on applications that are already running.
///
/// The default is `true`.
#[doc(alias("primary-selection", "primary_selection"))]
pub fn set_middle_click_paste_enabled(enabled: bool) {
get!().set_middle_click_paste_enabled(enabled);
}