Subject: Xinerama support for IconBox style?

From: Dominik Vogt <[email-masked]>
Date: Sun, 19 Aug 2001 16:14:59 +0200

Dan, I looked at the icon box code in style.c because I wanted to
make it work with changes of the Xinerama state, but the matter is
too complex to write a patch in short time for me.

What I want to do:

 1) Default to using the primary screen for icon box specs
    (already works for X geometry like specs and is easy to do for
    the other syntax).
 2) Recalculate all icon boxes when the Xinerama layout of the
    screen changes (switched on or off).

The difficult part is (2) because all the calculations are done
when the style is defined.  The precise spec string is thrown away
afterwards.  So doing this requires to remove the calculations
from style.c and do them somewhere is icons.c.  Can you take a
look at this, please?  I think this could wait until after 2.4.1.

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-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Sun, 19 Aug 2001 18:45:32 -0400

> look at this, please?  I think this could wait until after 2.4.1.

It doesn't look too  hard, it just needs to  save the signs separately
(for -0) and apply screen dimensions later.

Is there a way to test screen size changes without Xinerama working?

I did a CVS update, now I have this:

Undefined			first referenced
 symbol  			    in file
XineramaSupportGetNumberedScrRect   placement.o

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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]

---

From: Dan Espen <[email-masked]>
Date: Sun, 19 Aug 2001 18:49:50 -0400

Oops,  ignore that comment about 
XineramaSupportGetNumberedScrRect.

---

From: Dan Espen <[email-masked]>
Date: Sun, 19 Aug 2001 19:35:15 -0400

> look at this, please?  I think this could wait until after 2.4.1.

Done.  You may want to test this on a system that supports
Xinerama.  I tested it with:

Style "*" IconBox -80 240 -1 -1, IconGrid 80 67, \
          IconBox 1040x20+0-40,  IconGrid 80 80, IconFill r t

which tests both formats and some negative coordinates.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 20 Aug 2001 09:42:48 +0200

> Is there a way to test screen size changes without Xinerama working?

With Xinerama emulation.  Run configure with

  $ ./configure --enable-xinerama-emulation

The screen is then split into two fake Xinerama screens and a
blank area that doesn't belong to any screen.  To switch
Xinerama on and off just use

  Xinerama off

or

  Xinerama on

or

  Xinerama <primary_screen_number>

Currently this only allows to switch the emulation on and off, not
to change the Xinerama layout.  Also, it is done for fvwm and all
modules, which is inefficient and a bit confusing during startup.

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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]

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 20 Aug 2001 09:51:27 +0200

> which tests both formats and some negative coordinates.

Great!  I am still unsure about a few things that could be done:

 - Should each screen have a default icon box?
 - Should icons always be placed in an icon box that overlaps the
   window's screen first?
 - Is it worthwhile to prevent icons from being placed between
   screens if the icon box spans the whole desktop? (I guess not).

I already wrote the code to update the icon boxes when the
Xinerama layout changes, but it needs yet to be tested.

Bye

Dominik ^_^  ^_^

---

From: "Dmitry Yu. Bolkhovityanov" <[email-masked]>
Date: Mon, 20 Aug 2001 16:19:19 +0700

>  - Should each screen have a default icon box?

	Yes.  The natural way is to place icon on the same screen where
the window is.

>  - Should icons always be placed in an icon box that overlaps the

	Can you please explain what you mean by that?

>    screens if the icon box spans the whole desktop? (I guess not).

	Agreed.  If the user makes a "global" iconbox, his choice should
be obeyed.

	_________________________________________
	  Dmitry Yu. Bolkhovityanov
	  [email-masked]
	  The Budker Institute of Nuclear Physics

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 20 Aug 2001 11:12:11 +0200

> 	Can you please explain what you mean by that?

Currently, fvwm uses the icon boxes in the order of creation.  So,
if one icon box is created on screen 0 and one is created on
screen 1, all icons are placed on screen 0 until the icon box is
full, then all icons are put on screen 1.  My question was if it
is necessary to skip icon boxes that are not on the same screen as
the window.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Mon, 20 Aug 2001 09:45:11 -0400

>   Xinerama <primary_screen_number>

Hmm, none of these actually change where the icon box is.
I tried on, off, 0-3.

I'm not sure if they should.  I sort of thought if I had
"on" followed by "0", it might use the smaller box on the left
as the primary screen but it didn't seem to do that.

It must be pretty neat to watch FvwmAnimate draw lines from one
screen to another.

---

From: Dan Espen <[email-masked]>
Date: Mon, 20 Aug 2001 09:53:22 -0400

> is necessary to skip icon boxes that are not on the same screen as

I don't think we'd want to apply the same screen test unless the
user indicated that the iconbox was for a specific screen.
Right now, theres no way to do that.

