neko/internal/desktop/gtk.go

31 lines
485 B
Go
Raw Normal View History

2021-01-07 06:57:50 +13:00
package desktop
import (
"time"
2021-01-10 04:40:24 +13:00
2021-01-08 06:27:50 +13:00
"demodesk/neko/internal/desktop/gtk"
2021-01-07 06:57:50 +13:00
)
const (
DELAY = 100 * time.Millisecond
)
func (manager *DesktopManagerCtx) DropFiles(x int, y int, files []string) {
2021-01-09 10:03:50 +13:00
mu.Lock()
defer mu.Unlock()
2021-01-08 06:27:50 +13:00
go gtk.DragWindow(files)
2021-01-07 06:57:50 +13:00
// TODO: Find a bettter way.
time.Sleep(DELAY)
2021-01-10 04:40:24 +13:00
manager.Move(0, 0)
2021-01-07 06:57:50 +13:00
manager.ButtonDown(1)
manager.Move(x, y)
time.Sleep(DELAY)
manager.Move(x, y)
time.Sleep(DELAY)
manager.Move(x, y)
time.Sleep(DELAY)
2021-01-07 06:57:50 +13:00
manager.ButtonUp(1)
}