summaryrefslogtreecommitdiffstats
path: root/source/widgets
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-05-28 17:34:53 +0200
committerDave Davenport <qball@gmpclient.org>2017-05-28 17:34:53 +0200
commitfff06fc88046be27394b131c252c95658e43a1c7 (patch)
tree65de0b84f7542ecc2b827899de672ea6dcda114a /source/widgets
parent5e946b8383e425ca3bccb2a3cca51e06df2c6106 (diff)
Don't keep pointer to inputbar/main_box
Diffstat (limited to 'source/widgets')
-rw-r--r--source/widgets/widget.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/widgets/widget.c b/source/widgets/widget.c
index 13875e58..f715af08 100644
--- a/source/widgets/widget.c
+++ b/source/widgets/widget.c
@@ -442,6 +442,9 @@ gboolean widget_motion_notify ( widget *wid, xcb_motion_notify_event_t *xme )
int widget_padding_get_left ( const widget *wid )
{
+ if ( wid == NULL ) {
+ return 0;
+ }
int distance = distance_get_pixel ( wid->padding.left, ORIENTATION_HORIZONTAL );
distance += distance_get_pixel ( wid->border.left, ORIENTATION_HORIZONTAL );
distance += distance_get_pixel ( wid->margin.left, ORIENTATION_HORIZONTAL );
@@ -449,6 +452,9 @@ int widget_padding_get_left ( const widget *wid )
}
int widget_padding_get_right ( const widget *wid )
{
+ if ( wid == NULL ) {
+ return 0;
+ }
int distance = distance_get_pixel ( wid->padding.right, ORIENTATION_HORIZONTAL );
distance += distance_get_pixel ( wid->border.right, ORIENTATION_HORIZONTAL );
distance += distance_get_pixel ( wid->margin.right, ORIENTATION_HORIZONTAL );
@@ -456,6 +462,9 @@ int widget_padding_get_right ( const widget *wid )
}
int widget_padding_get_top ( const widget *wid )
{
+ if ( wid == NULL ) {
+ return 0;
+ }
int distance = distance_get_pixel ( wid->padding.top, ORIENTATION_VERTICAL );
distance += distance_get_pixel ( wid->border.top, ORIENTATION_VERTICAL );
distance += distance_get_pixel ( wid->margin.top, ORIENTATION_VERTICAL );
@@ -463,6 +472,9 @@ int widget_padding_get_top ( const widget *wid )
}
int widget_padding_get_bottom ( const widget *wid )
{
+ if ( wid == NULL ) {
+ return 0;
+ }
int distance = distance_get_pixel ( wid->padding.bottom, ORIENTATION_VERTICAL );
distance += distance_get_pixel ( wid->border.bottom, ORIENTATION_VERTICAL );
distance += distance_get_pixel ( wid->margin.bottom, ORIENTATION_VERTICAL );