summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libslab/app-resizer.c17
-rw-r--r--libslab/app-shell.c4
2 files changed, 13 insertions, 8 deletions
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;
}
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index 7c4f8f13..e5844be3 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -132,7 +132,9 @@ create_main_window (AppShellData * app_data, const gchar * app_name, const gchar
app_data->main_app = main_app;
gtk_widget_set_name (main_app, app_name);
gtk_window_set_title (GTK_WINDOW (main_app), title);
- /* gtk_window_set_default_size(GTK_WINDOW(main_app), width, height); */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_window_set_default_size(GTK_WINDOW(main_app), width, height);
+#endif
gtk_window_set_icon_name (GTK_WINDOW (main_app), window_icon);
gtk_container_add (GTK_CONTAINER (main_app), app_data->shell);