summaryrefslogtreecommitdiff
path: root/src/gpm-kbd-backlight.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-05-31 14:54:15 +0200
committerraveit65 <[email protected]>2016-05-31 14:54:15 +0200
commit956b94160dc0340d8aac765d96ac5c3de0b18f53 (patch)
treeb54ec68d085272cd39a336b356ac40a5965c1a5f /src/gpm-kbd-backlight.c
parentbf7af908d6cc1f4d6517c01d27f417fe09743416 (diff)
downloadmate-power-manager-956b94160dc0340d8aac765d96ac5c3de0b18f53.tar.bz2
mate-power-manager-956b94160dc0340d8aac765d96ac5c3de0b18f53.tar.xz
GTK+3: do not use deprecated gtk_widget_size_request
Diffstat (limited to 'src/gpm-kbd-backlight.c')
-rw-r--r--src/gpm-kbd-backlight.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c
index 4221004..0c3eb50 100644
--- a/src/gpm-kbd-backlight.c
+++ b/src/gpm-kbd-backlight.c
@@ -22,6 +22,7 @@
#include <gio/gio.h>
#include <glib.h>
#include <libupower-glib/upower.h>
+#include <gtk/gtk.h>
#include "egg-debug.h"
#include "gpm-button.h"
@@ -31,6 +32,10 @@
#include "gpm-kbd-backlight.h"
#include "gsd-media-keys-window.h"
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
#define GPM_KBD_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_KBD_BACKLIGHT, GpmKbdBacklightPrivate))
struct GpmKbdBacklightPrivate
@@ -192,7 +197,7 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
* know its true size, yet, so we need to jump through hoops
*/
gtk_window_get_default_size (GTK_WINDOW (backlight->priv->popup), &orig_w, &orig_h);
- gtk_widget_size_request (backlight->priv->popup, &win_req);
+ gtk_widget_get_preferred_size (backlight->priv->popup, NULL, &win_req);
if (win_req.width > orig_w) {
orig_w = win_req.width;