30 lines
402 B
Go
Raw Normal View History

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