summaryrefslogtreecommitdiff
path: root/src/ui/preview-widget.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-25 12:35:42 +0200
committerinfirit <[email protected]>2014-10-25 12:35:42 +0200
commit20615934a9d4faf8cd45de56c51357d985461267 (patch)
treeadbb76e5fb32a72f51b0e4a6163c52b6a3d140b7 /src/ui/preview-widget.c
parent4134fe7aaf52512403e5a1319ed61fab0ce288d8 (diff)
downloadmarco-20615934a9d4faf8cd45de56c51357d985461267.tar.bz2
marco-20615934a9d4faf8cd45de56c51357d985461267.tar.xz
Cleanup GTK_CHECK_VERSION and unify where possible
gdk_x11_window_lookup_for_display since 2.24 GDK_WINDOW_XID since always gtk_widget_get_visible since 2.18 gtk_widget_set_mapped since 2.20 gdk_event_new since 2.2 gdk_x11_window_lookup_for_display since 2.24 gdk_text_property_to_utf8_list_for_display since 2.2 gtk_widget_get_realized since 2.20 gdk_visual_get_depth since 2.22 gtk_widget_get_window since 2.14 gtk_widget_set_allocation since 2.18
Diffstat (limited to 'src/ui/preview-widget.c')
-rw-r--r--src/ui/preview-widget.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index 5b008fa2..0bc6b42a 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -494,22 +494,14 @@ meta_preview_size_allocate (GtkWidget *widget,
{
MetaPreview *preview;
int border_width;
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkAllocation widget_allocation, child_allocation;
-#else
- GtkAllocation child_allocation;
-#endif
GtkWidget *child;
preview = META_PREVIEW (widget);
ensure_info (preview);
-#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_set_allocation (widget, allocation);
-#else
- widget->allocation = *allocation;
-#endif
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
@@ -517,20 +509,12 @@ meta_preview_size_allocate (GtkWidget *widget,
if (child &&
gtk_widget_get_visible (child))
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_allocation (widget, &widget_allocation);
child_allocation.x = widget_allocation.x + border_width + preview->left_width;
child_allocation.y = widget_allocation.y + border_width + preview->top_height;
child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->left_width - preview->right_width);
child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->top_height - preview->bottom_height);
-#else
- child_allocation.x = allocation->x + border_width + preview->left_width;
- child_allocation.y = allocation->y + border_width + preview->top_height;
-
- child_allocation.width = MAX (1, allocation->width - border_width * 2 - preview->left_width - preview->right_width);
- child_allocation.height = MAX (1, allocation->height - border_width * 2 - preview->top_height - preview->bottom_height);
-#endif
gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), &child_allocation);
}
}