I don't think that just because the iconbox lies completely within
a screen is sufficient reason to only use it for one screen.

Since I don't have a setup,  I can only guess, but my guess is
that we don't need a iconbox for each screen feature.

---

From: "Dmitry Yu. Bolkhovityanov" <[email-masked]>
Date: Mon, 20 Aug 2001 21:14:10 +0700

> Right now, theres no way to do that.

	Would it be possible to remember the screen# together with
translated geometry?

> that we don't need a iconbox for each screen feature.

	Well, maybe not "iconbox for each screen", but "iconify on the
same screen".  It seems most natural that windows iconify on the same
screen where they are.  

	A possible way to achieve this behaviour is to define a "floating"
iconbox: i.e. "IconBox -80x200-1-1" will create an iconbox which will be
treated as "@w" ("w" is "window's current screen").  Not sure about
implementation details, though -- I'm speaking of this mainly as a user of
several multiheaded machines.

	BTW, there's a little problem with specifying iconboxes separately
for each screen: this is okay for a static configuration, but what about
an XDM server which works for several different-headed machines? So
there's a need in a single command to bind iconboxes to all screens.

	I have yet to test the latest CVS, so sorry if everything is
already done.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 20 Aug 2001 18:56:50 +0200

> Hmm, none of these actually change where the icon box is.

I don't know if you did this, but I only made the X geometry like
syntax work with screens.  The other syntax still addresses the
global screen if you did not write this.  Try

  Style * IconBox 100x100@1

> as the primary screen but it didn't seem to do that.

The proper syntax is

  Xinerama 3

not

  Xinerama on 3

I guess this should be changed anyway since it interferes with the
paring of 0/1 values of the bool argument.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Mon, 20 Aug 2001 19:44:46 -0400

> > > With Xinerama emulation.  Run configure with
...
>   Style * IconBox 100x100@1

Neat.

Issuing the Style command moves the icons around.
It looks good to me.

The man page needs work.

> > as the primary screen but it didn't seem to do that.

I meant to say, I issued:

Xinerama on
Xinerama 0

> parsing of 0/1 values of the bool argument.

My biggest problem is spelling the command.

---

From: Dan Espen <[email-masked]>
Date: Mon, 20 Aug 2001 20:05:14 -0400

> 	Would it be possible to remember the screen# together with

It can be saved, but what for?

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 21 Aug 2001 14:30:24 +0200

> Hmm, none of these actually change where the icon box is.

Ah, I see.  You moved the calculations from style.c to icons.c,
but they still use the global screen dimensions.  Instead, the
specified screen has to be stored too.  Then, one of the
XineramaSupportGet...ScrRect() functions can be called in
AutoPlaceIcon() to get the actual size and offset of the screen.
Also, the call to XineramaSupportParseGeometry in style.c has to
be changed to XineramaSupportParseGeometryWithScreen() so that the
screen spec can be stored in the icon box (its a signed integer).

When this is completed, the following should work:

  Xinerama 1
  Style * iconbox 100x100-0-0
  Next iconify
  # iconifies on screen 1
  Xinerama 0
  Next iconify 
  # iconifies on screen 0
  Xinerama off
  Next iconify 
  # iconifies on global screen

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Tue, 21 Aug 2001 08:57:20 -0400

>   # iconifies on global screen

Yes, I saw how  XineramaSupportParseGeometryWithScreen
is needed to get the screen number, but I still don't see
how the screen number is going to be used.  Is it needed
by the Iconify command?

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 21 Aug 2001 16:40:07 +0200

> how the screen number is going to be used.  Is it needed

No.  Somewhere in icons.c the actual position and size of the icon
boxes is calculated.  To do this, the global screen dimensions and
position (0 0) are used.  These values have to be replaced with
the screen dimensions of the Xinerama screen that is to be used.
All this has to be done every time the Xinerama command is called.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 25 Aug 2001 15:34:50 +0200

> It can be saved, but what for?

For recalculation of the icon boxes when the "Xinerama" command is
used.  Let's assume Xinerama is enabled with two screens.

  Style * IconBox 100x100+0+0@1

puts the icon box at 0 0 of screen 1.  Now,

  Xinerama off

is issued.  The @1 must now refer to the global screen since there
are no more Xinerama screens.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Sat, 25 Aug 2001 16:28:24 -0400

> used.  Let's assume Xinerama is enabled with two screens.

Thanks, now I understand.

I added the screen spec  to the iconbox structure for  the case when a
geometry style spec is used, but the IconBox can also be defined in "l
r t b" format.  There are times when that format is required.  I don't
know what format  you'd like  to use  in  that case.  I  suppose  just
another string and pass it over to XineramaSupportParseScreenBit?

Like:

Style * Iconbox -80 240 -1 -1 g

I didn't do anything but put the value in the structure.