diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpm-backlight.c | 7 | ||||
-rw-r--r-- | src/gpm-kbd-backlight.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c index 93e4567..dbb6fe8 100644 --- a/src/gpm-backlight.c +++ b/src/gpm-backlight.c @@ -38,6 +38,7 @@ #endif /* HAVE_UNISTD_H */ #include <glib/gi18n.h> +#include <gtk/gtk.h> #include <dbus/dbus-glib.h> #include <libupower-glib/upower.h> @@ -54,6 +55,10 @@ #include "gpm-stock-icons.h" #include "egg-console-kit.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_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BACKLIGHT, GpmBacklightPrivate)) struct GpmBacklightPrivate @@ -216,7 +221,7 @@ gpm_backlight_dialog_show (GpmBacklight *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; 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; |