pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wm/fvwm hangs on -current (9.99.101)



On Mon, 17 Oct 2022, John D. Baker wrote:

> A private message
> directing me to a patch for fvwm3 that is claimed to also work with
> fvwm2 with a bit of fuzz:
> 
>   https://github.com/fvwmorg/fvwm3/pull/683

I couldn't figure out how to get a patch I could download, so I applied
them manually and saved them as local patches.

Rebuilt with these patches, 'fvwm' (or 'fvwm2') starts up properly.


patch-fvwm_events.c
+--- fvwm/events.c.orig	2018-05-26 06:35:26.000000000 -0500
++++ fvwm/events.c	2022-10-17 17:18:25.423223361 -0500
+@@ -258,6 +258,12 @@ static int _pred_weed_accumulate_expose(
+ 	return 1;
+ }
+ 
++static int _pred_weed_is_expose(
++	Display *display, XEvent *event, XPointer arg)
++{
++	return (event->type == Expose);
++}
++
+ static int _pred_weed_handle_expose(
+ 	Display *display, XEvent *event, XPointer arg)
+ {
+@@ -4542,7 +4548,8 @@ void handle_all_expose(void)
+ 
+ 	saved_event = fev_save_event();
+ 	FPending(dpy);
+-	FWeedIfEvents(dpy, _pred_weed_handle_expose, NULL);
++	FWeedAndHandleIfEvents(dpy, _pred_weed_is_expose,
++			       _pred_weed_handle_expose, NULL);
+ 	fev_restore_event(saved_event);
+ 
+ 	return;

patch-libs_FEvent.c
+--- libs/FEvent.c.orig	2018-05-26 06:35:26.000000000 -0500
++++ libs/FEvent.c	2022-10-17 17:23:25.077471206 -0500
+@@ -532,6 +532,28 @@ int FWeedIfEvents(
+ 	return weed_args.count;
+ }
+ 
++int FWeedAndHandleIfEvents(
++	Display *display,
++	int (*weed_predicate) (Display *display, XEvent *event, XPointer arg),
++	int (*handler) (Display *display, XEvent *event, XPointer arg),
++	XPointer arg)
++{
++	_fev_weed_args weed_args;
++	XEvent e;
++
++	assert(fev_is_invalid_event_type_set);
++	memset(&weed_args, 0, sizeof(weed_args));
++	weed_args.weed_predicate = weed_predicate;
++	weed_args.arg = arg;
++	if (FCheckPeekIfEvent(display, &e, _fev_pred_weed_if,
++			      (XPointer)&weed_args)) {
++		handler(display, &e, arg);
++	}
++	_fev_pred_weed_if_finish(&weed_args);
++
++	return weed_args.count;
++}
++
+ int FWeedIfWindowEvents(
+ 	Display *display, Window window,
+ 	int (*weed_predicate) (

patch-libs_FEvent.h
+--- libs/FEvent.h.orig	2016-10-15 09:51:45.000000000 -0500
++++ libs/FEvent.h	2022-10-17 17:21:17.906006783 -0500
+@@ -113,6 +113,14 @@ int FWeedIfEvents(
+ 		Display *display, XEvent *current_event, XPointer arg),
+ 	XPointer arg);
+ 
++/* Same as FWeedIfEvents but with a second callback out of XLockDisplay()
++ * to handle events in a lock-safe manner */
++int FWeedAndHandleIfEvents(
++	Display *display,
++	int (*weed_predicate) (Display *display, XEvent *event, XPointer arg),
++	int (*handler) (Display *display, XEvent *event, XPointer arg),
++	XPointer arg);
++
+ /* Same as FWeedIfEvents but weeds only events for the given window.  The
+  * weed_predicate is only called for events with a matching window.  */
+ int FWeedIfWindowEvents(

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]consolidated[flyspeck]net  OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645


Home | Main Index | Thread Index | Old Index