Re: [PATCH - parser] (4) updates

2021-11-21 Thread Thomas Adam
On Sun, Nov 21, 2021 at 11:41:33AM +0100, Dominik Vogt wrote:
> "git add -i" is extremely useful for not accidentally committing

It's "git add -pi" which I use all the time.

However, this is more about me hunting down which plugin is causing this and
turning it off.

Kindly,
Thomas



Re: [PATCH - parser] (4) updates

2021-11-21 Thread Dominik Vogt
On Sat, Nov 20, 2021 at 10:58:54PM +, Thomas Adam wrote:
> On Sat, Nov 20, 2021 at 03:16:02PM +0100, Dominik Vogt wrote:
> > Look at commit ba9f161998f7da942996bcf0d3f96baa8b249070.  You
> > added new-parser.md, but also committed a complete reindentation
> > of functions.c.
>
> Oh heavens.  That's not good at all.  Clearly something has run in the
> background and I had not even noticed at the point I commited that change as I
> was in no way expecting anything other than that markdown file to have
> changed.  That's why I didn't even check.
>
> Sorry about that.

No problem at all.  This has possibly happened in earlier patches
as well.  There was some one-line minor whitespace change (a line
containing a trailing space).  I removed the trailing space, but
you committed that with the whole, now empty line removed.  That
caused a conflict when rebasing.

>  I'll have to check to see how that happened.

"git add -i" is extremely useful for not accidentally committing
things.  I've never seen anybody use is except me, and it's a bit
cumbersome at first.  It shows a list of all files; then I select
option 5 to go through them chunk by chunk and apply or skip them.
It's great for finding leftovers of experiments or debug code, and
for separating topics.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH - parser] (4) updates

2021-11-20 Thread Thomas Adam
On Sat, Nov 20, 2021 at 03:16:02PM +0100, Dominik Vogt wrote:
> Look at commit ba9f161998f7da942996bcf0d3f96baa8b249070.  You
> added new-parser.md, but also committed a complete reindentation
> of functions.c.

Oh heavens.  That's not good at all.  Clearly something has run in the
background and I had not even noticed at the point I commited that change as I
was in no way expecting anything other than that markdown file to have
changed.  That's why I didn't even check.

Sorry about that.  I'll have to check to see how that happened.  There's a
possibility some "helpful" vim plugin has done this, although it hasn't done
so in the past.

Kindly,
Thomas



Re: [PATCH - parser] (4) updates

2021-11-20 Thread Dominik Vogt
On Sat, Nov 20, 2021 at 11:17:52AM +, Thomas Adam wrote:
> On Sat, Nov 20, 2021 at 10:51:51AM +0100, Dominik Vogt wrote:
> > It works on my local branch but not the one in Git because of the
> > reindentation commit.  Can we please not reindent patches that are
> > still under development?
>
> I haven't reindented anything -- at least, not knowingly.

Look at commit ba9f161998f7da942996bcf0d3f96baa8b249070.  You
added new-parser.md, but also committed a complete reindentation
of functions.c.

> Even then, how did that cause the failure in the first place?

The patch also re-ordered the includes in fvwm3.c to an order that
did not work.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH - parser] (4) updates

2021-11-20 Thread Thomas Adam
On Sat, Nov 20, 2021 at 10:51:51AM +0100, Dominik Vogt wrote:
> It works on my local branch but not the one in Git because of the
> reindentation commit.  Can we please not reindent patches that are
> still under development?

I haven't reindented anything -- at least, not knowingly.  Even then, how did
that cause the failure in the first place?

> I'll ditch the upstream branch for now and start a new one.

Well, new-parser builds fine now, thanks.

Kindly,
Thomas



Re: [PATCH - parser] (4) updates

2021-11-20 Thread Dominik Vogt
On Sat, Nov 20, 2021 at 08:51:46AM +, Thomas Adam wrote:
> This works,

