[mutter] Add meta_window_is_mapped, remove usage of window-private.h from mutter-window.c
- From: Colin Walters <walters src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [mutter] Add meta_window_is_mapped, remove usage of window-private.h from mutter-window.c
- Date: Fri, 14 Aug 2009 23:59:50 +0000 (UTC)
commit 41cf9134a6f0c6fdbdfa0a9286a944ce91b9c185
Author: Colin Walters <walters verbum org>
Date: Fri Aug 14 06:18:28 2009 -0400
Add meta_window_is_mapped, remove usage of window-private.h from mutter-window.c
mutter-window.c originally grew an #include "window-private.h" for
window->override_redirect, but that was just fixed. However since
then it also ended up relying on a few other minor private bits.
To fix that, add meta_window_is_mapped, promote meta_window_toplevel_is_mapped
to public, and use the public MetaDisplay accessor.
src/compositor/mutter-window.c | 7 +++----
src/core/window-private.h | 2 --
src/core/window.c | 12 ++++++++++++
src/include/window.h | 2 ++
4 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c
index bfa6e29..83080f8 100644
--- a/src/compositor/mutter-window.c
+++ b/src/compositor/mutter-window.c
@@ -10,7 +10,6 @@
#include <clutter/x11/clutter-x11.h>
-#include "../core/window-private.h" /* FIXME: add meta_window_is_override_redirect */
#include "display.h"
#include "errors.h"
#include "frame.h"
@@ -844,7 +843,7 @@ mutter_window_after_effects (MutterWindow *self)
mutter_window_sync_visibility (self);
mutter_window_sync_actor_position (self);
- if (!priv->window->mapped)
+ if (!meta_window_is_mapped (priv->window))
mutter_window_detach (self);
if (priv->needs_repair)
@@ -1183,7 +1182,7 @@ mutter_window_new (MetaWindow *window)
/* FIXME: Remove the redundant data we store in self->priv->attrs, and
* simply query metacity core for the data. */
- if (!XGetWindowAttributes (display->xdisplay, top_window, &attrs))
+ if (!XGetWindowAttributes (meta_display_get_xdisplay (display), top_window, &attrs))
return NULL;
self = g_object_new (MUTTER_TYPE_COMP_WINDOW,
@@ -1633,7 +1632,7 @@ check_needs_reshape (MutterWindow *self)
#ifdef HAVE_SHAPE
if (priv->shaped)
{
- Display *xdisplay = meta_display_get_xdisplay (priv->window->display);
+ Display *xdisplay = meta_display_get_xdisplay (meta_window_get_display (priv->window));
XRectangle *rects;
int n_rects, ordering;
diff --git a/src/core/window-private.h b/src/core/window-private.h
index cb003f9..044acbe 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -456,8 +456,6 @@ void meta_window_resize_with_gravity (MetaWindow *window,
/* Return whether the window should be currently mapped */
gboolean meta_window_should_be_showing (MetaWindow *window);
-gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
-
/* See warning in window.c about this function */
gboolean __window_is_terminal (MetaWindow *window);
diff --git a/src/core/window.c b/src/core/window.c
index 1302d16..92706c8 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2322,6 +2322,18 @@ unmap_client_window (MetaWindow *window,
}
/**
+ * meta_window_is_mapped:
+ * @window: a #MetaWindow
+ *
+ * Determines whether the X window for the MetaWindow is mapped.
+ */
+gboolean
+meta_window_is_mapped (MetaWindow *window)
+{
+ return window->mapped;
+}
+
+/**
* meta_window_toplevel_is_mapped:
* @window: a #MetaWindow
*
diff --git a/src/include/window.h b/src/include/window.h
index 1d0053a..fb7c077 100644
--- a/src/include/window.h
+++ b/src/include/window.h
@@ -103,6 +103,8 @@ MetaStackLayer meta_window_get_layer (MetaWindow *window);
MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
MetaWindow *transient);
+gboolean meta_window_is_mapped (MetaWindow *window);
+gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
gboolean meta_window_get_icon_geometry (MetaWindow *window,
MetaRectangle *rect);
void meta_window_maximize (MetaWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]