mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
fix(wayland): panicking on compositors without protocol support
This allows Ironbar to run on a wider range of compositors, where support for the `wlr_foreign_toplevel` protocol used by focused/launcher, and the `wlr_data_control_device` protocol used by clipboard is missing
This commit is contained in:
parent
53317dbada
commit
963a450ff5
3 changed files with 36 additions and 10 deletions
|
@ -147,6 +147,11 @@ impl Environment {
|
|||
pub fn copy_to_clipboard(&mut self, item: ClipboardItem) {
|
||||
debug!("Copying item to clipboard: {item:?}");
|
||||
|
||||
let Some(data_control_device_manager) = &self.data_control_device_manager_state else {
|
||||
error!("data_control_device_manager not available, cannot copy");
|
||||
return;
|
||||
};
|
||||
|
||||
let seat = self.default_seat();
|
||||
let Some(device) = self
|
||||
.data_control_devices
|
||||
|
@ -156,8 +161,7 @@ impl Environment {
|
|||
return;
|
||||
};
|
||||
|
||||
let source = self
|
||||
.data_control_device_manager_state
|
||||
let source = data_control_device_manager
|
||||
.create_copy_paste_source(&self.queue_handle, [&item.mime_type, INTERNAL_MIME_TYPE]);
|
||||
|
||||
source.set_selection(&device.device);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue