From f21cc690527010918d10638cfc7747df3eede496 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Fri, 28 Apr 2023 12:20:11 +0200 Subject: [PATCH] frames: Disable XDND support on the frame window All X11 surfaces created by gtk4 claim to support XDND via the XdndAware property. This was leading some clients, e.g. Qt, to consider the frame window as drop target instead of the client window. Avoid this issue by removing the XdndAware property again after gtk has created the surface. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2715 Part-of: (cherry picked from commit d643eb5c6fe50e7f1afffda0e8747a87f668a799) --- src/frames/meta-frame.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frames/meta-frame.c b/src/frames/meta-frame.c index be685c51fc..345751ad14 100644 --- a/src/frames/meta-frame.c +++ b/src/frames/meta-frame.c @@ -504,6 +504,7 @@ frame_sync_wm_state (MetaFrame *frame, GtkWidget * meta_frame_new (Window window) { + GdkDisplay *display; GtkWidget *frame, *header, *content; GdkSurface *surface; int frame_height = 0; @@ -549,6 +550,13 @@ meta_frame_new (Window window) frame_sync_motif_wm_hints (GTK_WINDOW (frame), window); frame_sync_wm_normal_hints (GTK_WINDOW (frame), window); + /* Disable XDND support on the frame window, because it can cause some clients + * to try use it instead of the client window as drop target */ + display = gtk_widget_get_display (GTK_WIDGET (frame)); + XDeleteProperty (gdk_x11_display_get_xdisplay (display), + gdk_x11_surface_get_xid (surface), + gdk_x11_get_xatom_by_name_for_display (display, "XdndAware")); + return frame; } -- GitLab