[Mono-bugs] [Bug 406773] New: Nullreference using context menu keyboard shortcut

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 7 09:55:54 EDT 2008


User dsuarezv at codice.es added comment

           Summary: Nullreference using context menu keyboard shortcut
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dsuarezv at codice.es
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Keyboard shortcuts on context menus present some problems: 

1.- When a menu is assigned to a  control, the shortcuts don't work until the
menu is first displayed by right clicking with the mouse. 

2.- The shortcuts are incorrectly drawn (this was working fine on 1.2.6). See
attached screenshot

3.- When the shortcut is used (after displying the menu with the mouse and
hiding again), a nullref is thrown and the application closed. This is the
resulting stack: 

Object reference not set to an instance of an object
  at System.Windows.Forms.MenuTracker.Deactivate () [0x00000] 
  at System.Windows.Forms.MenuTracker.ProcessShortcut (Keys keyData) [0x00000] 
  at System.Windows.Forms.MenuTracker.ProcessKeys
(System.Windows.Forms.Message& msg, Keys keyData) [0x00000] 
  at System.Windows.Forms.Menu.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x00000] 
  at System.Windows.Forms.Control.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x00000] 
  at System.Windows.Forms.Control.InternalPreProcessMessage
(System.Windows.Forms.Message& msg) [0x00000] 
  at System.Windows.Forms.Control.PreProcessMessage
(System.Windows.Forms.Message& msg) [0x00000] 
  at System.Windows.Forms.Control.PreProcessControlMessageInternal
(System.Windows.Forms.Message& msg) [0x00000] 
  at (wrapper remoting-invoke-with-check)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
  at Codice.CM.Client.Gui.main.Main (System.String[] args) [0x00000]
dave at clio:/mnt/darktower/01nerva/src/plastic/plastic/bin/Debug$ 

Sample testcase attached. 

To reproduce #1, load the sample, textbox has the focus, press ctrl-O without
rightclicking the textbox before. No messagebox appears. 

To reproduce #2, right click on the textbox, I get the menu like the

To reproduce #3, just hit Ctrl-O after the rightclick to display the menu. No
messagebox appears, instead a nullref and the application closes. 

This has been tested with 1.9.1, latest fixes on svn for context were not
checked, some of the problems may have been already corrected.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list