Menu

#2329 NSFloatingWindowLevel vs NSSubmenuWindowLevel

Bug
closed-fixed
nobody
5
2022-05-22
2022-05-11
No

Please change NSFloatingWindowLevel to NSSubmenuWindowLevel in ScintillaCocoa.mm:1181 and PlatCocoa.mm:1963, so you can see the menu in front of your window, if your window is a dialog.
We had problems where auto complete would go behind the window and not be visible.

also I think submenu level is more appropriate for those overlay windows.
thanks.

Discussion

  • Christian Schmitz

    Correction: The right level is NSPopUpMenuWindowLevel, since that is above the NSModalPanelWindowLevel for the dialogs.

     
  • Christian Schmitz

    and we rebuilt Scintilla with that change and it works nice now.

     
  • Neil Hodgson

    Neil Hodgson - 2022-05-12

    It makes sense for autocompletion to be visible when invoked from a modal dialog, but this change also makes it appear above a modal dialog that is invoked after the autocompletion/calltip is shown. For example, in SciTE: Edit | Complete Word; File | Save As… shows the autocompletion over the save dialog.

    Pop-up menus are short term and normally tied to the mouse button so its OK for them to be more forward. Scintilla autocompletion lists are generally more keyboard-oriented so should be less forward. Call-tips should be less-forward again. Other mouse-interaction menus should be in front of these Scintilla windows so they can be seen during use. NSPopUpMenuWindowLevel (kCGPopUpMenuWindowLevel=101) seems excessive when the goal is to show over modal dialogs (8) and NSModalPanelWindowLevel+1 (9) seems to me to be a milder alternative that is less likely to cause problems.

    It might even be possible to determine the level that the window containing the Scintilla view is on and use that level +1 to show it just in front. That would fix the issue above where the autocompletion goes over the save panel.

    kCGNormalWindowLevel            0
    kCGFloatingWindowLevel          3
    kCGTornOffMenuWindowLevel       3
    kCGModalPanelWindowLevel        8
    kCGUtilityWindowLevel           19
    kCGDockWindowLevel              20
    kCGMainMenuWindowLevel          24
    kCGStatusWindowLevel            25
    kCGPopUpMenuWindowLevel         101
    kCGOverlayWindowLevel           102
    kCGHelpWindowLevel              200
    kCGDraggingWindowLevel          500
    kCGScreenSaverWindowLevel       1000
    kCGAssistiveTechHighWindowLevel 1500
    kCGCursorWindowLevel            kCGMaximumWindowLevel - 1
    
     
  • Neil Hodgson

    Neil Hodgson - 2022-05-22
    • labels: --> scintilla, cocoa
    • status: open --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2022-05-22

    [7a8fbe] fixes this by using NSModalPanelWindowLevel+1 as the window level.

     

    Related

    Commit: [7a8fbe]


Log in to post a comment.

MongoDB Logo MongoDB