Remove HAVE_WAYLAND ifdefs

Wayland support is always enabled now.

https://bugzilla.gnome.org/show_bug.cgi?id=705497
This commit is contained in:
Giovanni Campagna 2013-08-16 13:54:42 +02:00
parent 91cdfab495
commit bd3d5df9ce
10 changed files with 0 additions and 70 deletions

View File

@ -84,9 +84,7 @@
#include "meta-window-group.h" #include "meta-window-group.h"
#include "window-private.h" /* to check window->hidden */ #include "window-private.h" /* to check window->hidden */
#include "display-private.h" /* for meta_display_lookup_x_window() */ #include "display-private.h" /* for meta_display_lookup_x_window() */
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xcomposite.h>
@ -633,9 +631,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
Window xwin; Window xwin;
gint width, height; gint width, height;
#ifdef HAVE_WAYLAND
MetaWaylandCompositor *wayland_compositor; MetaWaylandCompositor *wayland_compositor;
#endif
/* Check if the screen is already managed */ /* Check if the screen is already managed */
if (meta_screen_get_compositor_data (screen)) 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 /* We will have already created a stage if running as a wayland
* compositor... */ * compositor... */
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
{ {
wayland_compositor = meta_wayland_compositor_get_default (); wayland_compositor = meta_wayland_compositor_get_default ();
info->stage = wayland_compositor->stage; info->stage = wayland_compositor->stage;
} }
else else
#endif /* HAVE_WAYLAND */
{ {
info->stage = clutter_stage_new (); info->stage = clutter_stage_new ();

View File

@ -28,23 +28,17 @@
#define __META_SHAPED_TEXTURE_PRIVATE_H__ #define __META_SHAPED_TEXTURE_PRIVATE_H__
#include <meta/meta-shaped-texture.h> #include <meta/meta-shaped-texture.h>
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
ClutterActor *meta_shaped_texture_new_with_xwindow (Window xwindow); ClutterActor *meta_shaped_texture_new_with_xwindow (Window xwindow);
#ifdef HAVE_WAYLAND
ClutterActor *meta_shaped_texture_new_with_wayland_surface (MetaWaylandSurface *surface); ClutterActor *meta_shaped_texture_new_with_wayland_surface (MetaWaylandSurface *surface);
void meta_shaped_texture_set_wayland_surface (MetaShapedTexture *stex, void meta_shaped_texture_set_wayland_surface (MetaShapedTexture *stex,
MetaWaylandSurface *surface); MetaWaylandSurface *surface);
MetaWaylandSurface *meta_shaped_texture_get_wayland_surface (MetaShapedTexture *stex); MetaWaylandSurface *meta_shaped_texture_get_wayland_surface (MetaShapedTexture *stex);
#endif
void meta_shaped_texture_set_pixmap (MetaShapedTexture *stex, void meta_shaped_texture_set_pixmap (MetaShapedTexture *stex,
Pixmap pixmap); Pixmap pixmap);
#ifdef HAVE_WAYLAND
void meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex, void meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex,
MetaWaylandBuffer *buffer); MetaWaylandBuffer *buffer);
#endif
#endif #endif

View File

