app/internal/window: use unsafe pointer to array

Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
This commit is contained in:
Walter Werner SCHNEIDER
2020-12-04 23:31:57 +02:00
committed by Elias Naur
parent e9a75cc22a
commit feb93baee0
+2 -2
View File
@@ -459,7 +459,7 @@ func (h *x11EventHandler) handleEvents() bool {
case w.atoms.targets:
// The requestor wants the supported clipboard
// formats. First write the targets...
formats := []C.long{
formats := [...]C.long{
C.long(w.atoms.targets),
C.long(w.atoms.utf8string),
C.long(w.atoms.plaintext),
@@ -468,7 +468,7 @@ func (h *x11EventHandler) handleEvents() bool {
}
C.XChangeProperty(w.x, cevt.requestor, cevt.property, w.atoms.atom,
32 /* bitwidth of formats */, C.PropModeReplace,
(*C.uchar)(unsafe.Pointer(&formats[0])), C.int(len(formats)),
(*C.uchar)(unsafe.Pointer(&formats)), C.int(len(formats)),
)
// ...then notify the requestor.
notify()