fix(gtk): show the "Copied to clipboard" toast again
The surface's `clipboard-write` signal carries the clipboard kind as a u32 (0 = standard), but the window handler decoded it with glib::EnumValue::from_value, which always returns None for a u32. The "standard clipboard" check therefore always failed and no "Copied to clipboard" / "Cleared clipboard" toast was ever shown (app-notifications = clipboard-copy), neither for keybind copies nor for OSC 52 writes. The handler now takes the u32 directly. Test Plan: - run `printf '\e]52;c;aGVsbG8=\a'`: toast appears, pixel-identical to Ghostty 1.3.1
This commit is contained in:
1 parent
87dde3fafa
commit
8b80ec0988
1 file changed
+6
-7
@@ -1126,8 +1126,8 @@ impl Window {
|
||||
glib::closure_local!(
|
||||
#[weak(rename_to = win)]
|
||||
self,
|
||||
move |_surface: &Surface, clipboard: glib::Value, text: &str| {
|
||||
win.surface_clipboard_write(&clipboard, text);
|
||||
move |_surface: &Surface, clipboard: u32, text: &str| {
|
||||
win.surface_clipboard_write(clipboard, text);
|
||||
}
|
||||
),
|
||||
));
|
||||
@@ -1518,11 +1518,10 @@ impl Window {
|
||||
tab_view.close_page(&page);
|
||||
}
|
||||
|
||||
fn surface_clipboard_write(&self, clipboard: &glib::Value, text: &str) {
|
||||
// We only toast for the standard clipboard.
|
||||
let is_standard = glib::EnumValue::from_value(clipboard)
|
||||
.is_some_and(|(_, v)| v.value() == 0 || v.nick() == "standard");
|
||||
if !is_standard {
|
||||
fn surface_clipboard_write(&self, clipboard: u32, text: &str) {
|
||||
// We only toast for the standard clipboard (encoded as 0 by the
|
||||
// surface's `clipboard-write` signal).
|
||||
if clipboard != 0 {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user