From bd3d5df9ce26d9be8f201afd16805575bd460118 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 16 Aug 2013 13:54:42 +0200 Subject: [PATCH] Remove HAVE_WAYLAND ifdefs Wayland support is always enabled now. https://bugzilla.gnome.org/show_bug.cgi?id=705497 --- src/compositor/compositor.c | 6 ------ src/compositor/meta-shaped-texture-private.h | 6 ------ src/compositor/meta-shaped-texture.c | 14 -------------- src/compositor/meta-window-actor-private.h | 4 ---- src/compositor/meta-window-actor.c | 12 ------------ src/core/display.c | 6 ------ src/core/main.c | 6 ------ src/core/screen.c | 6 ------ src/core/window-private.h | 2 -- src/core/window.c | 8 -------- 10 files changed, 70 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 771fa2d75..41b3b6a17 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -84,9 +84,7 @@ #include "meta-window-group.h" #include "window-private.h" /* to check window->hidden */ #include "display-private.h" /* for meta_display_lookup_x_window() */ -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif #include #include @@ -633,9 +631,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor, Display *xdisplay = meta_display_get_xdisplay (display); Window xwin; gint width, height; -#ifdef HAVE_WAYLAND MetaWaylandCompositor *wayland_compositor; -#endif /* Check if the screen is already managed */ if (meta_screen_get_compositor_data (screen)) @@ -668,14 +664,12 @@ meta_compositor_manage_screen (MetaCompositor *compositor, /* We will have already created a stage if running as a wayland * compositor... */ -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) { wayland_compositor = meta_wayland_compositor_get_default (); info->stage = wayland_compositor->stage; } else -#endif /* HAVE_WAYLAND */ { info->stage = clutter_stage_new (); diff --git a/src/compositor/meta-shaped-texture-private.h b/src/compositor/meta-shaped-texture-private.h index 907596a1e..ec4f08137 100644 --- a/src/compositor/meta-shaped-texture-private.h +++ b/src/compositor/meta-shaped-texture-private.h @@ -28,23 +28,17 @@ #define __META_SHAPED_TEXTURE_PRIVATE_H__ #include -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif ClutterActor *meta_shaped_texture_new_with_xwindow (Window xwindow); -#ifdef HAVE_WAYLAND ClutterActor *meta_shaped_texture_new_with_wayland_surface (MetaWaylandSurface *surface); void meta_shaped_texture_set_wayland_surface (MetaShapedTexture *stex, MetaWaylandSurface *surface); MetaWaylandSurface *meta_shaped_texture_get_wayland_surface (MetaShapedTexture *stex); -#endif void meta_shaped_texture_set_pixmap (MetaShapedTexture *stex, Pixmap pixmap); -#ifdef HAVE_WAYLAND void meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex, MetaWaylandBuffer *buffer); -#endif #endif diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index 4af53ff21..856f28475 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -34,10 +34,8 @@ #include "meta-texture-tower.h" #include "meta-shaped-texture-private.h" -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" #include -#endif #include #include @@ -65,9 +63,7 @@ static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *self, Clutte typedef enum _MetaShapedTextureType { META_SHAPED_TEXTURE_TYPE_X11_PIXMAP, -#ifdef HAVE_WAYLAND META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE, -#endif } MetaShapedTextureType; @@ -87,11 +83,9 @@ struct _MetaShapedTexturePrivate struct { Pixmap pixmap; } x11; -#ifdef HAVE_WAYLAND struct { MetaWaylandSurface *surface; } wayland; -#endif }; CoglTexture *texture; @@ -463,7 +457,6 @@ meta_shaped_texture_get_paint_volume (ClutterActor *self, return clutter_paint_volume_set_from_allocation (volume, self); } -#ifdef HAVE_WAYLAND ClutterActor * meta_shaped_texture_new_with_wayland_surface (MetaWaylandSurface *surface) { @@ -499,7 +492,6 @@ meta_shaped_texture_get_wayland_surface (MetaShapedTexture *stex) MetaShapedTexturePrivate *priv = stex->priv; return priv->wayland.surface; } -#endif /* HAVE_WAYLAND */ ClutterActor * meta_shaped_texture_new_with_xwindow (Window xwindow) @@ -549,7 +541,6 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex, clutter_actor_queue_redraw (CLUTTER_ACTOR (stex)); } -#ifdef HAVE_WAYLAND static void wayland_surface_update_area (MetaShapedTexture *stex, int x, @@ -609,7 +600,6 @@ wayland_surface_update_area (MetaShapedTexture *stex, } } } -#endif /* HAVE_WAYLAND */ static void queue_damage_redraw_with_clip (MetaShapedTexture *stex, @@ -679,11 +669,9 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex, cogl_texture_pixmap_x11_update_area (COGL_TEXTURE_PIXMAP_X11 (priv->texture), x, y, width, height); break; -#ifdef HAVE_WAYLAND case META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE: wayland_surface_update_area (stex, x, y, width, height); break; -#endif } meta_texture_tower_update_area (priv->paint_tower, x, y, width, height); @@ -727,7 +715,6 @@ meta_shaped_texture_set_pixmap (MetaShapedTexture *stex, COGL_TEXTURE (priv->texture)); } -#ifdef HAVE_WAYLAND void meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex, MetaWaylandBuffer *buffer) @@ -773,7 +760,6 @@ meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex, meta_texture_tower_set_base_texture (priv->paint_tower, COGL_TEXTURE (priv->texture)); } -#endif /* HAVE_WAYLAND */ /** * meta_shaped_texture_get_texture: diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h index d37ee2dbb..cfe6c9dd2 100644 --- a/src/compositor/meta-window-actor-private.h +++ b/src/compositor/meta-window-actor-private.h @@ -5,10 +5,8 @@ #include -#ifdef HAVE_WAYLAND #include #include -#endif #include #include @@ -32,7 +30,6 @@ void meta_window_actor_unmaximize (MetaWindowActor *self, void meta_window_actor_process_x11_damage (MetaWindowActor *self, XDamageNotifyEvent *event); -#ifdef HAVE_WAYLAND void meta_window_actor_process_wayland_damage (MetaWindowActor *self, int x, int y, @@ -42,7 +39,6 @@ void meta_window_actor_set_wayland_surface (MetaWindowActor *self, MetaWaylandSurface *surface); void meta_window_actor_attach_wayland_buffer (MetaWindowActor *self, MetaWaylandBuffer *buffer); -#endif void meta_window_actor_pre_paint (MetaWindowActor *self); void meta_window_actor_post_paint (MetaWindowActor *self); diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 5ff27f1d9..499960276 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -33,9 +33,7 @@ #include "meta-window-actor-private.h" #include "meta-texture-rectangle.h" #include "region-utils.h" -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif enum { POSITION_CHANGED, @@ -372,11 +370,9 @@ meta_window_actor_constructed (GObject *object) if (!priv->actor) { -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) priv->actor = meta_shaped_texture_new_with_wayland_surface (window->surface); else -#endif priv->actor = meta_shaped_texture_new_with_xwindow (xwindow); clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor); @@ -1321,10 +1317,8 @@ meta_window_actor_destroy (MetaWindowActor *self) priv = self->priv; -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) meta_shaped_texture_set_wayland_surface (META_SHAPED_TEXTURE (priv->actor), NULL); -#endif window = priv->window; window_type = meta_window_get_window_type (window); @@ -1568,14 +1562,12 @@ meta_window_actor_new (MetaWindow *window) meta_verbose ("add window: Meta %p, xwin 0x%x\n", window, (guint)top_window); } -#ifdef HAVE_WAYLAND else { meta_verbose ("add window: Meta %p, wayland surface %p\n", window, window->surface); top_window = None; } -#endif self = g_object_new (META_TYPE_WINDOW_ACTOR, "meta-window", window, @@ -2023,7 +2015,6 @@ meta_window_actor_process_x11_damage (MetaWindowActor *self, priv->repaint_scheduled = TRUE; } -#ifdef HAVE_WAYLAND void meta_window_actor_process_wayland_damage (MetaWindowActor *self, int x, @@ -2040,7 +2031,6 @@ meta_window_actor_process_wayland_damage (MetaWindowActor *self, x, y, width, height); priv->repaint_scheduled = TRUE; } -#endif void meta_window_actor_sync_visibility (MetaWindowActor *self) @@ -2430,7 +2420,6 @@ meta_window_actor_update_shape (MetaWindowActor *self) clutter_actor_queue_redraw (priv->actor); } -#ifdef HAVE_WAYLAND static void maybe_emit_size_changed (MetaWindowActor *self, MetaWaylandBuffer *new_buffer) @@ -2491,7 +2480,6 @@ meta_window_actor_attach_wayland_buffer (MetaWindowActor *self, maybe_emit_size_changed (self, buffer); } -#endif /* HAVE_WAYLAND */ static void meta_window_actor_handle_updates (MetaWindowActor *self) diff --git a/src/core/display.c b/src/core/display.c index 3a6827e25..118e60ebf 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1906,9 +1906,7 @@ update_focus_window (MetaDisplay *display, Window xwindow, gulong serial) { -#ifdef HAVE_WAYLAND MetaWaylandCompositor *compositor; -#endif display->focus_serial = serial; @@ -1949,7 +1947,6 @@ update_focus_window (MetaDisplay *display, else meta_topic (META_DEBUG_FOCUS, "* Focus --> NULL with serial %lu\n", serial); -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) { compositor = meta_wayland_compositor_get_default (); @@ -1962,7 +1959,6 @@ update_focus_window (MetaDisplay *display, else meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland surface"); } -#endif g_object_notify (G_OBJECT (display), "focus-window"); meta_display_update_active_window_hint (display); @@ -3246,12 +3242,10 @@ event_callback (XEvent *event, erratically because of the lag between updating the window position from the surface position. Instead we bypass the translation altogether by directly using the Clutter events */ -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor () && event->type == GenericEvent && event->xcookie.evtype == XI_Motion) return FALSE; -#endif return meta_display_handle_event (display, event); } diff --git a/src/core/main.c b/src/core/main.c index 0326d8ec3..c4620a175 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -55,9 +55,7 @@ #include "session.h" #include #include -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif #include #include @@ -350,10 +348,8 @@ meta_finalize (void) meta_display_close (display, CurrentTime); /* I doubt correct timestamps matter here */ -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) meta_wayland_finalize (); -#endif } static int signal_pipe_fds[2] = { -1, -1 }; @@ -468,7 +464,6 @@ meta_init (void) g_irepository_prepend_search_path (MUTTER_PKGLIBDIR); #endif -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) { /* NB: When running as a hybrid wayland compositor we run our own headless X @@ -476,7 +471,6 @@ meta_init (void) meta_wayland_init (); } else -#endif meta_select_display (opt_display_name); meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL)); diff --git a/src/core/screen.c b/src/core/screen.c index 3706d94c0..eb3d5264f 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -45,9 +45,7 @@ #include #include "mutter-enum-types.h" #include "core.h" -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif #include "meta-cursor-tracker-private.h" #include @@ -675,9 +673,7 @@ meta_screen_new (MetaDisplay *display, char buf[128]; guint32 manager_timestamp; gulong current_workspace; -#ifdef HAVE_WAYLAND MetaWaylandCompositor *compositor; -#endif replace_current_wm = meta_get_replace_current_wm (); @@ -837,7 +833,6 @@ meta_screen_new (MetaDisplay *display, screen->xroot = xroot; screen->rect.x = screen->rect.y = 0; -#ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) { compositor = meta_wayland_compositor_get_default (); @@ -845,7 +840,6 @@ meta_screen_new (MetaDisplay *display, screen->rect.height = clutter_actor_get_height (compositor->stage); } else -#endif { screen->rect.width = WidthOfScreen (screen->xscreen); screen->rect.height = HeightOfScreen (screen->xscreen); diff --git a/src/core/window-private.h b/src/core/window-private.h index 0f32752ef..c498aa417 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -44,9 +44,7 @@ #include #include #include -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif /* XXX: We should find a nicer approach to deal with the * circular dependency we have with the current headers diff --git a/src/core/window.c b/src/core/window.c index 036c839b5..aa48551a2 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -62,9 +62,7 @@ #include -#ifdef HAVE_WAYLAND #include "meta-wayland-private.h" -#endif /* Windows that unmaximize to a size bigger than that fraction of the workarea * will be scaled down to that size (while maintaining aspect ratio). @@ -853,9 +851,7 @@ meta_window_new_shared (MetaDisplay *display, window->dialog_pid = -1; window->client_type = client_type; -#ifdef HAVE_WAYLAND window->surface = surface; -#endif window->xwindow = xwindow; /* this is in window->screen->display, but that's too annoying to @@ -1375,7 +1371,6 @@ display_notify_window (MetaDisplay *display, MetaWindow *window) g_signal_emit_by_name (window->display, "window-marked-urgent", window); } -#ifdef HAVE_WAYLAND MetaWindow * meta_window_new_for_wayland (MetaDisplay *display, int width, @@ -1447,7 +1442,6 @@ meta_window_new_for_wayland (MetaDisplay *display, return window; } -#endif MetaWindow* meta_window_new_with_attrs (MetaDisplay *display, @@ -2107,10 +2101,8 @@ meta_window_unmanage (MetaWindow *window, meta_error_trap_pop (window->display); } -#ifdef HAVE_WAYLAND if (window->surface) meta_wayland_surface_free (window->surface); -#endif meta_prefs_remove_listener (prefs_changed_callback, window);