Subject: FVWM: Xinerama support for FvwmButtons

From: Yves Salathe <[email-masked]>
Date: Wed, 23 Apr 2003 21:24:21 +0200

Hi

Recently I wrote this little patch for FvwmButtons so that it now 
understands the [@screen] geometry option. There may be better solutions
but it seems to work. I hope that helps.

Yves

diff -r fvwm-2.4.15/modules/FvwmButtons/FvwmButtons.c fvwm-2.4.15.orig/modules/FvwmButtons/FvwmButtons.c
1970c1970
<       mysizehints.x = x - mysizehints.width;
---
>       mysizehints.x = DisplayWidth(Dpy,screen) + x - mysizehints.width;
1977c1977
<       mysizehints.y = y - mysizehints.height;
---
>       mysizehints.y = DisplayHeight(Dpy,screen) + y - mysizehints.height;
diff -r fvwm-2.4.15/modules/FvwmButtons/parse.c fvwm-2.4.15.orig/modules/FvwmButtons/parse.c
1318d1317
<       int screen;
1321,1322d1319
<       int s_x;
<       int s_y;
1325,1326d1321
<       unsigned int s_width;
<       unsigned int s_height;
1328,1330c1323
<       flags = FScreenParseGeometryWithScreen(
< 	      geom,&g_x,&g_y,&width,&height,&screen);
<       FScreenGetScrRect(NULL, screen, &s_x, &s_y, &s_width, &s_height);
---
>       flags = XParseGeometry(geom,&g_x,&g_y,&width,&height);
1339,1340c1332,1336
<       if (flags&XValue && flags&XNegative) {
< 	UberButton->x = s_x + s_width + g_x;
---
>       if (flags&XValue)
> 	UberButton->x = g_x;
>       if (flags&YValue)
> 	UberButton->y = g_y;
>       if (flags&XNegative)
1342,1346c1338
<       } else if (flags&XValue) {
< 	UberButton->x = g_x + s_x;
<       }
<       if (flags&YValue && flags&YNegative) {
< 	UberButton->y = s_y + s_height + g_y;
---
>       if (flags&YNegative)
1348,1350d1339
<       } else if (flags&YValue) {
< 	UberButton->y = g_y + s_y;
<       }
1642d1630
<   int screen;
1645,1646d1632
<   int s_x;
<   int s_y;
1649,1650d1634
<   unsigned int s_width;
<   unsigned int s_height;
1652,1654c1636
<   flags = FScreenParseGeometryWithScreen(
< 	  geom,&g_x,&g_y,&width,&height,&screen);
<   FScreenGetScrRect(NULL, screen, &s_x, &s_y, &s_width, &s_height);
---
>   flags = FScreenParseGeometry(geom,&g_x,&g_y,&width,&height);
1661,1662c1643,1647
<   if (flags&XValue && flags&XNegative) {
<     UberButton->x = s_x + s_width + g_x;
---
>   if (flags&XValue)
>     UberButton->x = g_x;
>   if (flags&YValue)
>     UberButton->y = g_y;
>   if (flags&XNegative)
1664,1668c1649
<   } else if (flags&XValue) {
<     UberButton->x = g_x + s_x;
<   }
<   if (flags&YValue && flags&YNegative) {
<     UberButton->y = s_y + s_height + g_y;
---
>   if (flags&YNegative)
1670,1672d1650
<   } else if (flags&YValue) {
<     UberButton->y = g_y + s_y;
<   }
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked]
Date: Wed, 23 Apr 2003 22:36:30 +0200

> but it seems to work. I hope that helps.

But it already has support for '@screen' built in.  You patched
the code determining the placement of the buttons inside the
button bar.  With your patch you can now specify

  *FvwmButtons(+x+y@screen, Tile foo, ...)

?!  What would that be good for?

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Yves Salathe <[email-masked]>
Date: Thu, 24 Apr 2003 18:47:22 +0200

> ?!  What would that be good for?

I'm not sure what you mean.

I think there are two ways to specify the size and position of
FvwmButtons:

1. *FvwmButtons: Geometry 272x68-0-0@p
2. *FvwmButtons: ButtonGeometry 68x68-0-0@p

The second attempt specifies only the size of one Button while the
first attempt specifies the size of the whole window. But the position
part of the geometry works the same way in both cases.

In parse.c the two attempts both modify UberButton which doesn't seem
to be a true button but its coordinates set the position of the window
in the function CreateUberButtonWindow in FvwmButtons.c. The size of
UberButton is only 1 or 0 and it seems to indicate whether or not the
coordinates are negative. Negative coordinates mean for example
south west gravity.

FvwmButtons does not natively support '@screen' in these configuration
options.

Please correct me if I'm wrong.

Bye

Yves

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 25 Apr 2003 09:28:48 +0200

> I'm not sure what you mean.

I was confused.

> Please correct me if I'm wrong.

I have fixed it in the parse_window_geometry() function.

Bye

Dominik ^_^  ^_^