summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--battstat/battstat_applet.c4
-rw-r--r--charpick/charpick.c12
-rw-r--r--drivemount/drive-button.c9
-rw-r--r--stickynotes/stickynotes_applet.c4
4 files changed, 27 insertions, 2 deletions
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index cd57e085..16216a9b 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -528,7 +528,11 @@ battery_low_update_text( ProgressData *battstat, BatteryStatus *info )
battstat->battery_low_dialog == NULL )
return;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (battstat->battery_low_label), NULL, &size);
+#else
gtk_widget_size_request( GTK_WIDGET( battstat->battery_low_label ), &size );
+#endif
/* If the label has never been set before, the width will be 0. If it
has been set before (width > 0) then we want to keep the size of
diff --git a/charpick/charpick.c b/charpick/charpick.c
index 299df110..a9ff423b 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -328,8 +328,12 @@ get_menu_pos (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
GtkRequisition reqmenu;
gint tempx, tempy, width, height;
gint screen_width, screen_height;
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &reqmenu);
+#else
gtk_widget_size_request (GTK_WIDGET (menu), &reqmenu);
+#endif
gdk_window_get_origin (GDK_WINDOW (gtk_widget_get_window(curr_data->applet)), &tempx, &tempy);
gdk_window_get_geometry (GDK_WINDOW (gtk_widget_get_window(curr_data->applet)), NULL, NULL,
&width, &height
@@ -488,8 +492,12 @@ build_table(charpick_data *p_curr_data)
force_no_focus_padding (toggle_button[i]);
gtk_widget_set_tooltip_text (toggle_button[i], name);
g_free (name);
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (toggle_button[i], NULL, &req);
+#else
gtk_widget_size_request (toggle_button[i], &req);
+#endif
max_width = MAX (max_width, req.width);
max_height = MAX (max_height, req.height-2);
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index 2b27add8..54daa608 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -380,8 +380,13 @@ drive_button_update (gpointer user_data)
g_free (display_name);
/* base the icon size on the desired button size */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (self), NULL, &button_req);
+ gtk_widget_get_preferred_size (gtk_bin_get_child (GTK_BIN (self)), NULL, &image_req);
+#else
gtk_widget_size_request (GTK_WIDGET (self), &button_req);
gtk_widget_size_request (gtk_bin_get_child (GTK_BIN (self)), &image_req);
+#endif
width = self->icon_size - (button_req.width - image_req.width);
height = self->icon_size - (button_req.height - image_req.height);
@@ -414,7 +419,11 @@ drive_button_update (gpointer user_data)
gtk_image_set_from_pixbuf (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (self))), pixbuf);
g_object_unref (pixbuf);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (self), NULL, &button_req);
+#else
gtk_widget_size_request (GTK_WIDGET (self), &button_req);
+#endif
return FALSE;
}
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index 2b2bb21c..f7fbb853 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -620,7 +620,11 @@ stickynotes_applet_panel_icon_get_geometry (int *x, int *y, int *width, int *hei
widget = GTK_WIDGET (applet->w_image);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (widget, NULL, &requisition);
+#else
gtk_widget_size_request (widget, &requisition);
+#endif
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);