On Sat, 14 Dec 2002, Dan Espen wrote:

> Marcus Lundblad <[EMAIL PROTECTED]> writes:
> > I'm implementing new styles to control allowed operations on windows.
> > Looked at the code in decorations.c (is_function_allowed) I see that the
> > MWM hint Close disables both Close and Destroy.
> > So I'm not quite sure what is the best thing to do: Follow this behavoiur
> > with the new style, implement an additional style or always permit
> > Destroy,
> > There is also a comment in the code: 
> > /* shouldn't destroy always be allowed?? */
> > 
> > Maybe that should be so, Destroy should always be possible.
> > Thought I would want to hear som opinions.
> 
> Destroy is still possible, thru keybindings, mousebindings,
> and root context menus.

Is Destroy handled specifically when it's used?
As far as I can see the code in is_function_allowed is the same for
Close and Destroy:

case F_CLOSE:
        if (IS_TEAR_OFF_MENU(t))
        {
                /* always allow this on tear off menus */
                break;
        }
        if (!(functions & MWM_FUNC_CLOSE))
        {
                return False;
        }
        break;
case F_DESTROY: /* shouldn't destroy always be allowed??? */
        if (IS_TEAR_OFF_MENU(t))
        {
                /* always allow this on tear off menus */
                break;
        }
        if (!(functions & MWM_FUNC_CLOSE))
        {
                return False;
        }
        break;

If I've not missed anything (have got an hangover today... ^^ ), this
could be written as:

case F_CLOSE:
case F_DESTROY:
if (IS_TEAR_OFF_MENU(t))
        {
                /* always allow this on tear off menus */
                break;
        }
        if (!(functions & MWM_FUNC_CLOSE))
        {
                return False;
        }
        break;


Also I'm thinking about wether Style Unclosable should apply also for
tear-off menus. 
The argument in favour: The user has requested this
expliciltly through a style
The arguments against: It is incosistent with how hints are handled and
there is no other way to close it (what does destroy do on a tear-off,
kill fvwm?). 

> 
> The source code for mwm is now downloadable.
> I'd say whatever mwm does is the right thing to do.

Yes, I guess this would be a good idea.

I will look at this when I get time. During the holidays I will visit my
parents, unfortunatly they only have Win2000....

//Marcus

> 
> -- 
> Dan Espen                           E-mail: [EMAIL PROTECTED]
> --
> Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
> To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
> body of a message to [EMAIL PROTECTED]
> To report problems, send mail to [EMAIL PROTECTED]
> 

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to