neko/internal/desktop/gtk/gtk.go
Miroslav Šedivý 94a9c7c10a tidy up C files.
2021-01-11 15:57:14 +01:00

30 lines
402 B
Go

package gtk
/*
#cgo pkg-config: gtk+-3.0
#include "gtk.h"
*/
import "C"
import (
"sync"
)
var mu = sync.Mutex{}
func DragWindow(files []string) {
mu.Lock()
defer mu.Unlock()
size := C.int(len(files))
urisUnsafe := C.uris_make(size);
defer C.uris_free(urisUnsafe, size)
for i, file := range files {
C.uris_set_file(urisUnsafe, C.CString(file), C.int(i))
}
C.drag_window(urisUnsafe)
}