Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Dominik Vogt
On Tue, Nov 23, 2021 at 01:44:52AM +0100, Dominik Vogt wrote:
>   Menu foomenu monitor c c
>
> Should place the menu in the middle of the current monitor.

Or

   Menu foomenu c-20 c+30

should place it 20% of the monitor size left from the center and
30% below the center.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Dominik Vogt
On Mon, Nov 22, 2021 at 11:52:38PM +, Thomas Adam wrote:
> On Tue, Nov 23, 2021 at 12:31:15AM +0100, Dominik Vogt wrote:
> > The old manmage said:
> >
> >   XineramaRoot
> >
> >   the root window of the whole Xinerama screen.  Equivalent to
> >   "root" when Xinerama is not used.
> >
> > Can you please restate that for me?  What is "whole Xinerama
> > screen" in xrandr terms?
>
> >From a quick scan of the code in menus.c where xineramaroot is being used,
> it's not entirely clear to me,

In the past it referenced the current Xinerama screen, not the
whole root window.  When a menu is placed the code needs a
reference rectangle to calculate the menu position.  It can be
relative to the pointer, to a window, to the root window, to a
monitor etc.

> but if this option is meant to do what I think
> it is, then this would be taking the width/height of the monitor the
> pointer/window is on, rather than referencing the width/height of the entire
> root window.

That would be correct.

Renamed it to "monitor" and "fMonitorContext".  There's only one
place in the code that evaluates the flag, and that looks fishy.
Can you test it?

  Menu foomenu monitor c c

Should place the menu in the middle of the current monitor.

The code is on the dv/devel branch (you may not want the top
commit on that branch).

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Thomas Adam
On Tue, Nov 23, 2021 at 12:31:15AM +0100, Dominik Vogt wrote:
> The old manmage said:
> 
>   XineramaRoot
> 
>   the root window of the whole Xinerama screen.  Equivalent to
>   "root" when Xinerama is not used.
> 
> Can you please restate that for me?  What is "whole Xinerama
> screen" in xrandr terms?

>From a quick scan of the code in menus.c where xineramaroot is being used,
it's not entirely clear to me, but if this option is meant to do what I think
it is, then this would be taking the width/height of the monitor the
pointer/window is on, rather than referencing the width/height of the entire
root window.

Kindly,
Thomas



Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Dominik Vogt
On Mon, Nov 22, 2021 at 10:46:20PM +, Thomas Adam wrote:
> On Mon, Nov 22, 2021 at 11:26:53PM +0100, Dominik Vogt wrote:
> > On Sun, Nov 21, 2021 at 12:39:07AM +0100, Dominik Vogt wrote:
> > > Patch attached.  Can you please double check and fill in the gaps?
> > > (see comments belo).
> > >
> > > > > ./fvwm/menus.c:   fXineramaRoot = False;
> > > > > ./fvwm/menus.c:   else if (StrEquals(tok,"xineramaroot"))
> > >
> > >
> > > Not sure what the right name of the option and the flag variable
> > > should be.  There's only a placeholder in the man page either.
>
> Making that change would be syntactically breaking people's configs, but... I
> bet it's a rarely-used option that should just be "screenroot" or something.

It can have two names, a real one and still "xineramaroot" for
compatibility.  Screenroot?  Rootscreen?  Just tell me a good
name.

The old manmage said:

  XineramaRoot

  the root window of the whole Xinerama screen.  Equivalent to
  "root" when Xinerama is not used.

Can you please restate that for me?  What is "whole Xinerama
screen" in xrandr terms?

> > > > > ./perllib/FVWM/Commands.pm:   descr => q{Move a window to 
> > > > > another Xinerama screen},
> > >
> > > [MOVE_TO_SCREEN]
> > > This one should be just renamed to just "screen"?
>
> Yes please.

