Use Platform::IsWayland in linux_gdk_helper

This commit is contained in:
Ilya Fedin 2020-12-20 17:32:26 +04:00 committed by John Preston
parent 596c7892c7
commit 0ff6c555b1

View file

@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "platform/linux/linux_gdk_helper.h" #include "platform/linux/linux_gdk_helper.h"
#include "platform/linux/linux_libs.h" #include "platform/linux/linux_libs.h"
#include "base/platform/base_platform_info.h"
#include "base/platform/linux/base_xcb_utilities_linux.h" #include "base/platform/linux/base_xcb_utilities_linux.h"
extern "C" { extern "C" {
@ -78,17 +79,19 @@ bool GdkHelperLoaded() {
void XSetTransientForHint(GdkWindow *window, quintptr winId) { void XSetTransientForHint(GdkWindow *window, quintptr winId) {
if (gdk_helper_loaded == GtkLoaded::Gtk2) { if (gdk_helper_loaded == GtkLoaded::Gtk2) {
xcb_change_property( if (!IsWayland()) {
base::Platform::XCB::GetConnectionFromQt(), xcb_change_property(
XCB_PROP_MODE_REPLACE, base::Platform::XCB::GetConnectionFromQt(),
gdk_x11_drawable_get_xid(window), XCB_PROP_MODE_REPLACE,
XCB_ATOM_WM_TRANSIENT_FOR, gdk_x11_drawable_get_xid(window),
XCB_ATOM_WINDOW, XCB_ATOM_WM_TRANSIENT_FOR,
32, XCB_ATOM_WINDOW,
1, 32,
&winId); 1,
&winId);
}
} else if (gdk_helper_loaded == GtkLoaded::Gtk3) { } else if (gdk_helper_loaded == GtkLoaded::Gtk3) {
if (gdk_is_x11_window_check(window)) { if (!IsWayland() && gdk_is_x11_window_check(window)) {
xcb_change_property( xcb_change_property(
base::Platform::XCB::GetConnectionFromQt(), base::Platform::XCB::GetConnectionFromQt(),
XCB_PROP_MODE_REPLACE, XCB_PROP_MODE_REPLACE,