X11: Allow drag and drop of text/plain in addition to text/uri-list
Fixes #2441
This commit is contained in:
parent
342f0981d8
commit
e827e6fa21
@ -77,6 +77,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Workaround for bug in less that causes colors to reset at wrapped lines
|
||||
(:iss:`2381`)
|
||||
|
||||
- X11: Allow drag and drop of text/plain in addition to text/uri-list
|
||||
(:iss:`2441`)
|
||||
|
||||
- Dont strip :code:`&` and :code:`-` from the end of URLs (:iss:`2436`)
|
||||
|
||||
- Fix ``@selection`` placeholder not working with launch command (:iss:`2417`)
|
||||
|
||||
2
glfw/x11_init.c
vendored
2
glfw/x11_init.c
vendored
@ -385,6 +385,8 @@ static bool initExtensions(void)
|
||||
_glfw.x11.XdndSelection = XInternAtom(_glfw.x11.display, "XdndSelection", False);
|
||||
_glfw.x11.XdndTypeList = XInternAtom(_glfw.x11.display, "XdndTypeList", False);
|
||||
_glfw.x11.text_uri_list = XInternAtom(_glfw.x11.display, "text/uri-list", False);
|
||||
_glfw.x11.text_plain = XInternAtom(_glfw.x11.display, "text/plain", False);
|
||||
_glfw.x11.text_plain_utf8 = XInternAtom(_glfw.x11.display, "text/plain;charset=utf-8", False);
|
||||
|
||||
// ICCCM, EWMH and Motif window property atoms
|
||||
// These can be set safely even without WM support
|
||||
|
||||
2
glfw/x11_platform.h
vendored
2
glfw/x11_platform.h
vendored
@ -267,6 +267,8 @@ typedef struct _GLFWlibraryX11
|
||||
Atom XdndSelection;
|
||||
Atom XdndTypeList;
|
||||
Atom text_uri_list;
|
||||
Atom text_plain;
|
||||
Atom text_plain_utf8;
|
||||
|
||||
// Selection (clipboard) atoms
|
||||
Atom TARGETS;
|
||||
|
||||
4
glfw/x11_window.c
vendored
4
glfw/x11_window.c
vendored
@ -1478,6 +1478,10 @@ static void processEvent(XEvent *event)
|
||||
{
|
||||
_glfw.x11.xdnd.format = _glfw.x11.text_uri_list;
|
||||
break;
|
||||
} else if (formats[i] == _glfw.x11.text_plain_utf8 && (_glfw.x11.xdnd.format == None || _glfw.x11.xdnd.format == _glfw.x11.text_plain)) {
|
||||
_glfw.x11.xdnd.format = _glfw.x11.text_plain_utf8;
|
||||
} else if (formats[i] == _glfw.x11.text_plain && _glfw.x11.xdnd.format == None) {
|
||||
_glfw.x11.xdnd.format = _glfw.x11.text_plain;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user