summaryrefslogtreecommitdiff
path: root/gtk/gtkclist.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkclist.c')
-rw-r--r--gtk/gtkclist.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 64f8f8322b..bfef6fc743 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -1729,6 +1729,7 @@ gtk_clist_realize (GtkWidget * widget)
GdkWindowAttr attributes;
gint attributes_mask;
GdkGCValues values;
+ gint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CLIST (widget));
@@ -1737,11 +1738,13 @@ gtk_clist_realize (GtkWidget * widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ border_width = GTK_CONTAINER (widget)->border_width;
+
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = widget->allocation.x + border_width;
+ attributes.y = widget->allocation.y + border_width;
+ attributes.width = widget->allocation.width - border_width * 2;
+ attributes.height = widget->allocation.height - border_width * 2;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
@@ -1951,6 +1954,7 @@ gtk_clist_draw (GtkWidget * widget,
GdkRectangle * area)
{
GtkCList *clist;
+ gint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CLIST (widget));
@@ -1959,9 +1963,11 @@ gtk_clist_draw (GtkWidget * widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
clist = GTK_CLIST (widget);
+ border_width = GTK_CONTAINER (widget)->border_width;
gdk_window_clear_area (widget->window,
- area->x, area->y,
+ area->x - border_width,
+ area->y - border_width,
area->width, area->height);
/* draw list shadow/border */