Subject: FVWM2 Xinerama patch 1

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

diff -ru fvwm-snap-20010916/libs/FScreen.c fvwm-2.5.0-cfht/libs/FScreen.c
--- fvwm-snap-20010916/libs/FScreen.c	Sat Sep 15 01:00:05 2001
+++ fvwm-2.5.0-cfht/libs/FScreen.c	Tue Sep 18 20:41:10 2001
@@ -528,6 +528,27 @@
   return 0;
 }
 
+/* Returns the screen of which (global_x, global_y) is a pixel, and
+ * returns the screen-relative (x,y) if x and y are not NULL.
+ */
+int FScreenGetScreenXY(
+  int global_x, int global_y, int *x, int *y)
+{
+  int screen = FindScreenOfXY(global_x, global_y);
+
+  if (screen == 0)
+  {
+    if (x) *x = global_x;
+    if (y) *y = global_y;
+  }
+  else if (screen > 0)
+  {
+    if (x) *x = global_x - screens[screen].x_org;
+    if (y) *y = global_y - screens[screen].y_org;
+  }
+  return screen;
+}
+
 /* Returns the specified screens geometry rectangle.  screen can be a screen
  * number or any of the values FSCREEN_GLOBAL, FSCREEN_CURRENT,
  * FSCREEN_PRIMARY or FSCREEN_XYPOS.  The arg union only has a meaning for
diff -ru fvwm-snap-20010916/libs/FScreen.h fvwm-2.5.0-cfht/libs/FScreen.h
--- fvwm-snap-20010916/libs/FScreen.h	Fri Sep 14 01:00:08 2001
+++ fvwm-2.5.0-cfht/libs/FScreen.h	Tue Sep 18 20:20:24 2001
@@ -44,6 +44,8 @@
 void FScreenSetPrimaryScreen(int scr);
 
 /* Screen info */
+int FScreenGetScreenXY(
+  int global_x, int global_y, int *x, int *y);
 Bool FScreenGetScrRect(
   fscreen_scr_arg *arg, int screen, int *x, int *y, int *w, int *h);
 void FScreenGetResistanceRect(
--
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]