Skip to content

userhaj/gdext_2_os_drag

Repository files navigation

Run: scons platform=linux

Drag and drop only functions from x11 display server from Godot to linux OS. (maybe only xWayland?)

Does not function from Godot to Godot.

Does not function for any other OS.

Example

var drag_manager = OSDragManager.new()
var xid = DisplayServer.window_get_native_handle(DisplayServer.WINDOW_HANDLE)
var mouse_pos = Vector2i(DisplayServer.mouse_get_position())
var abs_path_to_file = "/home/dropfile"
drag_manager.start_drag(xid, PackedStringArray([abs_path_to_file]), mouse_pos)
func _input(event: InputEvent) -> void:
  if event is InputEventMouseButton:
    if event.is_pressed():

      # Place start drag here
      drag_manager.start_drag(xid, PackedStringArray([abs_path_to_file]), mouse_pos)

About

Drag file from Godot to the OS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors