From b4ff6c7fafc624f1db379675f36889ac70edef8e Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Sat, 26 Apr 2014 17:09:18 +0200 Subject: libslab: GTK3 fixes --- libslab/app-resizer.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'libslab/app-resizer.c') diff --git a/libslab/app-resizer.c b/libslab/app-resizer.c index 5cdc247e..f1e34629 100644 --- a/libslab/app-resizer.c +++ b/libslab/app-resizer.c @@ -340,16 +340,17 @@ app_resizer_paint_window (GtkWidget * widget, GdkEventExpose * event, AppShellDa */ #if GTK_CHECK_VERSION (3, 0, 0) - GdkRectangle rect; - gdk_cairo_get_clip_rectangle (cr, &rect); + cairo_save(cr); + + GtkAllocation widget_allocation; + gtk_widget_get_allocation (widget, &widget_allocation); gdk_cairo_set_source_color (cr, gtk_widget_get_style (widget)->base); cairo_set_line_width(cr, 1); - cairo_rectangle(cr, 0, 0, rect.width, rect.height); + cairo_rectangle(cr, widget_allocation.x, widget_allocation.y, widget_allocation.width, widget_allocation.height); cairo_stroke_preserve(cr); cairo_fill(cr); - #else gdk_draw_rectangle (GTK_LAYOUT (widget)->bin_window, widget->style->base_gc[GTK_STATE_NORMAL], TRUE, event->area.x, event->area.y, @@ -360,16 +361,14 @@ app_resizer_paint_window (GtkWidget * widget, GdkEventExpose * event, AppShellDa { GtkWidget *selected_widget = GTK_WIDGET (app_data->selected_group); #if GTK_CHECK_VERSION (3, 0, 0) - GtkAllocation widget_allocation; GtkAllocation selected_widget_allocation; - gtk_widget_get_allocation (widget, &widget_allocation); gtk_widget_get_allocation (selected_widget, &selected_widget_allocation); gdk_cairo_set_source_color (cr, gtk_widget_get_style (selected_widget)->light); cairo_set_line_width(cr, 1); - cairo_rectangle(cr, selected_widget_allocation.x, selected_widget_allocation.y, widget_allocation.width, selected_widget_allocation.height); + cairo_rectangle(cr, selected_widget_allocation.x, selected_widget_allocation.y, selected_widget_allocation.width, selected_widget_allocation.height); cairo_stroke_preserve(cr); cairo_fill(cr); #else @@ -381,5 +380,9 @@ app_resizer_paint_window (GtkWidget * widget, GdkEventExpose * event, AppShellDa #endif } +#if GTK_CHECK_VERSION (3, 0, 0) + cairo_restore(cr); +#endif + return FALSE; } -- cgit v1.2.1