Please revert this and apply the revert patch in my other message.

> but I am confused as to why it compiles fine for you:

It works on my local branch but not the one in Git because of the
reindentation commit.  Can we please not reindent patches that are
still under development?

I'll ditch the upstream branch for now and start a new one.

> diff --git a/fvwm/cmdparser_hooks.h b/fvwm/cmdparser_hooks.h
> index 42330246b..d8ebde017 100644
> --- a/fvwm/cmdparser_hooks.h
> +++ b/fvwm/cmdparser_hooks.h
> @@ -3,6 +3,9 @@
>  #ifndef FVWM_CMDPARSER_HOOKS_H
>  #define FVWM_CMDPARSER_HOOKS_H
>
> +#include "cmdparser.h"
> +#include "functions.h"

1) Please no includes in header files.  It gets really messy and
   unmaintainable over time.

2) Including headers from headers potentiall _breaks_ the code.
   Several header files work differently if some macro is defined
   when they are included, for example libs/FEvents.h evaluates
   FEVENT_PRIVILEGED_ACCESS, but since it's included by many other
   headers, it's more or less random whether execcontext.c
   includes it before defining that or after.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH - parser] (4) updates

2021-11-20 Thread Dominik Vogt
On Fri, Nov 19, 2021 at 11:35:09PM +, Thomas Adam wrote:
> > Can you give me the error messages that cause it?
>
> See fvwm.log attached.  It's possible I've missed a patch, but the code
> corresponding to this build is on the new-parser branch in git, FYI.

With the doc patch you also committed changes to functions.c that
cause this problem.

  * Reindented whole file.
  * Reordered include files, which causes the error.

Patch attached to back out the functions.c changes.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt
From e599b80d529bd75892e04d47f32558ac17018ec1 Mon Sep 17 00:00:00 2001
From: Dominik Vogt 
Date: Sat, 20 Nov 2021 03:18:31 +0100
Subject: [PATCH] Revert bad functions.c reformatting.

---
 fvwm/functions.c | 1170 ++
 1 file changed, 667 insertions(+), 503 deletions(-)

diff --git a/fvwm/functions.c b/fvwm/functions.c
index 0754b91c..31fafa2a 100644
--- a/fvwm/functions.c
+++ b/fvwm/functions.c
@@ -26,34 +26,34 @@
 #include 
 #endif

-#include "cmdparser.h"
-#include "cmdparser_hooks.h"
-#include "cmdparser_old.h"
-#include "commands.h"
+#include "libs/fvwm_x11.h"
+#include "libs/fvwmlib.h"
+#include "libs/charmap.h"
+#include "libs/wcontext.h"
+#include "libs/Grab.h"
+#include "libs/Parse.h"
+#include "libs/Strings.h"
+#include "libs/FEvent.h"
+#include "libs/Event.h"
+#include "fvwm.h"
+#include "externs.h"
 #include "cursor.h"
-#include "events.h"
 #include "execcontext.h"
-#include "expand.h"
-#include "externs.h"
 #include "functable.h"
 #include "functable_complex.h"
+#include "cmdparser.h"
+#include "cmdparser_hooks.h"
+#include "cmdparser_old.h"
 #include "functions.h"
-#include "fvwm.h"
-#include "libs/Event.h"
-#include "libs/FEvent.h"
-#include "libs/Grab.h"
-#include "libs/Parse.h"
-#include "libs/Strings.h"
-#include "libs/charmap.h"
-#include "libs/fvwm_x11.h"
-#include "libs/fvwmlib.h"
-#include "libs/wcontext.h"
-#include "menus.h"
-#include "misc.h"
+#include "commands.h"
+#include "events.h"
 #include "modconf.h"
 #include "module_list.h"
-#include "repeat.h"
+#include "misc.h"
 #include "screen.h"
+#include "repeat.h"
+#include "expand.h"
+#include "menus.h"

 /*  local definitions -- */

