[mutter/wip/surface-content: 13/15] window-actor: Remove (private) xwindow property



commit cb498289ad64a22f4e72b8e23bf8fb32b7c2ade5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Dec 6 00:59:20 2013 -0500

    window-actor: Remove (private) xwindow property
    
    This should make it easier to construct a MetaWindowActor from bindings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678989

 src/compositor/meta-window-actor.c |   60 +++---------------------------------
 1 files changed, 5 insertions(+), 55 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index a6aeeb4..bd42726 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -40,7 +40,6 @@
 struct _MetaWindowActorPrivate
 {
   MetaWindow       *window;
-  Window            xwindow;
   MetaScreen       *screen;
 
   MetaSurfaceActor *surface;
@@ -148,7 +147,6 @@ enum
 {
   PROP_META_WINDOW = 1,
   PROP_META_SCREEN,
-  PROP_X_WINDOW,
   PROP_NO_SHADOW,
   PROP_SHADOW_CLASS
 };
@@ -232,18 +230,6 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
                                    PROP_META_SCREEN,
                                    pspec);
 
-  pspec = g_param_spec_ulong ("x-window",
-                             "Window",
-                             "Window",
-                             0,
-                             G_MAXULONG,
-                             0,
-                             G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
-
-  g_object_class_install_property (object_class,
-                                   PROP_X_WINDOW,
-                                   pspec);
-
   pspec = g_param_spec_boolean ("no-shadow",
                                 "No shadow",
                                 "Do not add shaddow to this window",
@@ -312,8 +298,6 @@ window_decorated_notify (MetaWindow *mw,
         }
     }
 
-  priv->xwindow = meta_window_get_toplevel_xwindow (priv->window);
-
   /*
    * Recreate the contents.
    */
@@ -354,8 +338,8 @@ meta_window_actor_constructed (GObject *object)
   MetaWindowActorPrivate *priv     = self->priv;
   MetaScreen             *screen   = priv->screen;
   MetaDisplay            *display  = meta_screen_get_display (screen);
-  Window                  xwindow  = priv->xwindow;
   MetaWindow             *window   = priv->window;
+  Window                  xwindow  = meta_window_get_toplevel_xwindow (window);
   Display                *xdisplay = meta_display_get_xdisplay (display);
 
   if (!meta_is_wayland_compositor ())
@@ -503,9 +487,6 @@ meta_window_actor_set_property (GObject      *object,
     case PROP_META_SCREEN:
       priv->screen = g_value_get_pointer (value);
       break;
-    case PROP_X_WINDOW:
-      priv->xwindow = g_value_get_ulong (value);
-      break;
     case PROP_NO_SHADOW:
       {
         gboolean newv = g_value_get_boolean (value);
@@ -553,9 +534,6 @@ meta_window_actor_get_property (GObject      *object,
     case PROP_META_SCREEN:
       g_value_set_pointer (value, priv->screen);
       break;
-    case PROP_X_WINDOW:
-      g_value_set_ulong (value, priv->xwindow);
-      break;
     case PROP_NO_SHADOW:
       g_value_set_boolean (value, priv->no_shadow);
       break;
@@ -822,20 +800,6 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
 }
 
 /**
- * meta_window_actor_get_x_window: (skip)
- * @self: a #MetaWindowActor
- *
- */
-Window
-meta_window_actor_get_x_window (MetaWindowActor *self)
-{
-  if (!self)
-    return None;
-
-  return self->priv->xwindow;
-}
-
-/**
  * meta_window_actor_get_meta_window:
  * @self: a #MetaWindowActor
  *
@@ -1322,7 +1286,7 @@ meta_window_actor_set_unredirected (MetaWindowActor *self,
   MetaDisplay *display = meta_window_get_display (metaWindow);
 
   Display *xdisplay = meta_display_get_xdisplay (display);
-  Window  xwin = meta_window_actor_get_x_window (self);
+  Window  xwin = meta_window_get_toplevel_xwindow (metaWindow);
 
   meta_error_trap_push (display);
 
@@ -1583,25 +1547,11 @@ meta_window_actor_new (MetaWindow *window)
   MetaCompScreen         *info = meta_screen_get_compositor_data (screen);
   MetaWindowActor        *self;
   MetaWindowActorPrivate *priv;
-  Window                 top_window;
   ClutterActor           *window_group;
 
-  if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
-    {
-      top_window = meta_window_get_toplevel_xwindow (window);
-      meta_verbose ("add window: Meta %p, xwin 0x%x\n", window, (guint)top_window);
-    }
-  else
-    {
-      meta_verbose ("add window: Meta %p, wayland surface %p\n",
-                    window, window->surface);
-      top_window = None;
-    }
-
   self = g_object_new (META_TYPE_WINDOW_ACTOR,
-                       "meta-window",         window,
-                       "x-window",            top_window,
-                       "meta-screen",         screen,
+                       "meta-window", window,
+                       "meta-screen", screen,
                        NULL);
 
   priv = self->priv;
@@ -1799,7 +1749,7 @@ check_needs_x11_pixmap (MetaWindowActor *self)
   MetaDisplay         *display  = meta_screen_get_display (screen);
   Display             *xdisplay = meta_display_get_xdisplay (display);
   MetaCompScreen      *info     = meta_screen_get_compositor_data (screen);
-  Window               xwindow  = priv->xwindow;
+  Window               xwindow  = meta_window_get_toplevel_xwindow (priv->window);
 
   if (!priv->needs_pixmap)
     return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]