[mutter/wayland] window: Move type_atom to window-x11



commit f05983be42a72c6524c0574e1044a4cc44dc095b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Mar 18 21:15:49 2014 -0400

    window: Move type_atom to window-x11

 src/core/window-private.h    |    3 +--
 src/core/window.c            |   18 ------------------
 src/meta/window.h            |    1 -
 src/x11/window-x11-private.h |    2 ++
 src/x11/window-x11.c         |   42 ++++++++++++++++++++++--------------------
 5 files changed, 25 insertions(+), 41 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index e2751e5..8a90de6 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -95,9 +95,8 @@ struct _MetaWindow
   MetaIconCache icon_cache;
   Pixmap wm_hints_pixmap;
   Pixmap wm_hints_mask;
-  
+
   MetaWindowType type;
-  Atom type_atom;
 
   /* NOTE these five are not in UTF-8, we just treat them as random
    * binary data
diff --git a/src/core/window.c b/src/core/window.c
index 480aa3d..68d9c51 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -940,7 +940,6 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->transient_parent_is_root_window = FALSE;
 
   window->type = META_WINDOW_NORMAL;
-  window->type_atom = None;
 
   window->struts = NULL;
 
@@ -9418,23 +9417,6 @@ meta_window_get_window_type (MetaWindow *window)
 }
 
 /**
- * meta_window_get_window_type_atom: (skip)
- * @window: a #MetaWindow
- *
- * Gets the X atom from the _NET_WM_WINDOW_TYPE property used by the
- * application to set the window type. (Note that this is constrained
- * to be some value that Mutter recognizes - a completely unrecognized
- * type atom will be returned as None.)
- *
- * Return value: the raw X atom for the window type, or None
- */
-Atom
-meta_window_get_window_type_atom (MetaWindow *window)
-{
-  return window->type_atom;
-}
-
-/**
  * meta_window_get_workspace:
  * @window: a #MetaWindow
  *
diff --git a/src/meta/window.h b/src/meta/window.h
index f79088b..3677790 100644
--- a/src/meta/window.h
+++ b/src/meta/window.h
@@ -125,7 +125,6 @@ MetaScreen *meta_window_get_screen (MetaWindow *window);
 MetaDisplay *meta_window_get_display (MetaWindow *window);
 Window meta_window_get_xwindow (MetaWindow *window);
 MetaWindowType meta_window_get_window_type (MetaWindow *window);
-Atom meta_window_get_window_type_atom (MetaWindow *window);
 MetaWorkspace *meta_window_get_workspace (MetaWindow *window);
 int      meta_window_get_monitor (MetaWindow *window);
 gboolean meta_window_is_on_all_workspaces (MetaWindow *window);
diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h
index d3ceb3b..54404d6 100644
--- a/src/x11/window-x11-private.h
+++ b/src/x11/window-x11-private.h
@@ -50,6 +50,8 @@ struct _MetaWindowX11Private
   guint using_net_wm_visible_name      : 1; /* tracked so we can clear it */
   guint using_net_wm_icon_name         : 1; /* vs. plain wm_icon_name */
   guint using_net_wm_visible_icon_name : 1; /* tracked so we can clear it */
+
+  Atom type_atom;
 };
 
 G_END_DECLS
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 5abc848..ec87494 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -199,11 +199,13 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
 void
 meta_window_x11_update_net_wm_type (MetaWindow *window)
 {
+  MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
+  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
   int n_atoms;
   Atom *atoms;
   int i;
 
-  window->type_atom = None;
+  priv->type_atom = None;
   n_atoms = 0;
   atoms = NULL;
 
@@ -234,7 +236,7 @@ meta_window_x11_update_net_wm_type (MetaWindow *window)
           atoms[i] == window->display->atom__NET_WM_WINDOW_TYPE_DND ||
           atoms[i] == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL)
         {
-          window->type_atom = atoms[i];
+          priv->type_atom = atoms[i];
           break;
         }
 
@@ -248,10 +250,10 @@ meta_window_x11_update_net_wm_type (MetaWindow *window)
       char *str;
 
       str = NULL;
-      if (window->type_atom != None)
+      if (priv->type_atom != None)
         {
           meta_error_trap_push (window->display);
-          str = XGetAtomName (window->display->xdisplay, window->type_atom);
+          str = XGetAtomName (window->display->xdisplay, priv->type_atom);
           meta_error_trap_pop (window->display);
         }
 
@@ -1549,38 +1551,38 @@ meta_window_x11_recalc_window_type (MetaWindow *window)
   MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
   MetaWindowType type;
 
-  if (window->type_atom != None)
+  if (priv->type_atom != None)
     {
-      if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DESKTOP)
+      if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DESKTOP)
         type = META_WINDOW_DESKTOP;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DOCK)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DOCK)
         type = META_WINDOW_DOCK;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_TOOLBAR)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_TOOLBAR)
         type = META_WINDOW_TOOLBAR;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_MENU)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_MENU)
         type = META_WINDOW_MENU;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_UTILITY)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_UTILITY)
         type = META_WINDOW_UTILITY;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_SPLASH)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_SPLASH)
         type = META_WINDOW_SPLASHSCREEN;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DIALOG)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DIALOG)
         type = META_WINDOW_DIALOG;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_NORMAL)
         type = META_WINDOW_NORMAL;
       /* The below are *typically* override-redirect windows, but the spec does
        * not disallow using them for managed windows.
        */
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
         type = META_WINDOW_DROPDOWN_MENU;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
         type = META_WINDOW_POPUP_MENU;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
         type = META_WINDOW_TOOLTIP;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
         type = META_WINDOW_NOTIFICATION;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_COMBO)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_COMBO)
         type = META_WINDOW_COMBO;
-      else if (window->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DND)
+      else if (priv->type_atom  == window->display->atom__NET_WM_WINDOW_TYPE_DND)
         type = META_WINDOW_DND;
       else
         {
@@ -1593,7 +1595,7 @@ meta_window_x11_recalc_window_type (MetaWindow *window)
 
           meta_error_trap_push (window->display);
           atom_name = XGetAtomName (window->display->xdisplay,
-                                    window->type_atom);
+                                    priv->type_atom);
           meta_error_trap_pop (window->display);
 
           meta_warning ("Unrecognized type atom [%s] set for %s \n",


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