This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[patch] commited GtkMainThread.c
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: Java Patches <java-patches at gcc dot gnu dot org>
- Date: Thu, 23 Sep 2004 19:33:03 +0200
- Subject: [patch] commited GtkMainThread.c
Hi all,
I commited the following merge to the gui branch since it wasn't
correctly applied there.
Andreas
2004-09-23 Andreas Tobler <a.tobler@schweiz.ch>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(init_dpi_conversion_factor): Apply the patch from main correctly.
2004-06-26 Andreas Tobler <a.tobler@schweiz.ch>
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,v
retrieving revision 1.12.8.3
diff -u -r1.12.8.3 gnu_java_awt_peer_gtk_GtkMainThread.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c 31 Jul 2004 13:28:11 -0000 1.12.8.3
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c 23 Sep 2004 17:31:12 -0000
@@ -265,12 +265,14 @@
int int_dpi;
g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
/* If int_dpi == -1 gtk-xft-dpi returns the default value. So we
- have to do approximate calculation here. The value is 1024 *
- dots. We take 96 for dots. */
- if (int_dpi < 0) int_dpi = 98304;
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+ have to do approximate calculation here. */
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+
g_signal_connect (settings, "notify::gtk-xft-dpi",
- G_CALLBACK (dpi_changed_cb), NULL);
+ G_CALLBACK (dpi_changed_cb), NULL);
}
else
/* Approximate. */
@@ -279,9 +281,12 @@
static void
dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec __attribute__((unused)))
+ GParamSpec *pspec __attribute__((unused)))
{
int int_dpi;
g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
}