From 7ac4ee713c2a718492a7f33d5ffa051bb865edb3 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 28 Jun 2021 16:15:07 +0200 Subject: [PATCH] Only query XEmbed properties when using Xembed This is mostly just to make this long constructor more readable. --- src/wine-host/editor.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index 0bd4e2c9..829bfab7 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -280,15 +280,17 @@ Editor::Editor(MainContext& main_context, } // When using XEmbed we'll need the atoms for the corresponding properties - atom_cookie = - xcb_intern_atom(x11_connection.get(), true, strlen(xembed_message_name), - xembed_message_name); - atom_reply = - xcb_intern_atom_reply(x11_connection.get(), atom_cookie, &error); - THROW_X11_ERROR(error); + if (use_xembed) { + atom_cookie = + xcb_intern_atom(x11_connection.get(), true, + strlen(xembed_message_name), xembed_message_name); + atom_reply = + xcb_intern_atom_reply(x11_connection.get(), atom_cookie, &error); + THROW_X11_ERROR(error); - xcb_xembed_message = atom_reply->atom; - free(atom_reply); + xcb_xembed_message = atom_reply->atom; + free(atom_reply); + } // When not using XEmbed, Wine will interpret any local coordinates as // global coordinates. To work around this we'll tell the Wine window it's