summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-29 16:44:32 +0100
committerStefano Karapetsas <[email protected]>2014-01-29 16:44:32 +0100
commitaeb3d9ad24b09b102b317faff9a95ff292b130a9 (patch)
treec0b61e1dde0b4becb653918c78f05d9dc22dc8b0
parente397afd8492a527b7798bf644c1d886a9db5a7a1 (diff)
downloadmate-control-center-aeb3d9ad24b09b102b317faff9a95ff292b130a9.tar.bz2
mate-control-center-aeb3d9ad24b09b102b317faff9a95ff292b130a9.tar.xz
Fix some build errors with GTK3
Shell is still a bit unusable with GTK3
-rw-r--r--libslab/app-resizer.c28
-rw-r--r--libslab/shell-window.c14
2 files changed, 23 insertions, 19 deletions
diff --git a/libslab/app-resizer.c b/libslab/app-resizer.c
index bf70fbb1..5cdc247e 100644
--- a/libslab/app-resizer.c
+++ b/libslab/app-resizer.c
@@ -205,7 +205,7 @@ app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
AppResizer *resizer = APP_RESIZER (widget);
GtkWidget *child = GTK_WIDGET (APP_RESIZER (resizer)->child);
GtkAllocation widget_allocation;
- GtkRequisition *child_requisition;
+ GtkRequisition child_requisition;
static gboolean first_time = TRUE;
gint new_num_cols;
@@ -226,9 +226,9 @@ app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
}
#if GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_get_preferred_size (child, child_requisition, NULL);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
#else
- child_requisition = &child->requisition;
+ child_requisition = child->requisition;
#endif
if (!resizer->cached_tables_list) /* if everthing is currently filtered out - just return */
@@ -241,24 +241,24 @@ app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
/* We want the message to center itself and only scroll if it's bigger than the available real size. */
child_allocation.x = 0;
child_allocation.y = 0;
- child_allocation.width = MAX (allocation->width, child_requisition->width);
- child_allocation.height = MAX (allocation->height, child_requisition->height);
+ child_allocation.width = MAX (allocation->width, child_requisition.width);
+ child_allocation.height = MAX (allocation->height, child_requisition.height);
gtk_widget_size_allocate (child, &child_allocation);
gtk_layout_set_size (GTK_LAYOUT (resizer), child_allocation.width,
child_allocation.height);
return;
}
- GtkRequisition *other_requisiton;
+ GtkRequisition other_requisiton;
#if GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_get_preferred_size (GTK_WIDGET (resizer->cached_tables_list->data), other_requisiton, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (resizer->cached_tables_list->data), &other_requisiton, NULL);
#else
- other_requisiton = &GTK_WIDGET (resizer->cached_tables_list->data)->requisition;
+ other_requisiton = GTK_WIDGET (resizer->cached_tables_list->data)->requisition;
#endif
useable_area =
- allocation->width - (child_requisition->width -
- other_requisiton->width);
+ allocation->width - (child_requisition.width -
+ other_requisiton.width);
new_num_cols =
relayout_tables_if_needed (APP_RESIZER (resizer), useable_area,
resizer->cur_num_cols);
@@ -340,13 +340,13 @@ 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);
+ GdkRectangle rect;
+ gdk_cairo_get_clip_rectangle (cr, &rect);
- gdk_cairo_set_source_color (cr, gtk_widget_get_style (gtk_layout_get_bin_window (GTK_LAYOUT (widget)))->base);
+ 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, 0, 0, rect.width, rect.height);
cairo_stroke_preserve(cr);
cairo_fill(cr);
diff --git a/libslab/shell-window.c b/libslab/shell-window.c
index a5a5a3e5..b22b5c51 100644
--- a/libslab/shell-window.c
+++ b/libslab/shell-window.c
@@ -69,9 +69,13 @@ shell_window_new (AppShellData * app_data)
g_signal_connect (G_OBJECT (window), "expose-event", G_CALLBACK (shell_window_paint_window),
#endif
NULL);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /* FIXME */
+#else
window->resize_handler_id =
g_signal_connect (G_OBJECT (window), "size-request",
G_CALLBACK (shell_window_handle_size_request), app_data);
+#endif
return GTK_WIDGET (window);
}
@@ -96,12 +100,12 @@ shell_window_handle_size_request (GtkWidget * widget, GtkRequisition * requisiti
AppShellData * app_data)
{
gint height;
- GtkRequisition *child_requisiton;
+ GtkRequisition child_requisiton;
#if GTK_CHECK_VERSION (3, 0, 0)
- gtk_widget_get_preferred_size (GTK_WIDGET (APP_RESIZER (app_data->category_layout)->child), child_requisiton, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (APP_RESIZER (app_data->category_layout)->child), &child_requisiton, NULL);
#else
- child_requisiton = &GTK_WIDGET (APP_RESIZER (app_data->category_layout)->child)->requisition;
+ child_requisiton = GTK_WIDGET (APP_RESIZER (app_data->category_layout)->child)->requisition;
#endif
/*
@@ -113,12 +117,12 @@ shell_window_handle_size_request (GtkWidget * widget, GtkRequisition * requisiti
printf("right side width:%d\n", GTK_WIDGET(APP_RESIZER(app_data->category_layout)->child)->requisition.width);
*/
- requisition->width += child_requisiton->width;
+ requisition->width += child_requisiton.width;
/* use the left side as a minimum height, if the right side is taller,
use it up to SIZING_HEIGHT_PERCENT of the screen height
*/
- height = child_requisiton->height + 10;
+ height = child_requisiton.height + 10;
if (height > requisition->height)
{
requisition->height =