From 5a72b3105fc5698d52965107e2eedda50df3a819 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 31 Jan 2013 16:48:12 +0000 Subject: window: Fix coding style in gtk_window_draw implementation --- gtk/gtkwindow.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index abf946452f..af90bcc73c 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -8096,28 +8096,30 @@ gtk_window_draw (GtkWidget *widget, gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND); - if (priv->client_decorated && priv->type == GTK_WINDOW_TOPLEVEL) - { - gtk_style_context_add_class (context, "window-border"); - gtk_widget_get_allocation (widget, &allocation); - gtk_render_background (context, cr, - priv->window_border.left, - priv->window_border.top, - allocation.width - - priv->window_border.left - - priv->window_border.right, - allocation.height - - priv->window_border.top - - priv->window_border.bottom); - gtk_render_frame (context, cr, - 0, 0, allocation.width, allocation.height); - } + if (priv->client_decorated && + priv->decorated && + priv->type == GTK_WINDOW_TOPLEVEL) + { + gtk_style_context_add_class (context, "window-border"); + gtk_widget_get_allocation (widget, &allocation); + gtk_render_background (context, cr, + priv->window_border.left, + priv->window_border.top, + allocation.width - + (priv->window_border.left + + priv->window_border.right), + allocation.height - + (priv->window_border.top + + priv->window_border.bottom)); + gtk_render_frame (context, cr, + 0, 0, allocation.width, allocation.height); + } else - { - gtk_widget_get_allocation (widget, &allocation); - gtk_render_background (context, cr, - 0, 0, allocation.width, allocation.height); - } + { + gtk_widget_get_allocation (widget, &allocation); + gtk_render_background (context, cr, + 0, 0, allocation.width, allocation.height); + } gtk_style_context_restore (context); } @@ -8128,6 +8130,7 @@ gtk_window_draw (GtkWidget *widget, gtk_style_context_add_class (context, "titlebar"); gtk_widget_get_allocation (priv->title_box, &allocation); + /* Why do these subtract ? */ gtk_render_background (context, cr, allocation.x - priv->title_border.left, allocation.y - priv->title_border.top, -- cgit v1.2.1