build: Allow building xwayland without x11
Co-authored-by: Jonas Ådahl <jadahl@gmail.com> Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3553 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
This commit is contained in:
parent
4134d12789
commit
820a7ad813
15 changed files with 84 additions and 50 deletions
|
@ -34,7 +34,7 @@ if have_egl
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if have_x11_client
|
if have_x11
|
||||||
cogl_pkg_deps += [
|
cogl_pkg_deps += [
|
||||||
x11_dep,
|
x11_dep,
|
||||||
]
|
]
|
||||||
|
|
|
@ -192,14 +192,14 @@ if have_egl
|
||||||
egl_dep = dependency('egl')
|
egl_dep = dependency('egl')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
have_glx = get_option('glx') and have_x11_client
|
have_glx = get_option('glx') and have_x11
|
||||||
if have_glx
|
if have_glx
|
||||||
if not have_gl
|
if not have_gl
|
||||||
error('GLX support requires OpenGL to be enabled')
|
error('GLX support requires OpenGL to be enabled')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
have_egl_xlib = have_egl and have_x11_client
|
have_egl_xlib = have_egl and have_x11
|
||||||
|
|
||||||
have_gles2 = get_option('gles2')
|
have_gles2 = get_option('gles2')
|
||||||
if have_gles2
|
if have_gles2
|
||||||
|
|
|
@ -33,7 +33,7 @@ mtk_pkg_deps = [
|
||||||
pixman_dep,
|
pixman_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
if have_x11
|
if have_x11_client
|
||||||
mtk_pkg_deps += x11_dep
|
mtk_pkg_deps += x11_dep
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ mtk_sources = [
|
||||||
'mtk-region.c',
|
'mtk-region.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
if have_x11
|
if have_x11_client
|
||||||
mtk_sources += 'mtk-x11-errors.c'
|
mtk_sources += 'mtk-x11-errors.c'
|
||||||
mtk_headers += [
|
mtk_headers += [
|
||||||
'mtk-x11-errors.h',
|
'mtk-x11-errors.h',
|
||||||
|
|
|
@ -437,6 +437,7 @@ has_shadow (MetaWindowActorX11 *actor_x11)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
gboolean
|
gboolean
|
||||||
meta_window_actor_x11_should_unredirect (MetaWindowActorX11 *actor_x11)
|
meta_window_actor_x11_should_unredirect (MetaWindowActorX11 *actor_x11)
|
||||||
{
|
{
|
||||||
|
@ -478,6 +479,7 @@ meta_window_actor_x11_set_unredirected (MetaWindowActorX11 *actor_x11,
|
||||||
surface_x11 = META_SURFACE_ACTOR_X11 (surface);
|
surface_x11 = META_SURFACE_ACTOR_X11 (surface);
|
||||||
meta_surface_actor_x11_set_unredirected (surface_x11, unredirected);
|
meta_surface_actor_x11_set_unredirected (surface_x11, unredirected);
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_X11 */
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_shadow_class (MetaWindowActorX11 *actor_x11)
|
get_shadow_class (MetaWindowActorX11 *actor_x11)
|
||||||
|
@ -1013,9 +1015,11 @@ is_actor_maybe_transparent (MetaWindowActorX11 *actor_x11)
|
||||||
if (!surface)
|
if (!surface)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
||||||
meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
|
meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
stex = meta_surface_actor_get_texture (surface);
|
stex = meta_surface_actor_get_texture (surface);
|
||||||
if (!meta_shaped_texture_has_alpha (stex))
|
if (!meta_shaped_texture_has_alpha (stex))
|
||||||
|
@ -1148,9 +1152,11 @@ handle_updates (MetaWindowActorX11 *actor_x11)
|
||||||
meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
|
meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
||||||
meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
|
meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface)))
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
window = meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
window = meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
||||||
if (meta_window_actor_is_frozen (META_WINDOW_ACTOR (actor_x11)))
|
if (meta_window_actor_is_frozen (META_WINDOW_ACTOR (actor_x11)))
|
||||||
|
@ -1168,6 +1174,7 @@ handle_updates (MetaWindowActorX11 *actor_x11)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (META_IS_SURFACE_ACTOR_X11 (surface))
|
if (META_IS_SURFACE_ACTOR_X11 (surface))
|
||||||
{
|
{
|
||||||
MetaSurfaceActorX11 *surface_x11 = META_SURFACE_ACTOR_X11 (surface);
|
MetaSurfaceActorX11 *surface_x11 = META_SURFACE_ACTOR_X11 (surface);
|
||||||
|
@ -1178,6 +1185,7 @@ handle_updates (MetaWindowActorX11 *actor_x11)
|
||||||
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
if (META_IS_SURFACE_ACTOR_X11 (surface) &&
|
||||||
!meta_surface_actor_x11_is_visible (META_SURFACE_ACTOR_X11 (surface)))
|
!meta_surface_actor_x11_is_visible (META_SURFACE_ACTOR_X11 (surface)))
|
||||||
return;
|
return;
|
||||||
|
#endif /* HAVE_X11 */
|
||||||
|
|
||||||
update_frame_bounds (actor_x11);
|
update_frame_bounds (actor_x11);
|
||||||
check_needs_reshape (actor_x11);
|
check_needs_reshape (actor_x11);
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <X11/extensions/Xdamage.h>
|
||||||
|
|
||||||
#include "compositor/meta-window-actor-private.h"
|
#include "compositor/meta-window-actor-private.h"
|
||||||
|
|
||||||
#define META_TYPE_WINDOW_ACTOR_X11 (meta_window_actor_x11_get_type())
|
#define META_TYPE_WINDOW_ACTOR_X11 (meta_window_actor_x11_get_type())
|
||||||
|
@ -31,10 +33,12 @@ G_DECLARE_FINAL_TYPE (MetaWindowActorX11,
|
||||||
void meta_window_actor_x11_process_x11_damage (MetaWindowActorX11 *actor_x11,
|
void meta_window_actor_x11_process_x11_damage (MetaWindowActorX11 *actor_x11,
|
||||||
XDamageNotifyEvent *event);
|
XDamageNotifyEvent *event);
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
gboolean meta_window_actor_x11_should_unredirect (MetaWindowActorX11 *actor_x11);
|
gboolean meta_window_actor_x11_should_unredirect (MetaWindowActorX11 *actor_x11);
|
||||||
|
|
||||||
void meta_window_actor_x11_set_unredirected (MetaWindowActorX11 *actor_x11,
|
void meta_window_actor_x11_set_unredirected (MetaWindowActorX11 *actor_x11,
|
||||||
gboolean unredirected);
|
gboolean unredirected);
|
||||||
|
#endif
|
||||||
|
|
||||||
void meta_window_actor_x11_update_shape (MetaWindowActorX11 *actor_x11);
|
void meta_window_actor_x11_update_shape (MetaWindowActorX11 *actor_x11);
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ init_surface_actor (MetaWindowActor *self)
|
||||||
MetaWindow *window = priv->window;
|
MetaWindow *window = priv->window;
|
||||||
MetaSurfaceActor *surface_actor = NULL;
|
MetaSurfaceActor *surface_actor = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
if (!meta_is_wayland_compositor ())
|
if (!meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
surface_actor = meta_surface_actor_x11_new (window);
|
surface_actor = meta_surface_actor_x11_new (window);
|
||||||
|
@ -953,7 +953,7 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||||
|
|
||||||
/* When running as a Wayland compositor we catch size changes when new
|
/* When running as a Wayland compositor we catch size changes when new
|
||||||
* buffers are attached */
|
* buffers are attached */
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
if (META_IS_SURFACE_ACTOR_X11 (priv->surface))
|
if (META_IS_SURFACE_ACTOR_X11 (priv->surface))
|
||||||
meta_surface_actor_x11_set_size (META_SURFACE_ACTOR_X11 (priv->surface),
|
meta_surface_actor_x11_set_size (META_SURFACE_ACTOR_X11 (priv->surface),
|
||||||
actor_rect.width, actor_rect.height);
|
actor_rect.width, actor_rect.height);
|
||||||
|
|
|
@ -664,7 +664,7 @@ create_compositor (MetaDisplay *display)
|
||||||
if (META_IS_BACKEND_NATIVE (backend))
|
if (META_IS_BACKEND_NATIVE (backend))
|
||||||
return META_COMPOSITOR (meta_compositor_native_new (display, backend));
|
return META_COMPOSITOR (meta_compositor_native_new (display, backend));
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_XWAYLAND
|
#if defined(HAVE_XWAYLAND) && defined(HAVE_X11)
|
||||||
if (META_IS_BACKEND_X11_NESTED (backend))
|
if (META_IS_BACKEND_X11_NESTED (backend))
|
||||||
return META_COMPOSITOR (meta_compositor_server_new (display, backend));
|
return META_COMPOSITOR (meta_compositor_server_new (display, backend));
|
||||||
#endif
|
#endif
|
||||||
|
@ -801,7 +801,7 @@ disable_input_capture (MetaInputCapture *input_capture,
|
||||||
priv->enable_input_capture = FALSE;
|
priv->enable_input_capture = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_display_init_x11_display (MetaDisplay *display,
|
meta_display_init_x11_display (MetaDisplay *display,
|
||||||
GError **error)
|
GError **error)
|
||||||
|
@ -860,7 +860,6 @@ meta_display_init_x11_finish (MetaDisplay *display,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
|
||||||
static void
|
static void
|
||||||
on_xserver_started (MetaXWaylandManager *manager,
|
on_xserver_started (MetaXWaylandManager *manager,
|
||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
|
@ -889,7 +888,6 @@ on_xserver_started (MetaXWaylandManager *manager,
|
||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_XWAYLAND */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_display_init_x11 (MetaDisplay *display,
|
meta_display_init_x11 (MetaDisplay *display,
|
||||||
|
@ -898,21 +896,17 @@ meta_display_init_x11 (MetaDisplay *display,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_autoptr (GTask) task = NULL;
|
g_autoptr (GTask) task = NULL;
|
||||||
#ifdef HAVE_XWAYLAND
|
|
||||||
MetaWaylandCompositor *compositor;
|
MetaWaylandCompositor *compositor;
|
||||||
#endif
|
|
||||||
|
|
||||||
task = g_task_new (display, cancellable, callback, user_data);
|
task = g_task_new (display, cancellable, callback, user_data);
|
||||||
g_task_set_source_tag (task, meta_display_init_x11);
|
g_task_set_source_tag (task, meta_display_init_x11);
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
|
||||||
compositor = wayland_compositor_from_display (display);
|
compositor = wayland_compositor_from_display (display);
|
||||||
|
|
||||||
meta_xwayland_start_xserver (&compositor->xwayland_manager,
|
meta_xwayland_start_xserver (&compositor->xwayland_manager,
|
||||||
cancellable,
|
cancellable,
|
||||||
(GAsyncReadyCallback) on_xserver_started,
|
(GAsyncReadyCallback) on_xserver_started,
|
||||||
g_steal_pointer (&task));
|
g_steal_pointer (&task));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -178,7 +178,7 @@ sequence_is_pointer_emulated (MetaDisplay *display,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
static void
|
static void
|
||||||
maybe_unfreeze_pointer_events (MetaBackend *backend,
|
maybe_unfreeze_pointer_events (MetaBackend *backend,
|
||||||
const ClutterEvent *event,
|
const ClutterEvent *event,
|
||||||
|
@ -424,7 +424,7 @@ meta_display_handle_event (MetaDisplay *display,
|
||||||
if (meta_window_handle_ungrabbed_event (window, event))
|
if (meta_window_handle_ungrabbed_event (window, event))
|
||||||
return CLUTTER_EVENT_STOP;
|
return CLUTTER_EVENT_STOP;
|
||||||
|
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
/* Now replay the button press event to release our own sync grab. */
|
/* Now replay the button press event to release our own sync grab. */
|
||||||
maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_REPLAY);
|
maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_REPLAY);
|
||||||
#endif
|
#endif
|
||||||
|
@ -441,7 +441,7 @@ meta_display_handle_event (MetaDisplay *display,
|
||||||
/* We could not match the event with a window, make sure we sync
|
/* We could not match the event with a window, make sure we sync
|
||||||
* the pointer to discard the sequence and don't keep events frozen.
|
* the pointer to discard the sequence and don't keep events frozen.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_X11_CLIENT
|
#ifdef HAVE_X11
|
||||||
maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_SYNC);
|
maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_SYNC);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "core/util-private.h"
|
#include "core/util-private.h"
|
||||||
#include "meta/display.h"
|
#include "meta/display.h"
|
||||||
#include "meta/window.h"
|
#include "meta/window.h"
|
||||||
|
|
|
@ -97,7 +97,7 @@ if have_introspection
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if have_x11
|
if have_x11_client
|
||||||
mutter_pkg_deps += [
|
mutter_pkg_deps += [
|
||||||
xfixes_dep,
|
xfixes_dep,
|
||||||
xi_dep,
|
xi_dep,
|
||||||
|
@ -451,17 +451,17 @@ if have_x11
|
||||||
'backends/x11/nested/meta-stage-x11-nested.h',
|
'backends/x11/nested/meta-stage-x11-nested.h',
|
||||||
'backends/x11/nested/meta-renderer-x11-nested.c',
|
'backends/x11/nested/meta-renderer-x11-nested.c',
|
||||||
'backends/x11/nested/meta-renderer-x11-nested.h',
|
'backends/x11/nested/meta-renderer-x11-nested.h',
|
||||||
]
|
|
||||||
endif
|
|
||||||
|
|
||||||
if have_x11_client
|
|
||||||
mutter_sources += [
|
|
||||||
'compositor/meta-compositor-x11.c',
|
'compositor/meta-compositor-x11.c',
|
||||||
'compositor/meta-compositor-x11.h',
|
'compositor/meta-compositor-x11.h',
|
||||||
'compositor/meta-surface-actor-x11.c',
|
'compositor/meta-surface-actor-x11.c',
|
||||||
'compositor/meta-surface-actor-x11.h',
|
'compositor/meta-surface-actor-x11.h',
|
||||||
'compositor/meta-sync-ring.c',
|
'compositor/meta-sync-ring.c',
|
||||||
'compositor/meta-sync-ring.h',
|
'compositor/meta-sync-ring.h',
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if have_x11_client
|
||||||
|
mutter_sources += [
|
||||||
'compositor/meta-window-actor-x11.c',
|
'compositor/meta-window-actor-x11.c',
|
||||||
'compositor/meta-window-actor-x11.h',
|
'compositor/meta-window-actor-x11.h',
|
||||||
'x11/atomnames.h',
|
'x11/atomnames.h',
|
||||||
|
|
|
@ -1850,11 +1850,12 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
{
|
{
|
||||||
MetaDisplay *display = x11_display->display;
|
MetaDisplay *display = x11_display->display;
|
||||||
MetaContext *context = meta_display_get_context (display);
|
MetaContext *context = meta_display_get_context (display);
|
||||||
MetaBackend *backend = meta_context_get_backend (context);
|
#ifdef HAVE_X11
|
||||||
Window modified;
|
|
||||||
gboolean bypass_compositor = FALSE;
|
|
||||||
XIEvent *input_event;
|
|
||||||
MetaCursorTracker *cursor_tracker;
|
MetaCursorTracker *cursor_tracker;
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
|
#endif
|
||||||
|
gboolean bypass_compositor G_GNUC_UNUSED = FALSE;
|
||||||
|
XIEvent *input_event;
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaWaylandCompositor *wayland_compositor;
|
MetaWaylandCompositor *wayland_compositor;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1897,8 +1898,10 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
|
|
||||||
display->current_time = event_get_time (x11_display, event);
|
display->current_time = event_get_time (x11_display, event);
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (META_IS_BACKEND_X11 (backend))
|
if (META_IS_BACKEND_X11 (backend))
|
||||||
meta_backend_x11_reset_cached_logical_monitor (META_BACKEND_X11 (backend));
|
meta_backend_x11_reset_cached_logical_monitor (META_BACKEND_X11 (backend));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (x11_display->focused_by_us &&
|
if (x11_display->focused_by_us &&
|
||||||
event->xany.serial > x11_display->focus_serial &&
|
event->xany.serial > x11_display->focus_serial &&
|
||||||
|
@ -1915,6 +1918,7 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
x11_display->is_server_focus = FALSE;
|
x11_display->is_server_focus = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (event->xany.window == x11_display->xroot)
|
if (event->xany.window == x11_display->xroot)
|
||||||
{
|
{
|
||||||
cursor_tracker = meta_backend_get_cursor_tracker (backend);
|
cursor_tracker = meta_backend_get_cursor_tracker (backend);
|
||||||
|
@ -1930,8 +1934,7 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
modified = event_get_modified_window (x11_display, event);
|
|
||||||
|
|
||||||
input_event = get_input_event (x11_display, event);
|
input_event = get_input_event (x11_display, event);
|
||||||
|
|
||||||
|
@ -1950,11 +1953,15 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (!bypass_compositor && META_IS_COMPOSITOR_X11 (display->compositor))
|
if (!bypass_compositor && META_IS_COMPOSITOR_X11 (display->compositor))
|
||||||
{
|
{
|
||||||
MetaCompositorX11 *compositor_x11 =
|
MetaCompositorX11 *compositor_x11 =
|
||||||
META_COMPOSITOR_X11 (display->compositor);
|
META_COMPOSITOR_X11 (display->compositor);
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
Window modified;
|
||||||
|
|
||||||
|
modified = event_get_modified_window (x11_display, event);
|
||||||
|
|
||||||
if (modified != None)
|
if (modified != None)
|
||||||
window = meta_x11_display_lookup_x_window (x11_display, modified);
|
window = meta_x11_display_lookup_x_window (x11_display, modified);
|
||||||
|
@ -1963,6 +1970,7 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
||||||
|
|
||||||
meta_compositor_x11_process_xevent (compositor_x11, event, window);
|
meta_compositor_x11_process_xevent (compositor_x11, event, window);
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_X11 */
|
||||||
|
|
||||||
display->current_time = META_CURRENT_TIME;
|
display->current_time = META_CURRENT_TIME;
|
||||||
|
|
||||||
|
|
|
@ -1242,7 +1242,9 @@ meta_x11_display_new (MetaDisplay *display,
|
||||||
if (!xdisplay)
|
if (!xdisplay)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
XSynchronize (xdisplay, meta_context_is_x11_sync (context));
|
XSynchronize (xdisplay, meta_context_is_x11_sync (context));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
|
@ -1340,9 +1342,8 @@ meta_x11_display_new (MetaDisplay *display,
|
||||||
x11_display,
|
x11_display,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_X11
|
||||||
if (!meta_is_wayland_compositor ())
|
if (!meta_is_wayland_compositor ())
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
ClutterStage *stage =
|
ClutterStage *stage =
|
||||||
CLUTTER_STAGE (meta_get_stage_for_display (display));
|
CLUTTER_STAGE (meta_get_stage_for_display (display));
|
||||||
|
@ -1353,6 +1354,7 @@ meta_x11_display_new (MetaDisplay *display,
|
||||||
x11_display,
|
x11_display,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
x11_display->xids = g_hash_table_new (meta_unsigned_long_hash,
|
x11_display->xids = g_hash_table_new (meta_unsigned_long_hash,
|
||||||
meta_unsigned_long_equal);
|
meta_unsigned_long_equal);
|
||||||
|
@ -1754,6 +1756,7 @@ update_cursor_theme (MetaX11Display *x11_display)
|
||||||
set_cursor_theme (x11_display->xdisplay, backend);
|
set_cursor_theme (x11_display->xdisplay, backend);
|
||||||
schedule_reload_x11_cursor (x11_display);
|
schedule_reload_x11_cursor (x11_display);
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
if (META_IS_BACKEND_X11 (backend))
|
if (META_IS_BACKEND_X11 (backend))
|
||||||
{
|
{
|
||||||
MetaBackendX11 *backend_x11 = META_BACKEND_X11 (backend);
|
MetaBackendX11 *backend_x11 = META_BACKEND_X11 (backend);
|
||||||
|
@ -1762,6 +1765,7 @@ update_cursor_theme (MetaX11Display *x11_display)
|
||||||
set_cursor_theme (xdisplay, backend);
|
set_cursor_theme (xdisplay, backend);
|
||||||
meta_backend_x11_reload_cursor (backend_x11);
|
meta_backend_x11_reload_cursor (backend_x11);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaWindow *
|
MetaWindow *
|
||||||
|
@ -1883,27 +1887,27 @@ create_guard_window (MetaX11Display *x11_display)
|
||||||
/* https://bugzilla.gnome.org/show_bug.cgi?id=710346 */
|
/* https://bugzilla.gnome.org/show_bug.cgi?id=710346 */
|
||||||
XStoreName (x11_display->xdisplay, guard_window, "mutter guard window");
|
XStoreName (x11_display->xdisplay, guard_window, "mutter guard window");
|
||||||
|
|
||||||
{
|
#ifdef HAVE_X11
|
||||||
if (!meta_is_wayland_compositor ())
|
if (!meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
MetaBackendX11 *backend =
|
MetaBackendX11 *backend =
|
||||||
META_BACKEND_X11 (backend_from_x11_display (x11_display));
|
META_BACKEND_X11 (backend_from_x11_display (x11_display));
|
||||||
Display *backend_xdisplay = meta_backend_x11_get_xdisplay (backend);
|
Display *backend_xdisplay = meta_backend_x11_get_xdisplay (backend);
|
||||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||||
|
|
||||||
XISetMask (mask.mask, XI_ButtonPress);
|
XISetMask (mask.mask, XI_ButtonPress);
|
||||||
XISetMask (mask.mask, XI_ButtonRelease);
|
XISetMask (mask.mask, XI_ButtonRelease);
|
||||||
XISetMask (mask.mask, XI_Motion);
|
XISetMask (mask.mask, XI_Motion);
|
||||||
|
|
||||||
/* Sync on the connection we created the window on to
|
/* Sync on the connection we created the window on to
|
||||||
* make sure it's created before we select on it on the
|
* make sure it's created before we select on it on the
|
||||||
* backend connection. */
|
* backend connection. */
|
||||||
XSync (x11_display->xdisplay, False);
|
XSync (x11_display->xdisplay, False);
|
||||||
|
|
||||||
XISelectEvents (backend_xdisplay, guard_window, &mask, 1);
|
XISelectEvents (backend_xdisplay, guard_window, &mask, 1);
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
meta_stack_tracker_record_add (x11_display->display->stack_tracker,
|
meta_stack_tracker_record_add (x11_display->display->stack_tracker,
|
||||||
guard_window,
|
guard_window,
|
||||||
|
@ -2429,6 +2433,7 @@ meta_x11_display_set_stage_input_region (MetaX11Display *x11_display,
|
||||||
XRectangle *rects,
|
XRectangle *rects,
|
||||||
int n_rects)
|
int n_rects)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
Display *xdisplay = x11_display->xdisplay;
|
Display *xdisplay = x11_display->xdisplay;
|
||||||
MetaBackend *backend = backend_from_x11_display (x11_display);
|
MetaBackend *backend = backend_from_x11_display (x11_display);
|
||||||
ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
||||||
|
@ -2447,6 +2452,7 @@ meta_x11_display_set_stage_input_region (MetaX11Display *x11_display,
|
||||||
XFixesSetWindowShapeRegion (xdisplay,
|
XFixesSetWindowShapeRegion (xdisplay,
|
||||||
x11_display->composite_overlay_window,
|
x11_display->composite_overlay_window,
|
||||||
ShapeInput, 0, 0, x11_display->stage_input_region);
|
ShapeInput, 0, 0, x11_display->stage_input_region);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "meta-x11-keybindings-private.h"
|
#include "meta-x11-keybindings-private.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
static GArray *
|
static GArray *
|
||||||
calc_grab_modifiers (MetaKeyBindingManager *keys,
|
calc_grab_modifiers (MetaKeyBindingManager *keys,
|
||||||
unsigned int modmask)
|
unsigned int modmask)
|
||||||
|
@ -55,6 +56,7 @@ calc_grab_modifiers (MetaKeyBindingManager *keys,
|
||||||
|
|
||||||
return mods_array;
|
return mods_array;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_change_button_grab (MetaKeyBindingManager *keys,
|
meta_change_button_grab (MetaKeyBindingManager *keys,
|
||||||
|
@ -64,6 +66,7 @@ meta_change_button_grab (MetaKeyBindingManager *keys,
|
||||||
int button,
|
int button,
|
||||||
int modmask)
|
int modmask)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
MetaBackendX11 *backend;
|
MetaBackendX11 *backend;
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||||
|
@ -111,6 +114,7 @@ meta_change_button_grab (MetaKeyBindingManager *keys,
|
||||||
mtk_x11_error_trap_pop (xdisplay);
|
mtk_x11_error_trap_pop (xdisplay);
|
||||||
|
|
||||||
g_array_free (mods, TRUE);
|
g_array_free (mods, TRUE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -133,6 +137,7 @@ meta_x11_keybindings_change_keygrab (MetaKeyBindingManager *keys,
|
||||||
gboolean grab,
|
gboolean grab,
|
||||||
MetaResolvedKeyCombo *resolved_combo)
|
MetaResolvedKeyCombo *resolved_combo)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
MetaBackendX11 *backend_x11;
|
MetaBackendX11 *backend_x11;
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
GArray *mods;
|
GArray *mods;
|
||||||
|
@ -185,6 +190,7 @@ meta_x11_keybindings_change_keygrab (MetaKeyBindingManager *keys,
|
||||||
mtk_x11_error_trap_pop (xdisplay);
|
mtk_x11_error_trap_pop (xdisplay);
|
||||||
|
|
||||||
g_array_free (mods, TRUE);
|
g_array_free (mods, TRUE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -3840,9 +3840,11 @@ is_our_xwindow (MetaX11Display *x11_display,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
XWindowAttributes *attrs)
|
XWindowAttributes *attrs)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
MetaContext *context;
|
MetaContext *context;
|
||||||
MetaBackend *backend;
|
MetaBackend *backend;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (xwindow == x11_display->no_focus_window)
|
if (xwindow == x11_display->no_focus_window)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -3859,6 +3861,7 @@ is_our_xwindow (MetaX11Display *x11_display,
|
||||||
if (xwindow == x11_display->composite_overlay_window)
|
if (xwindow == x11_display->composite_overlay_window)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
display = meta_x11_display_get_display (x11_display);
|
display = meta_x11_display_get_display (x11_display);
|
||||||
context = meta_display_get_context (display);
|
context = meta_display_get_context (display);
|
||||||
backend = meta_context_get_backend (context);
|
backend = meta_context_get_backend (context);
|
||||||
|
@ -3866,6 +3869,7 @@ is_our_xwindow (MetaX11Display *x11_display,
|
||||||
if (META_IS_BACKEND_X11 (backend) &&
|
if (META_IS_BACKEND_X11 (backend) &&
|
||||||
xwindow == meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend)))
|
xwindow == meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Any windows created via meta_create_offscreen_window */
|
/* Any windows created via meta_create_offscreen_window */
|
||||||
if (attrs->override_redirect &&
|
if (attrs->override_redirect &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue