bug-gnustep
[Top][All Lists]
Advanced

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

[PATCH] Menus in lowerleft corner


From: Willem Rein Oudshoorn
Subject: [PATCH] Menus in lowerleft corner
Date: 13 Mar 2003 18:03:34 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

The story so far
----------------

* When moving the mouse over a menu sometimes the submenus
  appear in the lowerleft corner.

* Also, sometimes the submenus do not dissappear when they should.
  Resulting in submenus that never dissappear and clutter the sceen.


Reasons that this happens
-------------------------

A - Because the window manager intercept mapping calls it can happen 
    that the Map, followed by Unmap ends up in the X server as
    Unmap folled by Map.

B - Due to logic in the NSMenu code in combination with the queuing
    in X it could happen that when opening a submenu the 
    "attachedMenu" ivar of the parent menu was not set.  
  
Both reasons could lead to not dissappearing menus.


Solutions
---------

A - Use the XWithdrawWindow call instead of XUnmap.  Any 
    window manager that intercepts the mapping call should
    also listen to the event generated by XWithdrawWindow 
    and do the right thing.  

B - Do not move the menu to (0,0) after closing the menu
    and change the guarding condition for setting the 
    attachedMenu in the parent menu.


Questions and remarks
---------------------

* I am not an experienced X programmer.  The XWithdrawWindow
  call is suggested by the Xlib programming books and in the
  thread mentioned in one of the mails of Michael Hanni.
  But if anyone can give a convincing reason not to use this
  call, please let me know.

* Besides, I am not sure what the reason was for moving the 
  menu location to (0,0) after closing.  Is there is some
  subtle or not so subtle reason for it?

* I have to say that although I can not reproduce this bug
  anymore when running with 

  - WindowMaker
  - sawfish
  - fvwm

  I could, after trying very hard, still reproduce it with
  
  - sawfish run in an Xnest session.

  This could be a Xnest problem. I have quite a few other
  problems with Xnest sessions so I wouldn't be surprised.


Testing
-------

Could someone who experiences these problems test out this 
patch and let me know the result?


Wim Oudshoorn


[ChangeLog excerpt from gui]--------------------------------------------

2003-03-13  Willem Rein Oudshoorn  <woudshoo@xs4all.nl>

        * Source/NSMenu.m ([-display:]): Make sure _attachedMenu is set, 
        due to a race condition it could have happened that it was 
        not set correctly.
        ([-close]): Do not move invisible windows to (0,0).



[ChangeLog excerpt from back]-------------------------------------------

2003-03-13  Willem Rein Oudshoorn  <woudshoo@xs4all.nl>

        * Source/x11/XGServerWindow.m ([-orderwindow:::]):  
        use XWithdrawWindown instead of XUnmap. (ICCCM advices this).
        

[Patch gui]-------------------------------------------------------------

Attachment: gui-map-diff
Description: Gui NSMenu not dissappearing patch


[Patch back]------------------------------------------------------------

Attachment: back-map-diff
Description: Back NSMenu not dissappearing patch


reply via email to

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