@ -34,10 +34,8 @@
#include "meta-texture-tower.h" #include "meta-texture-tower.h"
#include "meta-shaped-texture-private.h" #include "meta-shaped-texture-private.h"
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#include <cogl/cogl-wayland-server.h> #include <cogl/cogl-wayland-server.h>
#endif
#include <clutter/clutter.h> #include <clutter/clutter.h>
#include <cogl/cogl.h> #include <cogl/cogl.h>
@ -65,9 +63,7 @@ static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *self, Clutte
typedef enum _MetaShapedTextureType typedef enum _MetaShapedTextureType
{ {
META_SHAPED_TEXTURE_TYPE_X11_PIXMAP, META_SHAPED_TEXTURE_TYPE_X11_PIXMAP,
#ifdef HAVE_WAYLAND
META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE, META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE,
#endif
} MetaShapedTextureType; } MetaShapedTextureType;
@ -87,11 +83,9 @@ struct _MetaShapedTexturePrivate
struct { struct {
Pixmap pixmap; Pixmap pixmap;
} x11; } x11;
#ifdef HAVE_WAYLAND
struct { struct {
MetaWaylandSurface *surface; MetaWaylandSurface *surface;
} wayland; } wayland;
#endif
}; };
CoglTexture *texture; CoglTexture *texture;
@ -463,7 +457,6 @@ meta_shaped_texture_get_paint_volume (ClutterActor *self,
return clutter_paint_volume_set_from_allocation (volume, self); return clutter_paint_volume_set_from_allocation (volume, self);
} }
#ifdef HAVE_WAYLAND
ClutterActor * ClutterActor *
meta_shaped_texture_new_with_wayland_surface (MetaWaylandSurface *surface) 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; MetaShapedTexturePrivate *priv = stex->priv;
return priv->wayland.surface; return priv->wayland.surface;
} }
#endif /* HAVE_WAYLAND */
ClutterActor * ClutterActor *
meta_shaped_texture_new_with_xwindow (Window xwindow) 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)); clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
} }
#ifdef HAVE_WAYLAND
static void static void
wayland_surface_update_area (MetaShapedTexture *stex, wayland_surface_update_area (MetaShapedTexture *stex,
int x, int x,
@ -609,7 +600,6 @@ wayland_surface_update_area (MetaShapedTexture *stex,
} }
} }
} }
#endif /* HAVE_WAYLAND */
static void static void
queue_damage_redraw_with_clip (MetaShapedTexture *stex, 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), cogl_texture_pixmap_x11_update_area (COGL_TEXTURE_PIXMAP_X11 (priv->texture),
x, y, width, height); x, y, width, height);
break; break;
#ifdef HAVE_WAYLAND
case META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE: case META_SHAPED_TEXTURE_TYPE_WAYLAND_SURFACE:
wayland_surface_update_area (stex, x, y, width, height); wayland_surface_update_area (stex, x, y, width, height);
break; break;
#endif
} }
meta_texture_tower_update_area (priv->paint_tower, x, y, width, height); 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)); COGL_TEXTURE (priv->texture));
} }
#ifdef HAVE_WAYLAND
void void
meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex, meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex,
MetaWaylandBuffer *buffer) MetaWaylandBuffer *buffer)
@ -773,7 +760,6 @@ meta_shaped_texture_attach_wayland_buffer (MetaShapedTexture *stex,
meta_texture_tower_set_base_texture (priv->paint_tower, meta_texture_tower_set_base_texture (priv->paint_tower,
COGL_TEXTURE (priv->texture)); COGL_TEXTURE (priv->texture));
} }
#endif /* HAVE_WAYLAND */
/** /**
* meta_shaped_texture_get_texture: * meta_shaped_texture_get_texture:

View File

@ -5,10 +5,8 @@
#include <config.h> #include <config.h>
#ifdef HAVE_WAYLAND
#include <wayland-server.h> #include <wayland-server.h>
#include <meta-wayland-private.h> #include <meta-wayland-private.h>
#endif
#include <X11/extensions/Xdamage.h> #include <X11/extensions/Xdamage.h>
#include <meta/compositor-mutter.h> #include <meta/compositor-mutter.h>
@ -32,7 +30,6 @@ void meta_window_actor_unmaximize (MetaWindowActor *self,
void meta_window_actor_process_x11_damage (MetaWindowActor *self, void meta_window_actor_process_x11_damage (MetaWindowActor *self,
XDamageNotifyEvent *event); XDamageNotifyEvent *event);
#ifdef HAVE_WAYLAND
void meta_window_actor_process_wayland_damage (MetaWindowActor *self, void meta_window_actor_process_wayland_damage (MetaWindowActor *self,
int x, int x,
int y, int y,
@ -42,7 +39,6 @@ void meta_window_actor_set_wayland_surface (MetaWindowActor *self,
MetaWaylandSurface *surface); MetaWaylandSurface *surface);
void meta_window_actor_attach_wayland_buffer (MetaWindowActor *self, void meta_window_actor_attach_wayland_buffer (MetaWindowActor *self,
MetaWaylandBuffer *buffer); MetaWaylandBuffer *buffer);
#endif
void meta_window_actor_pre_paint (MetaWindowActor *self); void meta_window_actor_pre_paint (MetaWindowActor *self);
void meta_window_actor_post_paint (MetaWindowActor *self); void meta_window_actor_post_paint (MetaWindowActor *self);

View File

@ -33,9 +33,7 @@
#include "meta-window-actor-private.h" #include "meta-window-actor-private.h"
#include "meta-texture-rectangle.h" #include "meta-texture-rectangle.h"
#include "region-utils.h" #include "region-utils.h"
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
enum { enum {
POSITION_CHANGED, POSITION_CHANGED,
@ -372,11 +370,9 @@ meta_window_actor_constructed (GObject *object)
if (!priv->actor) if (!priv->actor)
{ {
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
priv->actor = meta_shaped_texture_new_with_wayland_surface (window->surface); priv->actor = meta_shaped_texture_new_with_wayland_surface (window->surface);
else else
#endif
priv->actor = meta_shaped_texture_new_with_xwindow (xwindow); priv->actor = meta_shaped_texture_new_with_xwindow (xwindow);
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor); clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor);
@ -1321,10 +1317,8 @@ meta_window_actor_destroy (MetaWindowActor *self)
priv = self->priv; priv = self->priv;
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
meta_shaped_texture_set_wayland_surface (META_SHAPED_TEXTURE (priv->actor), NULL); meta_shaped_texture_set_wayland_surface (META_SHAPED_TEXTURE (priv->actor), NULL);
#endif
window = priv->window; window = priv->window;
window_type = meta_window_get_window_type (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); meta_verbose ("add window: Meta %p, xwin 0x%x\n", window, (guint)top_window);
} }
#ifdef HAVE_WAYLAND
else else
{ {
meta_verbose ("add window: Meta %p, wayland surface %p\n", meta_verbose ("add window: Meta %p, wayland surface %p\n",
window, window->surface); window, window->surface);
top_window = None; top_window = None;
} }
#endif
self = g_object_new (META_TYPE_WINDOW_ACTOR, self = g_object_new (META_TYPE_WINDOW_ACTOR,
"meta-window", window, "meta-window", window,
@ -2023,7 +2015,6 @@ meta_window_actor_process_x11_damage (MetaWindowActor *self,
priv->repaint_scheduled = TRUE; priv->repaint_scheduled = TRUE;
} }
#ifdef HAVE_WAYLAND
void void
meta_window_actor_process_wayland_damage (MetaWindowActor *self, meta_window_actor_process_wayland_damage (MetaWindowActor *self,
int x, int x,
@ -2040,7 +2031,6 @@ meta_window_actor_process_wayland_damage (MetaWindowActor *self,
x, y, width, height); x, y, width, height);
priv->repaint_scheduled = TRUE; priv->repaint_scheduled = TRUE;
} }
#endif
void void
meta_window_actor_sync_visibility (MetaWindowActor *self) meta_window_actor_sync_visibility (MetaWindowActor *self)
@ -2430,7 +2420,6 @@ meta_window_actor_update_shape (MetaWindowActor *self)
clutter_actor_queue_redraw (priv->actor); clutter_actor_queue_redraw (priv->actor);
} }
#ifdef HAVE_WAYLAND
static void static void
maybe_emit_size_changed (MetaWindowActor *self, maybe_emit_size_changed (MetaWindowActor *self,
MetaWaylandBuffer *new_buffer) MetaWaylandBuffer *new_buffer)
@ -2491,7 +2480,6 @@ meta_window_actor_attach_wayland_buffer (MetaWindowActor *self,
maybe_emit_size_changed (self, buffer); maybe_emit_size_changed (self, buffer);
} }
#endif /* HAVE_WAYLAND */
static void static void
meta_window_actor_handle_updates (MetaWindowActor *self) meta_window_actor_handle_updates (MetaWindowActor *self)

