Hello,

in the switch from revision 1.111 to 1.112

  GET_USER_STATES(t) = S_USER_STATES(SCF(*pstyle));

was added to the apply_window_updates function within fvwm/update.c to conserve 
the user states that have been set via WindowStyle. However, this current 
approach additionally
erases all previously user states associated with the window, independent of 
whether they have been (un)set or are not touched by a WindowStyle line.

Attached patch (un)sets only those user states that the WindowStyle instructs 
to.

Kind regards,
Christian

P.S.: An example illustrating the problem is the following function:

DestroyFunc ChangeDecoration
AddToFunc  ChangeDecoration
+ I Current State 1
+ I Current (!State 1) WindowStyle  Title,  Borders,  Handles
+ I Current ( State 1) WindowStyle !Title, !Borders, !Handles
+ I UpdateStyles

Before revision 1.112, binding above function to a key allowed to add or remove 
decorations of a window at the press of this key. Beginning with revision 
1.112, State
1 is no longer set after calling the function--regardless of it's prior state. 
The WindowStyle Commands unset it. After applying the supplied patch, the 
function again
works as expected.
Index: fvwm/update.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/update.c,v
retrieving revision 1.112
diff -u -a -r1.112 update.c
--- fvwm/update.c       28 Jul 2010 20:25:14 -0000      1.112
+++ fvwm/update.c       5 Apr 2011 07:13:00 -0000
@@ -101,7 +101,8 @@
        /* TA:  2010-07-28:  Conditionally update window states if they're
         * present -- i.e., we're preserving states set via Windowstyle.
         */
-       GET_USER_STATES(t) = S_USER_STATES(SCF(*pstyle));
+       CLEAR_USER_STATES(t, S_USER_STATES(SCM(*pstyle)));
+       SET_USER_STATES(  t, S_USER_STATES(SCF(*pstyle)));
 
        if (flags->do_setup_focus_policy)
        {

Reply via email to