Good.  It's already part of the patch.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Thomas Adam
On Mon, Nov 22, 2021 at 11:26:53PM +0100, Dominik Vogt wrote:
> On Sun, Nov 21, 2021 at 12:39:07AM +0100, Dominik Vogt wrote:
> > Patch attached.  Can you please double check and fill in the gaps?
> > (see comments belo).
> >
> > > > ./fvwm/menus.c: fXineramaRoot = False;
> > > > ./fvwm/menus.c:   else if (StrEquals(tok,"xineramaroot"))
> >
> >
> > Not sure what the right name of the option and the flag variable
> > should be.  There's only a placeholder in the man page either.

Making that change would be syntactically breaking people's configs, but... I
bet it's a rarely-used option that should just be "screenroot" or something.

> > > > ./perllib/FVWM/Commands.pm: descr => q{Move a window to 
> > > > another Xinerama screen},
> >
> > [MOVE_TO_SCREEN]
> > This one should be just renamed to just "screen"?

Yes please.

> Ping.

Sorry, I didn't spot this earlier.

Kindly,
Thomas



Re: [PATCH/RFC] Xinerama

2021-11-22 Thread Dominik Vogt
On Sun, Nov 21, 2021 at 12:39:07AM +0100, Dominik Vogt wrote:
> Patch attached.  Can you please double check and fill in the gaps?
> (see comments belo).
>
> > > ./fvwm/menus.c:   fXineramaRoot = False;
> > > ./fvwm/menus.c:   else if (StrEquals(tok,"xineramaroot"))
>
>
> Not sure what the right name of the option and the flag variable
> should be.  There's only a placeholder in the man page either.
>
> > > ./perllib/FVWM/Commands.pm:   descr => q{Move a window to 
> > > another Xinerama screen},
>
> [MOVE_TO_SCREEN]
> This one should be just renamed to just "screen"?

Ping.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



[PATCH/RFC] Xinerama

2021-11-20 Thread Dominik Vogt
On Sat, Nov 20, 2021 at 10:24:46PM +, Thomas Adam wrote:
> On Sat, Nov 20, 2021 at 03:54:10PM +0100, Dominik Vogt wrote:
> > On Sat, Nov 20, 2021 at 02:15:58PM +, Thomas Adam wrote:
> > > On Sat, Nov 20, 2021, 14:13 Dominik Vogt  wrote:
> > >
> > > > Is Xinerama still useful for anything or can we remove it?
> > > >
> > > It has already been removed. Where are you seeing references to it?

Patch attached.  Can you please double check and fill in the gaps?
(see comments belo).

> > ./fvwm/menus.c: fXineramaRoot = False;
> > ./fvwm/menus.c:   else if (StrEquals(tok,"xineramaroot"))


Not sure what the right name of the option and the flag variable
should be.  There's only a placeholder in the man page either.

> > ./perllib/FVWM/Commands.pm: descr => q{Move a window to another 
> > Xinerama screen},

[MOVE_TO_SCREEN]
This one should be just renamed to just "screen"?

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt
From 03149ce8658894f22e3c5e17cc8d981bb9563ec8 Mon Sep 17 00:00:00 2001
From: Dominik Vogt 
Date: Sun, 21 Nov 2021 00:27:00 +0100
Subject: [PATCH 1/4] Remove Xinerama leftovers.

---
 bin/fvwm-config.in   |  6 +++---
 doc/fvwm3_manpage_source.adoc|  5 -
 fvwm/add_window.c|  3 +--
 fvwm/commands.h  | 10 -
 fvwm/functable.c |  2 +-
 fvwm/fvwm.h  |  8 +++
 fvwm/menuparameters.h|  6 ++
 fvwm/menus.c | 27 +++
 fvwm/module_interface.h  |  1 -
 fvwm/move_resize.c   | 15 ++---
 fvwm/placement.c |  4 ++--
 fvwm/screen.h|  1 -
 fvwm/style.c | 24 ++---
 fvwm/style.h |  8 +++
 fvwm/update.c|  6 --
 fvwm/windowlist.c|  2 +-
 libs/FTips.c |  2 +-
 libs/defaults.h  |  6 --
 modules/FvwmButtons/FvwmButtons.h|  1 -
 modules/FvwmForm/FvwmForm.c  | 17 ---
 perllib/FVWM/Commands.pm | 32 +---
 perllib/FVWM/Tracker/GlobalConfig.pm |  7 +++---
 22 files changed, 59 insertions(+), 134 deletions(-)