View File

@ -1906,9 +1906,7 @@ update_focus_window (MetaDisplay *display,
Window xwindow, Window xwindow,
gulong serial) gulong serial)
{ {
#ifdef HAVE_WAYLAND
MetaWaylandCompositor *compositor; MetaWaylandCompositor *compositor;
#endif
display->focus_serial = serial; display->focus_serial = serial;
@ -1949,7 +1947,6 @@ update_focus_window (MetaDisplay *display,
else else
meta_topic (META_DEBUG_FOCUS, "* Focus --> NULL with serial %lu\n", serial); meta_topic (META_DEBUG_FOCUS, "* Focus --> NULL with serial %lu\n", serial);
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
{ {
compositor = meta_wayland_compositor_get_default (); compositor = meta_wayland_compositor_get_default ();
@ -1962,7 +1959,6 @@ update_focus_window (MetaDisplay *display,
else else
meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland surface"); 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"); g_object_notify (G_OBJECT (display), "focus-window");
meta_display_update_active_window_hint (display); meta_display_update_active_window_hint (display);
@ -3246,12 +3242,10 @@ event_callback (XEvent *event,
erratically because of the lag between updating the window erratically because of the lag between updating the window
position from the surface position. Instead we bypass the position from the surface position. Instead we bypass the
translation altogether by directly using the Clutter events */ translation altogether by directly using the Clutter events */
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor () && if (meta_is_wayland_compositor () &&
event->type == GenericEvent && event->type == GenericEvent &&
event->xcookie.evtype == XI_Motion) event->xcookie.evtype == XI_Motion)
return FALSE; return FALSE;
#endif
return meta_display_handle_event (display, event); return meta_display_handle_event (display, event);
} }

View File

@ -55,9 +55,7 @@
#include "session.h" #include "session.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/compositor.h> #include <meta/compositor.h>
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
#include <glib-object.h> #include <glib-object.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
@ -350,10 +348,8 @@ meta_finalize (void)
meta_display_close (display, meta_display_close (display,
CurrentTime); /* I doubt correct timestamps matter here */ CurrentTime); /* I doubt correct timestamps matter here */
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
meta_wayland_finalize (); meta_wayland_finalize ();
#endif
} }
static int signal_pipe_fds[2] = { -1, -1 }; static int signal_pipe_fds[2] = { -1, -1 };
@ -468,7 +464,6 @@ meta_init (void)
g_irepository_prepend_search_path (MUTTER_PKGLIBDIR); g_irepository_prepend_search_path (MUTTER_PKGLIBDIR);
#endif #endif
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
{ {
/* NB: When running as a hybrid wayland compositor we run our own headless X /* NB: When running as a hybrid wayland compositor we run our own headless X
@ -476,7 +471,6 @@ meta_init (void)
meta_wayland_init (); meta_wayland_init ();
} }
else else
#endif
meta_select_display (opt_display_name); meta_select_display (opt_display_name);
meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL)); meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));

View File

@ -45,9 +45,7 @@
#include <meta/compositor.h> #include <meta/compositor.h>
#include "mutter-enum-types.h" #include "mutter-enum-types.h"
#include "core.h" #include "core.h"
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
#include "meta-cursor-tracker-private.h" #include "meta-cursor-tracker-private.h"
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
@ -675,9 +673,7 @@ meta_screen_new (MetaDisplay *display,
char buf[128]; char buf[128];
guint32 manager_timestamp; guint32 manager_timestamp;
gulong current_workspace; gulong current_workspace;
#ifdef HAVE_WAYLAND
MetaWaylandCompositor *compositor; MetaWaylandCompositor *compositor;
#endif
replace_current_wm = meta_get_replace_current_wm (); replace_current_wm = meta_get_replace_current_wm ();
@ -837,7 +833,6 @@ meta_screen_new (MetaDisplay *display,
screen->xroot = xroot; screen->xroot = xroot;
screen->rect.x = screen->rect.y = 0; screen->rect.x = screen->rect.y = 0;
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
{ {
compositor = meta_wayland_compositor_get_default (); compositor = meta_wayland_compositor_get_default ();
@ -845,7 +840,6 @@ meta_screen_new (MetaDisplay *display,
screen->rect.height = clutter_actor_get_height (compositor->stage); screen->rect.height = clutter_actor_get_height (compositor->stage);
} }
else else
#endif
{ {
screen->rect.width = WidthOfScreen (screen->xscreen); screen->rect.width = WidthOfScreen (screen->xscreen);
screen->rect.height = HeightOfScreen (screen->xscreen); screen->rect.height = HeightOfScreen (screen->xscreen);

View File

@ -44,9 +44,7 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <cairo.h> #include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
/* XXX: We should find a nicer approach to deal with the /* XXX: We should find a nicer approach to deal with the
* circular dependency we have with the current headers * circular dependency we have with the current headers

View File

@ -62,9 +62,7 @@
#include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xcomposite.h>
#ifdef HAVE_WAYLAND
#include "meta-wayland-private.h" #include "meta-wayland-private.h"
#endif
/* Windows that unmaximize to a size bigger than that fraction of the workarea /* Windows that unmaximize to a size bigger than that fraction of the workarea
* will be scaled down to that size (while maintaining aspect ratio). * 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->dialog_pid = -1;
window->client_type = client_type; window->client_type = client_type;
#ifdef HAVE_WAYLAND
window->surface = surface; window->surface = surface;
#endif
window->xwindow = xwindow; window->xwindow = xwindow;
/* this is in window->screen->display, but that's too annoying to /* 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); g_signal_emit_by_name (window->display, "window-marked-urgent", window);
} }
#ifdef HAVE_WAYLAND
MetaWindow * MetaWindow *
meta_window_new_for_wayland (MetaDisplay *display, meta_window_new_for_wayland (MetaDisplay *display,
int width, int width,
@ -1447,7 +1442,6 @@ meta_window_new_for_wayland (MetaDisplay *display,
return window; return window;
} }
#endif
MetaWindow* MetaWindow*
meta_window_new_with_attrs (MetaDisplay *display, meta_window_new_with_attrs (MetaDisplay *display,
@ -2107,10 +2101,8 @@ meta_window_unmanage (MetaWindow *window,
meta_error_trap_pop (window->display); meta_error_trap_pop (window->display);
} }
#ifdef HAVE_WAYLAND
if (window->surface) if (window->surface)
meta_wayland_surface_free (window->surface); meta_wayland_surface_free (window->surface);
#endif
meta_prefs_remove_listener (prefs_changed_callback, window); meta_prefs_remove_listener (prefs_changed_callback, window);