[metacity] compositor: remove find_window_for_screen
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: remove find_window_for_screen
- Date: Fri, 3 Mar 2017 18:48:04 +0000 (UTC)
commit 2d96620809642456d76d6d3a39c32c435042879a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Mar 3 18:26:30 2017 +0200
compositor: remove find_window_for_screen
src/compositor/meta-compositor-xrender.c | 45 +++++++++--------------------
1 files changed, 14 insertions(+), 31 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 474cc9c..798b7f8 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -740,33 +740,15 @@ shadow_picture (MetaCompositorXRender *xrender,
}
static MetaCompWindow *
-find_window_for_screen (MetaCompositorXRender *xrender,
- MetaScreen *screen,
- Window xwindow)
-{
- MetaCompScreen *info = xrender->info;
-
- if (info == NULL)
- return NULL;
-
- return g_hash_table_lookup (info->windows_by_xid, (gpointer) xwindow);
-}
-
-static MetaCompWindow *
find_window_in_display (MetaCompositorXRender *xrender,
MetaDisplay *display,
Window xwindow)
{
- MetaScreen *screen;
- MetaCompWindow *cw;
-
- screen = meta_display_get_screen (display);
- cw = find_window_for_screen (xrender, screen, xwindow);
-
- if (cw != NULL)
- return cw;
+ if (xrender->info == NULL)
+ return NULL;
- return NULL;
+ return g_hash_table_lookup (xrender->info->windows_by_xid,
+ (gpointer) xwindow);
}
static MetaCompWindow *
@@ -2071,7 +2053,7 @@ map_win (MetaCompositorXRender *xrender,
MetaScreen *screen,
Window id)
{
- MetaCompWindow *cw = find_window_for_screen (xrender, screen, id);
+ MetaCompWindow *cw = find_window_in_display (xrender, display, id);
Display *xdisplay = meta_display_get_xdisplay (display);
if (cw == NULL)
@@ -2125,7 +2107,9 @@ unmap_win (MetaCompositorXRender *xrender,
MetaScreen *screen,
Window id)
{
- MetaCompWindow *cw = find_window_for_screen (xrender, screen, id);
+ MetaCompositor *compositor = META_COMPOSITOR (xrender);
+ MetaDisplay *display = meta_compositor_get_display (compositor);
+ MetaCompWindow *cw = find_window_in_display (xrender, display, id);
MetaCompScreen *info = xrender->info;
if (cw == NULL || info == NULL)
@@ -2283,7 +2267,7 @@ add_win (MetaCompositorXRender *xrender,
return;
/* If already added, ignore */
- if (find_window_for_screen (xrender, screen, xwindow) != NULL)
+ if (find_window_in_display (xrender, display, xwindow) != NULL)
return;
cw = g_new0 (MetaCompWindow, 1);
@@ -3382,7 +3366,6 @@ meta_compositor_xrender_get_window_surface (MetaCompositor *compositor,
{
MetaFrame *frame;
Window xwindow;
- MetaScreen *screen;
MetaCompWindow *cw;
MetaDisplay *display;
Display *xdisplay;
@@ -3404,13 +3387,13 @@ meta_compositor_xrender_get_window_surface (MetaCompositor *compositor,
else
xwindow = meta_window_get_xwindow (window);
- screen = meta_window_get_screen (window);
- cw = find_window_for_screen (META_COMPOSITOR_XRENDER (compositor), screen, xwindow);
+ display = meta_compositor_get_display (compositor);
+ cw = find_window_in_display (META_COMPOSITOR_XRENDER (compositor),
+ display, xwindow);
if (cw == NULL)
return NULL;
- display = meta_compositor_get_display (compositor);
xdisplay = meta_display_get_xdisplay (display);
shaded = meta_window_is_shaded (window);
@@ -3534,7 +3517,7 @@ meta_compositor_xrender_set_active_window (MetaCompositor *compositor,
{
MetaFrame *f = meta_window_get_frame (old_focus_win);
- old_focus = find_window_for_screen (xrender, screen,
+ old_focus = find_window_in_display (xrender, display,
f ? meta_frame_get_xwindow (f) :
meta_window_get_xwindow (old_focus_win));
}
@@ -3542,7 +3525,7 @@ meta_compositor_xrender_set_active_window (MetaCompositor *compositor,
if (window)
{
MetaFrame *f = meta_window_get_frame (window);
- new_focus = find_window_for_screen (xrender, screen,
+ new_focus = find_window_in_display (xrender, display,
f ? meta_frame_get_xwindow (f) :
meta_window_get_xwindow (window));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]