[gnome-packagekit] Add a --enable-small-form-factor which disables the auto-maximise code by default. Fixes #23888



commit c2f94381b45f7a7e4752b3e81a785b517e505506
Author: Richard Hughes <richard hughsie com>
Date:   Sat Sep 12 23:45:12 2009 +0100

    Add a --enable-small-form-factor which disables the auto-maximise code by default. Fixes #23888

 configure.ac     |   10 ++++++++++
 src/gpk-common.c |    7 ++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 827a3b1..49542ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,6 +207,16 @@ AM_CONDITIONAL(GPK_BUILD_GUDEV, test x$GPK_BUILD_GUDEV = xyes)
 AC_SUBST(GUDEV_CFLAGS)
 AC_SUBST(GUDEV_LIBS)
 
+dnl ---------------------------------------------------------------------------
+dnl - Enable small form factor code
+dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(small_form_factor, AS_HELP_STRING([--enable-small-form-factor],[enable small form factor code]),
+	      enable_small_form_factor=$enableval,enable_small_form_factor=no)
+AM_CONDITIONAL(PK_BUILD_SMALL_FORM_FACTOR, test x$enable_small_form_factor = xyes)
+if test x$enable_small_form_factor = xyes; then
+	AC_DEFINE(PK_BUILD_SMALL_FORM_FACTOR,1,[Build small form factor code])
+fi
+
 AC_PATH_PROG(GCONFTOOL, gconftool-2)
 AM_GCONF_SOURCE_2
 
diff --git a/src/gpk-common.c b/src/gpk-common.c
index 3a331d3..2b88a8a 100644
--- a/src/gpk-common.c
+++ b/src/gpk-common.c
@@ -214,6 +214,7 @@ gpk_window_get_small_form_factor_mode (void)
 gboolean
 gpk_window_set_size_request (GtkWindow *window, guint width, guint height)
 {
+#ifdef PK_BUILD_SMALL_FORM_FACTOR
 	GdkScreen *screen;
 	guint screen_w;
 	guint screen_h;
@@ -238,7 +239,11 @@ gpk_window_set_size_request (GtkWindow *window, guint width, guint height)
 		small_form_factor_mode = TRUE;
 		goto out;
 	}
-
+#else
+	/* skip invalid values */
+	if (width == 0 || height == 0)
+		goto out;
+#endif
 	/* normal size laptop panel */
 	egg_debug ("using native mode: %ix%i", width, height);
 	gtk_window_set_default_size (window, width, height);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]