Subject: FVWM2 Xinerama patch 3

From: Sidik Isani <[email-masked]>
Date: Sun, 23 Sep 2001 15:40:22 -1000 (HST)

diff -ru fvwm-snap-20010916/fvwm/placement.c fvwm-2.5.0-cfht/fvwm/placement.c
--- fvwm-snap-20010916/fvwm/placement.c	Fri Sep  7 04:37:27 2001
+++ fvwm-2.5.0-cfht/fvwm/placement.c	Tue Sep 18 20:27:14 2001
@@ -922,6 +922,31 @@
     /* the USPosition was specified, or the window is a transient,
      * or it starts iconic so place it automatically */
 
+    if (SUSE_START_ON_SCREEN(sflags) && flags.do_honor_starts_on_screen)
+    {
+      int global_x = tmp_win->attr.x;
+      int global_y = tmp_win->attr.y;
+
+      /*
+       * If StartsOnScreen has been given for a window, translate its
+       * USPosition so that it is relative to that particular screen.
+       * If we don't do this, then a geometry would completely cancel
+       * the effect of the StartsOnScreen style.
+       *
+       * So there are two ways to get a window to pop up on a particular
+       * Xinerama screen.  1: The intuitive way giving a geometry hint
+       * relative to the desired screen's 0,0 along with the appropriate
+       * StartsOnScreen style (or *wmscreen resource), or 2: Do NOT
+       * specify a Xinerama screen (or specify it to be 'g') and give
+       * the geometry hint in terms of the global screen.
+       */
+      FScreenGetScreenXY(global_x, global_y,
+			 &tmp_win->attr.x, &tmp_win->attr.y);
+
+      tmp_win->attr.x += screen_g.x; /* Back to global coordinates, but */
+      tmp_win->attr.y += screen_g.y; /* forced to the right screen now. */
+    }
+
     /*
      *  If SkipMapping, and other legalities are observed, adjust for
      * StartsOnPage.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]