Add double-click maximise support to the x11 displayserver for the move decoration #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the break in the move section of the buttonpress statement to allow the input event to propagate to the buttonrelease and be processed as a double click to maximise and restore when double-clicking with the left mouse button. (Technically, this also allows the input to propagate to the gui_input signal in the editor itself, so you could just comment out the "
drag_event = true;
" and implement it in the engine with a script instead. But I don't think the implementations for the windows and macos displayservers allow that so probably shouldn't have that inconsistency...)There is also some weirdness where it sometimes only needs a single button press to maximise or restore upon clicking the move decoration and I'm not entirely sure why. Edit: thinking it's because a triple-click and beyond still count as a double-click, so get counted with this implementation.
This is a very rudimentary implementation (and probably just plain bad in general), but it appears to be mostly functional.
It might also be better to implement it in buttonpress(that way you can uncomment "
drag_event = true;
" to prevent the input reaching the rest of the engine) and only apply it upon buttonrelease to match more closely what real titlebars do. But doing that would require implementing a double-click detector that doesn't get broken out of in buttonpress in addition to the one that already exists in buttonrelease