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

gEDA-dev: Patch for gerbv and xinerama



When I try to use gerbv 1.0.2 on my machine, it opens a window that is 
way bigger than my display.  The problem stems from the fact that I have 
an xinerama setup with a "screen size" of 2560x1280.

I've attached an old patch that I tweaked very slightly.  The original 
reference can be found here:
http://archives.seul.org/geda/dev/Mar-2003/msg00015.html

-David Carr
diff -ru gerbv-1.0.2/src/gerbv.c gerbv-1.0.2-david/src/gerbv.c
--- gerbv-1.0.2/src/gerbv.c	2006-07-28 05:33:13.000000000 -0500
+++ gerbv-1.0.2-david/src/gerbv.c	2006-10-17 23:22:05.000000000 -0500
@@ -2503,7 +2503,7 @@
     GtkWidget *hbox;
     GtkWidget *menubar;
     GtkStyle  *textStyle;
-    gint      screen_width, width, height;
+    gint      width, height;
     int       read_opt;
     int       i;
     int       req_width = -1, req_height = -1, req_x = 0, req_y = 0;
@@ -2628,9 +2628,14 @@
 	width = req_width;
 	height = req_height;
     } else {
-	screen_width = gdk_screen_width();
-	width = screen_width * 3/4;
-	height = width * 3/4;
+	GdkScreen *screen;
+	int nmonitors;
+
+	screen = gdk_screen_get_default();
+	nmonitors = gdk_screen_get_n_monitors(screen);
+
+	width = gdk_screen_get_width(screen) * 3/4 / nmonitors;
+	height = gdk_screen_get_height(screen) * 3/4 / nmonitors;
     }
 
     /*


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev