A brief summary of click-to-raise and drag-and-drop interaction on X11 and Wayland

submited by
Style Pass
2024-07-08 16:00:04

The goal is to be able to drag an icon from a background window without immediately raising that window and obscuring the drop target window when using the click-to-focus mode. This is a barebones description of what needs to happen. It assumes familiarity with code, protocols, etc. as needed.

Toolkits and window managers need to cooperate for this to work correctly. If they do not cooperate, nothing changes from how things work now. In other words, either the toolkits or the window managers can change first and nothing will break.

Toolkits need to use the globally active input model. Right now, only some Java toolkits do this, but they fall short of what they need to do.

A unfocused globally active window should set focus to itself by calling XSetInputFocus when it receives a button press that cannot be the beginning of any action except focusing the window. Java toolkits fail to do this, though presumably application developers could do this themselves.

If the button press may be the start of an action, such as a drag, the unfocused globally active window should wait until the user intention is clear before calling XSetInputFocus if at all.

Leave a Comment