aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-12-18 02:36:49 +0100
committerdec05eba <dec05eba@protonmail.com>2022-12-18 02:36:49 +0100
commit6b1767cb3cc704b94acbc5b4ebf3ee8c5c2b9102 (patch)
tree1a2b4dc91b43187375697b9e3efc571825c98468
parentaf1a278867f879f74a676fb3c07a34d2c0e60791 (diff)
Fix issue where images cant be pasted from clipboard if mgl is the first application that uses image/--- atoms
-rw-r--r--src/window/window.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/window/window.c b/src/window/window.c
index 481d17a..6927992 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -140,11 +140,11 @@ static int x11_context_init(x11_context *self, bool alpha) {
self->clipboard_atom = XInternAtom(context->connection, "CLIPBOARD", False);
self->targets_atom = XInternAtom(context->connection, "TARGETS", False);
self->text_atom = XInternAtom(context->connection, "TEXT", False);
- self->utf8_string_atom = XInternAtom(context->connection, "UTF8_STRING", True);
- self->image_png = XInternAtom(context->connection, "image/png", True);
- self->image_jpg = XInternAtom(context->connection, "image/jpg", True);
- self->image_jpeg = XInternAtom(context->connection, "image/jpeg", True);
- self->image_gif = XInternAtom(context->connection, "image/gif", True);
+ self->utf8_string_atom = XInternAtom(context->connection, "UTF8_STRING", False);
+ self->image_png = XInternAtom(context->connection, "image/png", False);
+ self->image_jpg = XInternAtom(context->connection, "image/jpg", False);
+ self->image_jpeg = XInternAtom(context->connection, "image/jpeg", False);
+ self->image_gif = XInternAtom(context->connection, "image/gif", False);
self->incr_atom = XInternAtom(context->connection, "INCR", False);
self->default_cursor = None;
self->invisible_cursor = None;
@@ -1069,12 +1069,6 @@ bool mgl_window_get_clipboard(mgl_window *self, mgl_clipboard_callback callback,
Atom supported_clipboard_types[7];
int supported_clipboard_type_index = 0;
- if(clipboard_types & MGL_CLIPBOARD_TYPE_STRING) {
- supported_clipboard_types[supported_clipboard_type_index++] = x11_context->utf8_string_atom;
- supported_clipboard_types[supported_clipboard_type_index++] = XA_STRING;
- supported_clipboard_types[supported_clipboard_type_index++] = x11_context->text_atom;
- }
-
if(clipboard_types & MGL_CLIPBOARD_TYPE_IMAGE_PNG) {
supported_clipboard_types[supported_clipboard_type_index++] = x11_context->image_png;
}
@@ -1087,6 +1081,12 @@ bool mgl_window_get_clipboard(mgl_window *self, mgl_clipboard_callback callback,
supported_clipboard_types[supported_clipboard_type_index++] = x11_context->image_gif;
}
+ if(clipboard_types & MGL_CLIPBOARD_TYPE_STRING) {
+ supported_clipboard_types[supported_clipboard_type_index++] = x11_context->utf8_string_atom;
+ supported_clipboard_types[supported_clipboard_type_index++] = XA_STRING;
+ supported_clipboard_types[supported_clipboard_type_index++] = x11_context->text_atom;
+ }
+
const unsigned long num_supported_clipboard_types = supported_clipboard_type_index;
Atom requested_clipboard_type = None;