summaryrefslogtreecommitdiff
path: root/src/gpm-kbd-backlight.c
diff options
context:
space:
mode:
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;