diff --git a/bin/fvwm-config.in b/bin/fvwm-config.in
index 77ea48a3..4ca9edce 100644
--- a/bin/fvwm-config.in
+++ b/bin/fvwm-config.in
@@ -90,9 +90,9 @@ with_shape=@with_shape@
 with_shm=@with_shm@
 with_sm=@with_sm@
 with_xcursor=@with_xcursor@
-with_xinerama=@with_xinerama@
 with_xft=@with_xft@
 with_xpm=@with_xpm@
+with_xrandr=@with_xinerama@
 with_xrender=@with_xrender@

 while test $# -gt 0; do
@@ -162,9 +162,9 @@ while test $# -gt 0; do
 			test "$with_shm"= "yes" && echo "shm"
 			test "$with_sm" = "yes" && echo "sm"
 			test "$with_xcursor"= "yes" && echo "xcursor"
-			test "$with_xinerama"   = "yes" && echo "xinerama"
 			test "$with_xft"= "yes" && echo "xft"
 			test "$with_xpm"= "yes" && echo "xpm"
+			test "$with_xrandr" = "yes" && echo "xrandr"
 			test "$with_xrender"= "yes" && echo "xrender"
 			;;

@@ -210,9 +210,9 @@ while test $# -gt 0; do
 			echo "	sm (session management): $with_sm"
 			echo "	rsvg (SVG icons and images): $with_rsvg"
 			echo "	xcursor (ARGB/animated cursors): $with_xcursor"
-			echo "	xinerama (multi-head): $with_xinerama"
 			echo "	xft (FreeType anti-alias font): $with_xft"
 			echo "	xpm: $with_xpm"
+			echo "	xrandr (multi-head): $with_xrand"
 			echo "	xrender (XFree86 Xrender extention): $with_xrender"
 			;;

diff --git a/doc/fvwm3_manpage_source.adoc b/doc/fvwm3_manpage_source.adoc
index 42187d14..dee9a0e0 100644
--- a/doc/fvwm3_manpage_source.adoc
+++ b/doc/fvwm3_manpage_source.adoc
@@ -2264,6 +2264,9 @@ The _context-rectangle_ can be one of:
 _Root_:::
 	the root window of the current screen.
 +
+_ScreenRoot_:::
+	!!!???
++
 _Mouse_:::
 	a 1x1 rectangle at the mouse position.
 +
@@ -6130,7 +6133,7 @@ it is still possible to move or resize windows across the edge of the
 current screen. See also *EdgeThickness*.

 The option _EdgeMoveResistance_ makes it easier to place a window
-directly adjacent to the screen's or xinerama screen's border. It
+directly adjacent to the screen's border. It
 takes one or two parameters. The first parameter tells how many pixels
 over the edge of the screen a window's edge must move before it
 actually moves partially off the screen. The optional second parameter
diff --git a/fvwm/add_window.c b/fvwm/add_window.c
index dbd062e2..fd32310f 100644
--- a/fvwm/add_window.c
+++ b/fvwm/add_window.c
@@ -916,8 +916,7 @@ void setup_numeric_vals(FvwmWindow *fw, window_style *pstyle)
 		fw->edge_delay_ms_resize = DEFAULT_RESIZE_DELAY;
 	}
 	fw->edge_resistance_move = pstyle->edge_resistance_move;
-	fw->edge_resistance_xinerama_move =
-		pstyle->edge_resistance_xinerama_move;
+	fw->edge_resistance_screen_move =