Skip to content

X11 Drag/Drop Proxy#12

Closed
x42 wants to merge 2 commits into
lv2:masterfrom
x42:master-rg
Closed

X11 Drag/Drop Proxy#12
x42 wants to merge 2 commits into
lv2:masterfrom
x42:master-rg

Conversation

@x42

@x42 x42 commented Jan 7, 2020

Copy link
Copy Markdown
Member

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

x42 added 2 commits January 7, 2020 14:49
> 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

x42 commented Jan 8, 2020

Copy link
Copy Markdown
Member Author

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.

Comment thread src/x11_in_gtk2.c
}
}
XFree(children);
if (children) {

Copy link
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants