mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
app/internal/window: [X11] handle zero-length clipboard writes correctly
Fixes gio#118 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -401,9 +401,13 @@ func (h *x11EventHandler) handleEvents() bool {
|
|||||||
notify()
|
notify()
|
||||||
case w.atoms.utf8string:
|
case w.atoms.utf8string:
|
||||||
content := w.clipboard.content
|
content := w.clipboard.content
|
||||||
|
var ptr *C.uchar
|
||||||
|
if len(content) > 0 {
|
||||||
|
ptr = (*C.uchar)(unsafe.Pointer(&content[0]))
|
||||||
|
}
|
||||||
C.XChangeProperty(w.x, cevt.requestor, cevt.property, w.atoms.utf8string,
|
C.XChangeProperty(w.x, cevt.requestor, cevt.property, w.atoms.utf8string,
|
||||||
8 /* bitwidth */, C.PropModeReplace,
|
8 /* bitwidth */, C.PropModeReplace,
|
||||||
(*C.uchar)(unsafe.Pointer(&content[0])), C.int(len(content)),
|
ptr, C.int(len(content)),
|
||||||
)
|
)
|
||||||
notify()
|
notify()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user