This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]