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

X11 Drag/Drop Proxy #12

Closed
wants to merge 2 commits into from
Closed

X11 Drag/Drop Proxy #12

wants to merge 2 commits into from

Conversation

x42
Copy link
Contributor

@x42 x42 commented Jan 7, 2020

This adds support for Drag/Drop to reparented X11 windows.

A working example plugin to test/debug X11 events: https://github.com/x42/debug.lv2
See also lsp-plugins/lsp-plugins#67

> XDND drag-and-drop does not work with reparented external windows,
> since messages are exchanged with the toplevel window only.
> This is done for performance reasons
(https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html#idm46049203496608)

To address this the XDND specification allows to proxy events to
child windows: https://www.freedesktop.org/wiki/Specifications/XDND/

This is towards fixing Drag/Drop to plugin UIs:
lsp-plugins/lsp-plugins#67

In Ardour's case events have to be proxied from the grand-parent Window
to the embedded child.
@x42
Copy link
Contributor Author

x42 commented Jan 8, 2020

Another data-point. JUCE lets the plugin set this up (not the host). Same approach XdndProxy.

https://forum.juce.com/t/patch-implements-drag-and-drop-for-plugin-windows-on-linux/35203
decomposer/JUCE@25a547e

For LV2 however I think we should follow the mantra: If the host can do it, complexity should rather be on the host side. What do you think?

libsuil could check if the child window is XdndAware before setting up a proxy, but as far as I can tell there's no downside to unconditionally setting XdndProxy.

@@ -83,7 +83,9 @@ x_window_is_valid(SuilX11Wrapper* socket)
return true;
}
}
XFree(children);
if (children) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? XFree(3): "If data is NULL, no operation is performed."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://tronche.com/gui/x/xlib/display/XFree.html
A NULL pointer cannot be passed to this function.

Maybe xlib vs. xcb?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm. Weird.

@drobilla
Copy link
Collaborator

Cool, thanks. I agree this is the best place for it, if possible, which it seems to be...

Currently traveling, I'll give it a try and merge it when I get home.

@drobilla
Copy link
Collaborator

Seems to work fine for me. Merged with some condensing as 7c3e3d6, thanks.

@drobilla drobilla closed this Feb 12, 2020
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.

None yet

2 participants