summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-26 14:59:01 +0100
committerinfirit <[email protected]>2014-11-26 18:13:43 +0100
commit7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1 (patch)
tree8bc45fd0079293b4a328d779d4d9ff23356f9900
parentd2d685818a85b773c49802c494a0c386917b5ee6 (diff)
downloadmate-applets-7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1.tar.bz2
mate-applets-7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1.tar.xz
Gtk3: don't use deprecated gtk_widget_size_request
Taken from gnome-panel commit: c05c6b07ec493d174062a06caf185d324fd6e0c4 From: Alberts Muktupāvels <[email protected]>
-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);