On Fri, Sep 02, 2011 at 09:10:34PM +0200, Christian Ehrlicher wrote:
> Am Freitag, 2. September 2011, 20:56:15 schrieb Thomas Adam:
> > I've a fix here which seems to be working and will commit to CVS over the
> > weekend sometime.
> > 
> This sounds promising - I can test it on monday and will report back then.

See patch attached.

Note that in the case where a window was previously mapped (and hence
already had a requested geometry and gravity set on that window) which had
them been reparented by another, we were always using a gravity which was
incorrect.

As for key-bindings propagating from the reparented instance (child) to the
parent, there's a discrepancy between window managers.  FVWM (and TWM
therefore) will send synthetic key events to the application when the
pointer is on its window (FW_W_FRAME(fw)).  This is good for your
application, because the XEmbed application is told to forward such requests
through, and in doing so generates a second synthetic key event, which is
why you see the same key propagated from your widget to its container [1].

In the normal case though, what's happening is that your widget window will
typically always receive real key events, and those won't get sent anywhere
else other than to the receiving window.  This is correct behaviour.

But this problem I'm describing certainly doesn't have anything to do with
focusing problems with refresh_focus() and friends.

-- Thomas Adam

[1] Using a focus policy of ClickToFocus will increase the likelihood of
sending synthetic events through to the application, because once the window
has focus it will remain that way until clicked elsewhere.

-- 
"Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
diff --git a/fvwm/frame.c b/fvwm/frame.c
index 5a434d6..55922ce 100644
--- a/fvwm/frame.c
+++ b/fvwm/frame.c
@@ -1956,7 +1956,19 @@ void frame_free_move_resize_args(
 	frame_setup_shape(fw, mra->end_g.width, mra->end_g.height, fw->wShaped);
 	if (mra->flags.do_restore_gravity)
 	{
-		mra->grav.client_grav = fw->hints.win_gravity;
+		/* TA:  2011-09-04: There might be a chance some clients with
+		 *      a gravity other than Static (such as non-NW gravity)
+		 *      might not react well -- but setting the gravity to the
+		 *      main window hint will break clients being remapped as
+		 *      subwindows, c.f. XEmbed.
+		 *
+		 *      Note that we should probably consider handling
+		 *      GravityNotify events ourselves, since we already set
+		 *      StructureNotify and SubstructureNotify events on
+		 *      FW_W_PARENT for example.
+		 *
+		 * mra->grav.client_grav = fw->hints.win_gravity;
+		 */
 		frame_set_decor_gravities(
 			fw, &mra->grav,
 			(mra->flags.do_set_bit_gravity) ? 2 : 0);

Reply via email to