@@ -67,11 +67,11 @@

 /*  forward declarations --- */

-static void
-execute_complex_function(cond_rc_t *cond_rc, const exec_context_t *exc,
-cmdparser_context_t *pc, FvwmFunction *func, Bool has_ref_window_moved);
+static void execute_complex_function(
+	cond_rc_t *cond_rc, const exec_context_t *exc, cmdparser_context_t *pc,
+	FvwmFunction *func, Bool has_ref_window_moved);

-/*  local variables  */
+ /*  local variables  */

 /* Temporary instance of the hooks functions used in this file.  The goal is
  * to remove all parsing and expansion from functions.c and move it into a
@@ -83,12 +83,15 @@ static const cmdparser_hooks_t *cmdparser_hooks = NULL;

 /*  local functions  */

-static int
-__context_has_window(const exec_context_t *exc, execute_flags_t flags)
+static int __context_has_window(
+	const exec_context_t *exc, execute_flags_t flags)
 {
-	if (exc->w.fw != NULL) {
+	if (exc->w.fw != NULL)
+	{
 		return 1;
-	} else if ((flags & FUNC_ALLOW_UNMANAGED) && exc->w.w != None) {
+	}
+	else if ((flags & FUNC_ALLOW_UNMANAGED) && exc->w.w != None)
+	{
 		return 1;
 	}

@@ -102,93 +105,101 @@ __context_has_window(const exec_context_t *exc, execute_flags_t flags)
  *  Inputs:
  *  cursor  - the cursor to display while waiting
  */
-static Bool
-DeferExecution(exec_context_changes_t *ret_ecc,
-exec_context_change_mask_t *ret_mask, cursor_t cursor, int trigger_evtype,
-int do_allow_unmanaged)
+static Bool DeferExecution(
+	exec_context_changes_t *ret_ecc, exec_context_change_mask_t *ret_mask,
+	cursor_t cursor, int trigger_evtype, int do_allow_unmanaged)
 {
-	int	  done;
-	int	  finished		  = 0;
-	int	  just_waiting_for_finish = 0;
-	Window	  dummy;
-	Window	  original_w;
+	int done;
+	int finished = 0;
+	int just_waiting_for_finish = 0;
+	Window dummy;
+	Window original_w;
 	static XEvent e;
-	Window	  w;
-	int	  wcontext;
-	FvwmWindow   *fw;
-	int	  FinishEvent;
-
-	fw	= ret_ecc->w.fw;
-	w	= ret_ecc->w.w;
-	original_w  = w;
-	wcontext= ret_ecc->w.wcontext;
+	Window w;
+	int wcontext;
+	FvwmWindow *fw;
+	int FinishEvent;
+
+	fw = ret_ecc->w.fw;
+	w = ret_ecc->w.w;
+	original_w = w;
+	wcontext = ret_ecc->w.wcontext;
 	FinishEvent = ((fw != NULL) ? ButtonRelease : ButtonPress);
 #if 1 /*!!!*/
 	fprintf(stderr, "!!!%s: A wc 0x%x\n", __func__, wcontext);
 #endif
-	if (wcontext == C_UNMANAGED && do_allow_unmanaged) {
+	if (wcontext == C_UNMANAGED && do_allow_unmanaged)
+	{
 #if 1 /*!!!*/
-		fprintf(stderr, "!!!%s: Bf\n", 

Re: [PATCH - parser] (4) updates

2021-11-20 Thread Thomas Adam
On Fri, Nov 19, 2021 at 11:35:09PM +, Thomas Adam wrote:
> On Sat, Nov 20, 2021 at 12:23:26AM +0100, Dominik Vogt wrote:
> > On Fri, Nov 19, 2021 at 03:15:43PM +, Thomas Adam wrote:
> > > On Fri, Nov 19, 2021 at 03:09:35PM +, Thomas Adam wrote:
> > > > On Fri, Nov 19, 2021 at 02:54:53AM +0100, Dominik Vogt wrote:
> > > > > A couple of patches for the parser branch:
> > > > >
> > > > > 0001: Some cleanup.
> > > > > 0003: Fix function depth handling and an uninitialised function 
> > > > > argument.
> > > > >   (I.e. a crash)
> > > >
> > > > Thanks; applied these two.
> > >
> > > You'll need to fix some missing #includes though, as the build's failing, 
> > > but
> > 
> > Builds fine with gcc-10.2.1 in a clean source tree with
> > 
> >   $ make CFLAGS="-g3 -O3 -Wall -Werror" -j 4
> > 
> > Can you give me the error messages that cause it?
> 
> See fvwm.log attached.  It's possible I've missed a patch, but the code
> corresponding to this build is on the new-parser branch in git, FYI.
> 
> I know I'm being lazy, I could fix this myself, but I'd like you to check,
> just in case there's something else missing which you're working on at the
> same time...

This works, but I am confused as to why it compiles fine for you:

diff --git a/fvwm/cmdparser_hooks.h b/fvwm/cmdparser_hooks.h
index 42330246b..d8ebde017 100644
--- a/fvwm/cmdparser_hooks.h
+++ b/fvwm/cmdparser_hooks.h
@@ -3,6 +3,9 @@
 #ifndef FVWM_CMDPARSER_HOOKS_H
 #define FVWM_CMDPARSER_HOOKS_H
 
+#include "cmdparser.h"
+#include "functions.h"
+
 /*  included header files -- */
 
 /*  global definitions - */

Kindly,
Thomas



Re: [PATCH - parser] (4) updates

2021-11-19 Thread Thomas Adam
On Sat, Nov 20, 2021 at 12:23:26AM +0100, Dominik Vogt wrote:
> On Fri, Nov 19, 2021 at 03:15:43PM +, Thomas Adam wrote:
> > On Fri, Nov 19, 2021 at 03:09:35PM +, Thomas Adam wrote:
> > > On Fri, Nov 19, 2021 at 02:54:53AM +0100, Dominik Vogt wrote:
> > > > A couple of patches for the parser branch:
> > > >
> > > > 0001: Some cleanup.
> > > > 0003: Fix function depth handling and an uninitialised function 
> > > > argument.
> > > >   (I.e. a crash)
> > >
> > > Thanks; applied these two.
> >
> > You'll need to fix some missing #includes though, as the build's failing, 
> > but
> 
> Builds fine with gcc-10.2.1 in a clean source tree with
> 
>   $ make CFLAGS="-g3 -O3 -Wall -Werror" -j 4
> 
> Can you give me the error messages that cause it?

See fvwm.log attached.  It's possible I've missed a patch, but the code
corresponding to this build is on the new-parser branch in git, FYI.

I know I'm being lazy, I could fix this myself, but I'd like you to check,
just in case there's something else missing which you're working on at the
same time...

Kindly,
Thomas
 /bin/sh ./config.status
config.status: creating Makefile
config.status: creating libs/Makefile
config.status: creating fvwm/Makefile
config.status: creating modules/Makefile
config.status: creating bin/Makefile
config.status: creating bin/FvwmCommand
config.status: creating bin/FvwmPrompt/Makefile
config.status: creating bin/fvwm-config
config.status: creating bin/fvwm-perllib
config.status: creating bin/fvwm-menu-xlock
config.status: creating bin/fvwm-menu-directory
config.status: creating bin/fvwm-menu-desktop
config.status: creating bin/fvwm-convert-2.6
config.status: creating utils/Makefile
config.status: creating perllib/Makefile
config.status: creating perllib/General/Makefile
config.status: creating perllib/FVWM/Makefile
config.status: creating perllib/FVWM/Module/Makefile
config.status: creating perllib/FVWM/Tracker/Makefile
config.status: creating perllib/FVWM/Module.pm
config.status: creating default-config/Makefile
config.status: creating doc/Makefile
config.status: creating po/Makefile
config.status: creating modules/FvwmAnimate/Makefile
config.status: creating modules/FvwmAuto/Makefile
config.status: creating modules/FvwmBacker/Makefile
config.status: creating modules/FvwmButtons/Makefile
config.status: creating modules/FvwmConsole/Makefile
config.status: creating modules/FvwmEvent/Makefile
config.status: creating modules/FvwmForm/Makefile
config.status: creating modules/FvwmIconMan/Makefile
config.status: creating modules/FvwmIdent/Makefile
config.status: creating modules/FvwmMFL/Makefile
config.status: creating modules/FvwmPager/Makefile
config.status: creating modules/FvwmPerl/Makefile
config.status: creating modules/FvwmPerl/FvwmPerl
config.status: creating modules/FvwmRearrange/Makefile
config.status: creating modules/FvwmScript/Makefile
config.status: creating modules/FvwmScript/Scripts/Makefile
config.status: creating modules/FvwmScript/Widgets/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory '/home/n6tadam/projects/fvwm/fvwm3'
Making all in default-config
make[2]: Entering directory '/home/n6tadam/projects/fvwm/fvwm3/default-config'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/n6tadam/projects/fvwm/fvwm3/default-config'
Making all in libs
make[2]: Entering directory '/home/n6tadam/projects/fvwm/fvwm3/libs'
  CC   gravity.o
  CC   BidiJoin.o
  CC   Flocale.o
  CC   PictureUtils.o
  CC   FScreen.o
  CC   Bindings.o
  CC   PictureGraphics.o
  CC   Graphics.o
  CC   FlocaleCharset.o
  CC   Parse.o
  CC   PictureImageLoader.o
  CC   Colorset.o
  CC   ColorUtils.o
PictureImageLoader.c: In function ‘PImageLoadSvg’:
PictureImageLoader.c:287:9: warning: ‘rsvg_handle_get_dimensions’ is 
deprecated: Use 'rsvg_handle_get_intrinsic_size_in_pixels' instead 
[-Wdeprecated-declarations]
  287 | Frsvg_handle_get_dimensions(rsvg, );
  | ^~~
In file included from Fsvg.h:9,
 from PictureImageLoader.c:46:
/usr/include/librsvg-2.0/librsvg/rsvg.h:727:6: note: declared here
  727 | void rsvg_handle_get_dimensions (RsvgHandle *handle, RsvgDimensionData 
*dimension_data);
  |  ^~
PictureImageLoader.c:360:9: warning: ‘rsvg_handle_render_cairo’ is deprecated: 
Use 'rsvg_handle_render_document' instead [-Wdeprecated-declarations]
  360 | Frsvg_handle_render_cairo(rsvg, cr);
  | ^
In file included from /usr/include/librsvg-2.0/librsvg/rsvg.h:1460,
 from Fsvg.h:9,
 from PictureImageLoader.c:46:
/usr/include/librsvg-2.0/librsvg/rsvg-cairo.h:95:10: note: declared here
   95 | gboolean rsvg_handle_render_cairo (RsvgHandle *handle, cairo_t *cr);
  |  ^~~~
  CC

Re: [PATCH - parser] (4) updates

2021-11-19 Thread Dominik Vogt
On Fri, Nov 19, 2021 at 03:15:43PM +, Thomas Adam wrote:
> On Fri, Nov 19, 2021 at 03:09:35PM +, Thomas Adam wrote:
> > On Fri, Nov 19, 2021 at 02:54:53AM +0100, Dominik Vogt wrote:
> > > A couple of patches for the parser branch:
> > >
> > > 0001: Some cleanup.
> > > 0003: Fix function depth handling and an uninitialised function argument.
> > >   (I.e. a crash)
> >
> > Thanks; applied these two.
>
> You'll need to fix some missing #includes though, as the build's failing, but

Builds fine with gcc-10.2.1 in a clean source tree with

  $ make CFLAGS="-g3 -O3 -Wall -Werror" -j 4

Can you give me the error messages that cause it?

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Re: [PATCH - parser] (4) updates

2021-11-19 Thread Thomas Adam
On Fri, Nov 19, 2021 at 03:09:35PM +, Thomas Adam wrote:
> On Fri, Nov 19, 2021 at 02:54:53AM +0100, Dominik Vogt wrote:
> > A couple of patches for the parser branch:
> > 
> > 0001: Some cleanup.
> > 0003: Fix function depth handling and an uninitialised function argument.
> >   (I.e. a crash)
> 
> Thanks; applied these two.

You'll need to fix some missing #includes though, as the build's failing, but
I don't have the time to do so right now.

Kindly,
Thomas



Re: [PATCH - parser] (4) updates

2021-11-19 Thread Thomas Adam
On Fri, Nov 19, 2021 at 02:54:53AM +0100, Dominik Vogt wrote:
> A couple of patches for the parser branch:
> 
> 0001: Some cleanup.
> 0003: Fix function depth handling and an uninitialised function argument.
>   (I.e. a crash)

Thanks; applied these two.

Kindly,
Thomas




[PATCH - parser] (4) updates

2021-11-18 Thread Dominik Vogt
A couple of patches for the parser branch:

0001: Some cleanup.
0002: The randr simulation patch from the other message.
0003: Fix function depth handling and an uninitialised function argument.
  (I.e. a crash)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt
From 431a0709d2cbb82c18040957de33787572599702 Mon Sep 17 00:00:00 2001
From: Dominik Vogt 
Date: Wed, 17 Nov 2021 21:15:40 +0100
Subject: [PATCH 1/3] Cleanup.

---
 fvwm/cmdparser.h   |  6 +++---
 fvwm/cmdparser_hooks.h | 14 +++---
 fvwm/cmdparser_old.h   |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fvwm/cmdparser.h b/fvwm/cmdparser.h
index 67e6ae36..53e1d2e6 100644
--- a/fvwm/cmdparser.h
+++ b/fvwm/cmdparser.h
@@ -1,7 +1,7 @@
 /* -*-c-*- */

-#ifndef CMDPARSER_H
-#define CMDPARSER_H
+#ifndef FVWM_CMDPARSER_H
+#define FVWM_CMDPARSER_H

 /*  included header files -- */

@@ -62,4 +62,4 @@ typedef struct
 	char *pos_arg_tokens[CMDPARSER_NUM_POS_ARGS];
 } cmdparser_context_t;

-#endif /* CMDPARSER_H */
+#endif /* FVWM_CMDPARSER_H */
diff --git a/fvwm/cmdparser_hooks.h b/fvwm/cmdparser_hooks.h
index f05c98d3..42330246 100644
--- a/fvwm/cmdparser_hooks.h
+++ b/fvwm/cmdparser_hooks.h
@@ -1,7 +1,7 @@
 /* -*-c-*- */

-#ifndef CMDPARSER_HOOKS_H
-#define CMDPARSER_HOOKS_H
+#ifndef FVWM_CMDPARSER_HOOKS_H
+#define FVWM_CMDPARSER_HOOKS_H

 /*  included header files -- */

@@ -46,7 +46,7 @@ typedef struct
 	/* returns 1 if the stored command is a module configuration command
 	 * and 0 otherwise */
 	int (*is_module_config)(cmdparser_context_t *context);
-	/* expandeds the command line */
+	/* expands the command line */
 	void (*expand_command_line)(
 		cmdparser_context_t *context, int is_addto, void *func_rc,
 		const void *exc);
@@ -55,10 +55,10 @@ typedef struct
 	void (*release_expanded_line)(cmdparser_context_t *context);
 	/* Tries to find a builtin function, a complex function or a module
 	 * config line to execute and returns the type found or
-	 * CP_EXECTYPE_UNKNOWN if none of the above was identified.  For a
-	 * builtin or a complex funtion the pointer to the description is
+	 * CP_EXECTYPE_UNKNOWN if none of the above were identified.  For a
+	 * builtin or a complex function, the pointer to the description is
 	 * returned in *ret_builtin or *ret_complex_function.  Consumes the
-	 * the "Module" or the "Function" command form the input.  Dos not
+	 * the "Module" or the "Function" command from the input.  Does not
 	 * consider builtin functions if *ret_builtin is != NULL when the
 	 * function is called.  */
 	cmdparser_execute_type_t (*find_something_to_execute)(
@@ -71,4 +71,4 @@ typedef struct
 	void (*debug)(cmdparser_context_t *context, const char *msg);
 } cmdparser_hooks_t;

-#endif /* CMDPARSER_HOOKS_H */
+#endif /* FVWM_CMDPARSER_HOOKS_H */
diff --git a/fvwm/cmdparser_old.h b/fvwm/cmdparser_old.h
index 4ce61670..d2b11b47 100644
--- a/fvwm/cmdparser_old.h
+++ b/fvwm/cmdparser_old.h
@@ -1,11 +1,11 @@
 /* -*-c-*- */

-#ifndef CMDPARSER_OLD_H
-#define CMDPARSER_OLD_H
+#ifndef FVWM_CMDPARSER_OLD_H
+#define FVWM_CMDPARSER_OLD_H

 /*  interface functions  */

 /* return the hooks structure of the old parser */
 const cmdparser_hooks_t *cmdparser_old_get_hooks(void);

-#endif /* CMDPARSER_OLD_H */
+#endif /* FVWM_CMDPARSER_OLD_H */
--
2.30.2

From c821293866fb8c56f00d8cee52b687097e5045a3 Mon Sep 17 00:00:00 2001
From: Dominik Vogt 
Date: Fri, 19 Nov 2021 02:09:28 +0100
Subject: [PATCH 2/3] Fake a global monitor when RandR is not available.

---
 libs/FScreen.c | 69 +-
 1 file changed, 52 insertions(+), 17 deletions(-)

diff --git a/libs/FScreen.c b/libs/FScreen.c
index 32ee78a7..e00af438 100644
--- a/libs/FScreen.c
+++ b/libs/FScreen.c
@@ -125,6 +125,13 @@ monitor_refresh_global(void)
 		monitor_global = monitor_new();
 		monitor_global->si = screen_info_new();
 		monitor_global->si->name = fxstrdup(GLOBAL_SCREEN_NAME);
+		if (!is_randr_present)
+		{
+			TAILQ_INSERT_TAIL(
+_info_q, monitor_global->si, entry);
+			TAILQ_INSERT_TAIL(
+_q, monitor_global, entry);
+		}
 	}

 	/* At this point, the global screen has been initialised.  Refresh the
@@ -342,8 +349,12 @@ monitor_assign_virtual(struct monitor *ref)
 void
 FScreenSelect(Display *dpy)
 {
-	XRRSelectInput(disp, DefaultRootWindow(disp),
-		RRScreenChangeNotifyMask | RROutputChangeNotifyMask);
+	if (is_randr_present)
+	{
+		XRRSelectInput(
+			disp, DefaultRootWindow(disp),
+			RRScreenChangeNotifyMask | RROutputChangeNotifyMask);
+	}
 }

 void
@@ -352,6 +363,10 @@ monitor_output_change(Display *dpy, XRRScreenChangeNotifyEvent *e)
 	XRRScreenResources	*res;
 	struct monitor		*m = NULL;

+	if (!is_randr_present)
+	{
+		return;
+	}
 	fvwm_debug(__func__, "%s: outputs have changed\n", __func__);

 	if ((res = XRRGetScreenResources(dpy, e->root)) == NULL)