gnustep-dev
[Top][All Lists]
Advanced

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

Re: Last change in NSMenuView.m


From: Christopher Armstrong
Subject: Re: Last change in NSMenuView.m
Date: Mon, 24 Jan 2011 21:28:42 +1100

Hi all

Having worked on a window manager recently, I'd thought I better comment on 
this.

On 24/01/2011, at 20:59 PM, Wolfgang Lux wrote:

> The change to open menus with their bottom at the mouse cursor looks  
> less convincing to me. The real problem with menus is that the gui  
> blindly expects the window manager to place menus at the intended  
> position and simply ignores information from the backend when the  
> window manager has decided to place the menu differently. Rather than  
> fixing the problem, your patch just alleviates it by reducing the  
> chance that the window manager interferes with the gui's placement.

If you don't want the WM to interfere *at all* with window placement, you 
should mark the window as "override-redirect", which prevents the window 
manager from reparenting the window, and prevents it from intercepting 
ConfigureNotify events and MapNotify events. Well-behaved window managers just 
ignore these windows completely. 

You should also grab the mouse when displaying drop down menus (and popup menus 
too). This will prevent clicks and mouse movements from being lost to other 
windows (and the resulting undefined behaviour).

However, you should really only use these for the Win95 and Mac style windows, 
as grabbing the mouse only makes sense with those styles, and override-redirect 
was intended for windows with a very short lifetime.

I understand these would be a pain to integrate with the backend because it 
starts to violate separation of concerns, but they would be worth it. At least, 
grabbing the mouse would enhance the user-experience on Windows platforms too. 
Its also how these things are implemented on Windows, GNOME, KDE, etc. too (but 
interestingly not MacOS X).

Cheers
Chris

--------
Christopher Armstrong
address@hidden








reply via email to

[Prev in Thread] Current Thread [Next in Thread]