Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk: implement dropping files and strings #4211

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

jcollie
Copy link
Collaborator

@jcollie jcollie commented Dec 31, 2024

This allows dropping files and strings onto Ghostty in the GTK apprt. If you drop files onto Ghostty it will be pasted as a list of shell-escaped paths separated by newlines. If you drop a string onto Ghostty it will paste the string. Normal rules for pasting (bracketed pasts, unsafe pastes) apply.

@jcollie jcollie force-pushed the gtk-drag-and-drop branch from c5053f6 to 5663d63 Compare January 1, 2025 19:38
@jcollie
Copy link
Collaborator Author

jcollie commented Jan 1, 2025

Note, there seem to be some oddities with how Firefox and Chrome (and Chrome-based Electron apps) do drag and drop as I haven't been able to get those working yet. Firefox and/or GTK seems to be broken because I can't drag a text selection from Firefox to the Gnome Text Editor either.

@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 5663d63 to 457fa11 Compare January 1, 2025 19:44
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know when you want a further review.

src/apprt/gtk/Surface.zig Outdated Show resolved Hide resolved
@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 457fa11 to 0442bd7 Compare January 2, 2025 23:33
@jcollie jcollie marked this pull request as ready for review January 3, 2025 00:12
@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 0442bd7 to 18d3cbf Compare January 5, 2025 17:10
src/apprt/gtk/Surface.zig Show resolved Hide resolved
src/apprt/gtk/Surface.zig Outdated Show resolved Hide resolved
src/apprt/gtk/Surface.zig Show resolved Hide resolved
src/apprt/gtk/Surface.zig Show resolved Hide resolved
@tristan957
Copy link
Collaborator

From my perspective this looks good to go.

@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 18d3cbf to 453e89c Compare January 7, 2025 00:49
@jcollie
Copy link
Collaborator Author

jcollie commented Jan 7, 2025

OK, this should be ready to go!

@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 453e89c to e7c71df Compare January 8, 2025 14:39
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One easy request but otherwise looks great. Thanks!

src/os/shell.zig Show resolved Hide resolved
@jcollie jcollie force-pushed the gtk-drag-and-drop branch from 1b43ec9 to c85c277 Compare January 8, 2025 19:19
@mitchellh mitchellh merged commit ef12d90 into ghostty-org:main Jan 8, 2025
24 checks passed
@github-actions github-actions bot added this to the 1.1.0 milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants