implement file drop API.

This commit is contained in:
Miroslav Šedivý
2021-01-06 18:57:50 +01:00
parent 64187964d4
commit 62ba53dc46
4 changed files with 54 additions and 0 deletions

24
internal/desktop/drop.go Normal file
View File

@ -0,0 +1,24 @@
package desktop
import (
"time"
"demodesk/neko/internal/desktop/drop"
)
const (
DELAY = 100 * time.Millisecond
)
func (manager *DesktopManagerCtx) DropFiles(x int, y int, files []string) {
go drop.DragWindow(files)
// TODO: Find a bettter way.
time.Sleep(DELAY)
manager.Move(10, 10)
manager.ButtonDown(1)
manager.Move(x, y)
time.Sleep(DELAY)
manager.Move(x, y)
time.Sleep(DELAY)
manager.ButtonUp(1)
}