neko/internal/desktop/gtk/gtk.go

30 lines
402 B
Go
Raw Normal View History

2021-01-08 06:27:50 +13:00
package gtk
2021-01-07 06:27:21 +13:00
/*
2021-01-12 03:57:14 +13:00
#cgo pkg-config: gtk+-3.0
2021-01-07 06:27:21 +13:00
2021-01-08 06:27:50 +13:00
#include "gtk.h"
2021-01-07 06:27:21 +13:00
*/
import "C"
import (
"sync"
)
var mu = sync.Mutex{}
2021-01-07 06:54:55 +13:00
func DragWindow(files []string) {
2021-01-07 06:27:21 +13:00
mu.Lock()
defer mu.Unlock()
2021-01-07 06:54:55 +13:00
size := C.int(len(files))
2021-01-07 06:27:21 +13:00
urisUnsafe := C.uris_make(size);
defer C.uris_free(urisUnsafe, size)
2021-01-07 06:54:55 +13:00
for i, file := range files {
C.uris_set_file(urisUnsafe, C.CString(file), C.int(i))
2021-01-07 06:27:21 +13:00
}
C.drag_window(urisUnsafe)
}