This is an automated email from the git hooks/post-receive script. nomad pushed a commit to branch master in repository apps/xfdashboard.
commit 4af8d57f5da3bf825d2c1554dadb1c44ea3aa757 Author: Stephan Haller <[email protected]> Date: Tue Aug 23 13:54:26 2016 +0200 Revert "Allow overriding draw function of background borders and corner, e.g. interesting for popup-menus to draw an arrow on any side of background." This reverts commit 387eb45962eb05a18a50b2bd227dc300744922cd. --- libxfdashboard/background.c | 72 ++++++++++++++++----------------------------- libxfdashboard/background.h | 1 - 2 files changed, 26 insertions(+), 47 deletions(-) diff --git a/libxfdashboard/background.c b/libxfdashboard/background.c index 895f507..913f426 100644 --- a/libxfdashboard/background.c +++ b/libxfdashboard/background.c @@ -96,22 +96,35 @@ static GParamSpec* XfdashboardBackgroundProperties[PROP_LAST]={ 0, }; /* IMPLEMENTATION: Private variables and methods */ -/* Draw border and corners */ -static void _xfdashboard_background_draw(XfdashboardBackground *self, - cairo_t *inContext, - int inWidth, - int inHeight) +/* Rectangle canvas should be redrawn */ +static gboolean _xfdashboard_background_on_draw_fill_canvas(XfdashboardBackground *self, + cairo_t *inContext, + int inWidth, + int inHeight, + gpointer inUserData) { XfdashboardBackgroundPrivate *priv; - g_return_if_fail(XFDASHBOARD_IS_BACKGROUND(self)); + g_return_val_if_fail(XFDASHBOARD_IS_BACKGROUND(self), TRUE); + g_return_val_if_fail(CLUTTER_IS_CANVAS(inUserData), TRUE); priv=self->priv; - /* Determine if we should draw rounded corners and call virtual function - * to draw rectangle with or without rounded corners. - */ - if((priv->type & XFDASHBOARD_BACKGROUND_TYPE_ROUNDED_CORNERS) && + /* Clear current contents of the canvas */ + cairo_save(inContext); + cairo_set_operator(inContext, CAIRO_OPERATOR_CLEAR); + cairo_paint(inContext); + cairo_restore(inContext); + + cairo_set_operator(inContext, CAIRO_OPERATOR_OVER); + + /* Do nothing if type does not include filling background */ + if(!(priv->type & XFDASHBOARD_BACKGROUND_TYPE_FILL)) return(CLUTTER_EVENT_PROPAGATE); + + /* Determine if we should draw rounded corners */ + + /* Draw rectangle with or without rounded corners */ + if((priv->type & XFDASHBOARD_BACKGROUND_TYPE_ROUNDED_CORNERS) && (priv->fillCorners & XFDASHBOARD_CORNERS_ALL) && priv->fillCornersRadius>0.0f) { @@ -161,37 +174,6 @@ static void _xfdashboard_background_draw(XfdashboardBackground *self, { cairo_rectangle(inContext, 0, 0, inWidth, inHeight); } -} - -/* Rectangle canvas should be redrawn */ -static gboolean _xfdashboard_background_on_draw_fill_canvas(XfdashboardBackground *self, - cairo_t *inContext, - int inWidth, - int inHeight, - gpointer inUserData) -{ - XfdashboardBackgroundPrivate *priv; - XfdashboardBackgroundClass *klass; - - g_return_val_if_fail(XFDASHBOARD_IS_BACKGROUND(self), CLUTTER_EVENT_PROPAGATE); - g_return_val_if_fail(CLUTTER_IS_CANVAS(inUserData), CLUTTER_EVENT_PROPAGATE); - - priv=self->priv; - - /* Clear current contents of the canvas */ - cairo_save(inContext); - cairo_set_operator(inContext, CAIRO_OPERATOR_CLEAR); - cairo_paint(inContext); - cairo_restore(inContext); - - cairo_set_operator(inContext, CAIRO_OPERATOR_OVER); - - /* Do nothing if type does not include filling background */ - if(!(priv->type & XFDASHBOARD_BACKGROUND_TYPE_FILL)) return(CLUTTER_EVENT_PROPAGATE); - - /* Call virtual function to draw rectangle with or without rounded corners */ - klass=XFDASHBOARD_BACKGROUND_GET_CLASS(self); - if(klass->draw) klass->draw(self, inContext, inWidth, inHeight); /* Set color for filling and fill canvas */ if(priv->fillColor) clutter_cairo_set_source_color(inContext, priv->fillColor); @@ -424,15 +406,13 @@ static void xfdashboard_background_class_init(XfdashboardBackgroundClass *klass) GObjectClass *gobjectClass=G_OBJECT_CLASS(klass); /* Override functions */ - klass->draw=_xfdashboard_background_draw; - - clutterActorClass->paint_node=_xfdashboard_background_paint_node; - clutterActorClass->allocate=_xfdashboard_background_allocate; - gobjectClass->dispose=_xfdashboard_background_dispose; gobjectClass->set_property=_xfdashboard_background_set_property; gobjectClass->get_property=_xfdashboard_background_get_property; + clutterActorClass->paint_node=_xfdashboard_background_paint_node; + clutterActorClass->allocate=_xfdashboard_background_allocate; + /* Set up private structure */ g_type_class_add_private(klass, sizeof(XfdashboardBackgroundPrivate)); diff --git a/libxfdashboard/background.h b/libxfdashboard/background.h index b7b8d78..3d02f01 100644 --- a/libxfdashboard/background.h +++ b/libxfdashboard/background.h @@ -86,7 +86,6 @@ struct _XfdashboardBackgroundClass /*< public >*/ /* Virtual functions */ - void (*draw)(XfdashboardBackground *self, cairo_t *inContext, gint inWidth, gint inHeight); }; /* Public API */ -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
