compositor/dnd: Guard X11 types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2445>
This commit is contained in:
parent
761a254e6f
commit
3e95609073
@ -21,17 +21,22 @@
|
||||
#define META_DND_PRIVATE__H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include "compositor/meta-compositor-x11.h"
|
||||
#endif
|
||||
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "compositor/meta-compositor-x11.h"
|
||||
|
||||
#ifdef HAVE_X11
|
||||
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
MetaCompositorX11 *compositor_x11,
|
||||
Display *xdisplay,
|
||||
XEvent *xev);
|
||||
|
||||
void meta_dnd_init_xdnd (MetaX11Display *x11_display);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor);
|
||||
|
@ -125,6 +125,7 @@ meta_dnd_get_backend (MetaDnd *dnd)
|
||||
return priv->backend;
|
||||
}
|
||||
|
||||
#ifdef HAVE_X11
|
||||
void
|
||||
meta_dnd_init_xdnd (MetaX11Display *x11_display)
|
||||
{
|
||||
@ -155,6 +156,7 @@ meta_dnd_init_xdnd (MetaX11Display *x11_display)
|
||||
XInternAtom (xdisplay, "XdndProxy", False), XA_WINDOW,
|
||||
32, PropModeReplace, (const unsigned char *) &xwindow, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
meta_dnd_notify_dnd_enter (MetaDnd *dnd)
|
||||
@ -184,6 +186,7 @@ meta_dnd_notify_dnd_leave (MetaDnd *dnd)
|
||||
*
|
||||
* http://www.freedesktop.org/wiki/Specifications/XDND
|
||||
*/
|
||||
#ifdef HAVE_X11
|
||||
gboolean
|
||||
meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
MetaCompositorX11 *compositor_x11,
|
||||
@ -243,6 +246,7 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
static MetaWaylandDataDevice *
|
||||
|
@ -1429,8 +1429,10 @@ meta_x11_display_new (MetaDisplay *display,
|
||||
meta_x11_startup_notification_init (x11_display);
|
||||
meta_x11_selection_init (x11_display);
|
||||
|
||||
#ifdef HAVE_X11
|
||||
if (!meta_is_wayland_compositor ())
|
||||
meta_dnd_init_xdnd (x11_display);
|
||||
#endif
|
||||
|
||||
sprintf (buf, "WM_S%d", number);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user