summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/core/constraints.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 16be521f..6ace2144 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,8 @@ m4_define([lt_version_info], [lt_current:lt_revision:lt_age])
AC_SUBST([LT_VERSION_INFO], [lt_version_info])
+AC_CHECK_LIB(m, round)
+
# Honor aclocal flags
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
diff --git a/src/core/constraints.c b/src/core/constraints.c
index ed70b40b..64ce497a 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -23,6 +23,8 @@
* 02110-1301, USA.
*/
+#define _GNU_SOURCE
+
#include <config.h>
#include "constraints.h"
#include "workspace.h"
@@ -1327,9 +1329,8 @@ constrain_aspect_ratio (MetaWindow *window,
new_width, new_height,
&best_width, &best_height);
- /* Yeah, I suck for doing implicit rounding -- sue me */
- new_width = best_width;
- new_height = best_height;
+ new_width = round (best_width);
+ new_height = round (best_height);
break;
}