rework _handle_selection()

* do not use timer for selection, due to issue with Engine.time_scale == 0
  * deciding on redraw based on target cell change
  * deciding on send to system based on mouse button up event
  * remove _on_selection_held() timer callback function and SelectionMode enum
* on non-Linux system use clipbord when copy_on_selection is active
This commit is contained in:
Robert Paciorek 2024-07-06 21:51:37 +00:00
parent 64aa0ff49a
commit ca97b654ee
2 changed files with 34 additions and 46 deletions

View file

@ -184,12 +184,9 @@ namespace godot
void _handle_mouse_wheel(Ref<InputEventMouseButton> event);
enum SelectionMode { NONE, POINTER };
bool selecting = false;
SelectionMode selection_mode = SelectionMode::NONE;
Timer *selection_timer;
Vector2i selection_last_point;
void _handle_selection(Ref<InputEventMouse> event);
void _on_selection_held();
typedef std::function<int(struct tsm_screen*, char**)> ScreenCopyFunction;
String _copy_screen(ScreenCopyFunction func);