[metacity] compositor: remove meta_compositor_free_window
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: remove meta_compositor_free_window
- Date: Wed, 1 Mar 2017 19:04:28 +0000 (UTC)
commit f036b76d14e50c39bc381f4ddbd59529b1d088c8
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Mar 1 20:51:36 2017 +0200
compositor: remove meta_compositor_free_window
src/compositor/meta-compositor-none.c | 9 +---
src/compositor/meta-compositor-private.h | 5 +--
src/compositor/meta-compositor-xrender.c | 71 +++++++++++++----------------
src/compositor/meta-compositor.c | 15 +-----
src/core/window.c | 2 +-
src/include/meta-compositor.h | 5 +--
6 files changed, 38 insertions(+), 69 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index 388edfd..8147908 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -53,7 +53,7 @@ meta_compositor_none_add_window (MetaCompositor *compositor,
static void
meta_compositor_none_remove_window (MetaCompositor *compositor,
- Window xwindow)
+ MetaWindow *window)
{
}
@@ -109,12 +109,6 @@ meta_compositor_none_end_move (MetaCompositor *compositor,
}
static void
-meta_compositor_none_free_window (MetaCompositor *compositor,
- MetaWindow *window)
-{
-}
-
-static void
meta_compositor_none_maximize_window (MetaCompositor *compositor,
MetaWindow *window)
{
@@ -152,7 +146,6 @@ meta_compositor_none_class_init (MetaCompositorNoneClass *none_class)
compositor_class->begin_move = meta_compositor_none_begin_move;
compositor_class->update_move = meta_compositor_none_update_move;
compositor_class->end_move = meta_compositor_none_end_move;
- compositor_class->free_window = meta_compositor_none_free_window;
compositor_class->maximize_window = meta_compositor_none_maximize_window;
compositor_class->unmaximize_window = meta_compositor_none_unmaximize_window;
compositor_class->is_our_xwindow = meta_compositor_none_is_our_xwindow;
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index c8fab08..0d8feb0 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -40,7 +40,7 @@ struct _MetaCompositorClass
XWindowAttributes *attrs);
void (* remove_window) (MetaCompositor *compositor,
- Window xwindow);
+ MetaWindow *window);
void (* set_updates) (MetaCompositor *compositor,
MetaWindow *window,
@@ -71,9 +71,6 @@ struct _MetaCompositorClass
void (* end_move) (MetaCompositor *compositor,
MetaWindow *window);
- void (* free_window) (MetaCompositor *compositor,
- MetaWindow *window);
-
void (* maximize_window) (MetaCompositor *compositor,
MetaWindow *window);
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 2e3df82..0495d35 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -3237,8 +3237,39 @@ meta_compositor_xrender_add_window (MetaCompositor *compositor,
static void
meta_compositor_xrender_remove_window (MetaCompositor *compositor,
- Window xwindow)
+ MetaWindow *window)
{
+ MetaCompositorXRender *xrender;
+ MetaDisplay *display;
+ MetaFrame *frame;
+ Window xwindow;
+ MetaCompWindow *cw;
+
+ xrender = META_COMPOSITOR_XRENDER (compositor);
+ display = meta_compositor_get_display (compositor);
+ frame = meta_window_get_frame (window);
+
+ if (frame)
+ xwindow = meta_frame_get_xwindow (frame);
+ else
+ xwindow = meta_window_get_xwindow (window);
+
+ cw = find_window_in_display (display, xwindow);
+ if (cw == NULL)
+ return;
+
+ cw->window = NULL;
+ cw->attrs.map_state = IsUnmapped;
+ cw->damaged = FALSE;
+
+ if (cw->extents != None)
+ {
+ dump_xserver_region (xrender, "destroy_win", cw->extents);
+ add_damage (xrender, cw->screen, cw->extents);
+ cw->extents = None;
+ }
+
+ free_win (cw, FALSE);
}
static void
@@ -3630,43 +3661,6 @@ meta_compositor_xrender_end_move (MetaCompositor *compositor,
}
static void
-meta_compositor_xrender_free_window (MetaCompositor *compositor,
- MetaWindow *window)
-{
- MetaCompositorXRender *xrender;
- MetaDisplay *display;
- MetaFrame *frame;
- Window xwindow;
- MetaCompWindow *cw;
-
- xrender = META_COMPOSITOR_XRENDER (compositor);
- display = meta_compositor_get_display (compositor);
- frame = meta_window_get_frame (window);
-
- if (frame)
- xwindow = meta_frame_get_xwindow (frame);
- else
- xwindow = meta_window_get_xwindow (window);
-
- cw = find_window_in_display (display, xwindow);
- if (cw == NULL)
- return;
-
- cw->window = NULL;
- cw->attrs.map_state = IsUnmapped;
- cw->damaged = FALSE;
-
- if (cw->extents != None)
- {
- dump_xserver_region (xrender, "destroy_win", cw->extents);
- add_damage (xrender, cw->screen, cw->extents);
- cw->extents = None;
- }
-
- free_win (cw, FALSE);
-}
-
-static void
meta_compositor_xrender_maximize_window (MetaCompositor *compositor,
MetaWindow *window)
{
@@ -3734,7 +3728,6 @@ meta_compositor_xrender_class_init (MetaCompositorXRenderClass *xrender_class)
compositor_class->begin_move = meta_compositor_xrender_begin_move;
compositor_class->update_move = meta_compositor_xrender_update_move;
compositor_class->end_move = meta_compositor_xrender_end_move;
- compositor_class->free_window = meta_compositor_xrender_free_window;
compositor_class->maximize_window = meta_compositor_xrender_maximize_window;
compositor_class->unmaximize_window = meta_compositor_xrender_unmaximize_window;
compositor_class->is_our_xwindow = meta_compositor_xrender_is_our_xwindow;
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 1734759..24dec53 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -218,13 +218,13 @@ meta_compositor_add_window (MetaCompositor *compositor,
void
meta_compositor_remove_window (MetaCompositor *compositor,
- Window xwindow)
+ MetaWindow *window)
{
MetaCompositorClass *compositor_class;
compositor_class = META_COMPOSITOR_GET_CLASS (compositor);
- compositor_class->remove_window (compositor, xwindow);
+ compositor_class->remove_window (compositor, window);
}
void
@@ -313,17 +313,6 @@ meta_compositor_end_move (MetaCompositor *compositor,
}
void
-meta_compositor_free_window (MetaCompositor *compositor,
- MetaWindow *window)
-{
- MetaCompositorClass *compositor_class;
-
- compositor_class = META_COMPOSITOR_GET_CLASS (compositor);
-
- compositor_class->free_window (compositor, window);
-}
-
-void
meta_compositor_maximize_window (MetaCompositor *compositor,
MetaWindow *window)
{
diff --git a/src/core/window.c b/src/core/window.c
index 5ba5182..90238e3 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1017,7 +1017,7 @@ meta_window_free (MetaWindow *window,
meta_verbose ("Unmanaging 0x%lx\n", window->xwindow);
- meta_compositor_free_window (window->display->compositor, window);
+ meta_compositor_remove_window (window->display->compositor, window);
if (window->display->window_with_menu == window)
{
diff --git a/src/include/meta-compositor.h b/src/include/meta-compositor.h
index 1d59398..34e76df 100644
--- a/src/include/meta-compositor.h
+++ b/src/include/meta-compositor.h
@@ -50,7 +50,7 @@ void meta_compositor_add_window (MetaCompositor *composi
XWindowAttributes *attrs);
void meta_compositor_remove_window (MetaCompositor *compositor,
- Window xwindow);
+ MetaWindow *window);
void meta_compositor_set_updates (MetaCompositor *compositor,
MetaWindow *window,
@@ -81,9 +81,6 @@ void meta_compositor_update_move (MetaCompositor *composi
void meta_compositor_end_move (MetaCompositor *compositor,
MetaWindow *window);
-void meta_compositor_free_window (MetaCompositor *compositor,
- MetaWindow *window);
-
void meta_compositor_maximize_window (MetaCompositor *compositor,
MetaWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]