swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit bcd3c47533ba56c9f64ad0691d0df7a7fe0e85f4
parent d95b8178ddb4304c7c3ee325bdae366b81cb6b89
Author: Michael Forney <mforney@mforney.org>
Date:   Sat,  8 Feb 2014 00:21:17 -0800

compositor: Use assert to ensure view is created by compositor

Diffstat:
Mlibswc/compositor.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libswc/compositor.c b/libswc/compositor.c @@ -546,8 +546,7 @@ bool swc_compositor_remove_surface(struct swc_surface * surface) { struct view * view = (void *) surface->view; - if (view->base.impl != &view_impl) - return false; + assert(view->base.impl == &view_impl); swc_compositor_surface_hide(view->surface); swc_surface_set_view(view->surface, NULL); @@ -562,8 +561,7 @@ void swc_compositor_surface_show(struct swc_surface * surface) { struct view * view = (void *) surface->view; - if (view->base.impl != &view_impl) - return; + assert(view->base.impl == &view_impl); if (view->visible) return; @@ -586,8 +584,7 @@ void swc_compositor_surface_hide(struct swc_surface * surface) { struct view * view = (void *) surface->view; - if (view->base.impl != &view_impl) - return; + assert(view->base.impl == &view_impl); if (!view->visible) return; @@ -606,6 +603,8 @@ void swc_compositor_surface_set_border_width(struct swc_surface * surface, { struct view * view = (void *) surface->view; + assert(view->base.impl == &view_impl); + if (view->border.width == width) return; @@ -623,6 +622,8 @@ void swc_compositor_surface_set_border_color(struct swc_surface * surface, { struct view * view = (void *) surface->view; + assert(view->base.impl == &view_impl); + if (view->border.color == color) return;