From 70d26b5b36cd848ca6c1f33c3bef7f4742355a47 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 9 Apr 2008 20:16:16 +0200 Subject: [PATCH] [swindow] Free GC, make refresh inline Signed-off-by: Julien Danjou --- common/swindow.c | 14 +------------- common/swindow.h | 14 +++++++++++++- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/swindow.c b/common/swindow.c index 2444e8814..60cf252ad 100644 --- a/common/swindow.c +++ b/common/swindow.c @@ -87,6 +87,7 @@ simplewindow_delete(simple_window_t **sw) { xcb_destroy_window((*sw)->connection, (*sw)->window); xcb_free_pixmap((*sw)->connection, (*sw)->drawable); + xcb_free_gc((*sw)->connection, (*sw)->gc); p_delete(sw); } @@ -128,17 +129,4 @@ simplewindow_resize(simple_window_t *sw, unsigned int w, unsigned int h) resize_win_vals); } -/** Refresh the window content - * \param sw the simple_window_t to refresh - * \param phys_screen physical screen id - */ -void -simplewindow_refresh_drawable(simple_window_t *sw) -{ - xcb_copy_area(sw->connection, sw->drawable, - sw->window, sw->gc, 0, 0, 0, 0, - sw->geometry.width, - sw->geometry.height); -} - // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/common/swindow.h b/common/swindow.h index 9221b5402..85570a504 100644 --- a/common/swindow.h +++ b/common/swindow.h @@ -39,7 +39,6 @@ simple_window_t * simplewindow_new(xcb_connection_t *, int, int, int, unsigned i void simplewindow_delete(simple_window_t **); void simplewindow_move(simple_window_t *, int, int); void simplewindow_resize(simple_window_t *, unsigned int, unsigned int); -void simplewindow_refresh_drawable(simple_window_t *); static inline void simplewindow_move_resize(simple_window_t *sw, int x, int y, @@ -49,5 +48,18 @@ simplewindow_move_resize(simple_window_t *sw, int x, int y, simplewindow_resize(sw, w, h); } +/** Refresh the window content + * \param sw the simple_window_t to refresh + * \param phys_screen physical screen id + */ +static inline void +simplewindow_refresh_drawable(simple_window_t *sw) +{ + xcb_copy_area(sw->connection, sw->drawable, + sw->window, sw->gc, 0, 0, 0, 0, + sw->geometry.width, + sw->geometry.height); +} + #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80