https://bugzilla.novell.com/show_bug.cgi?id=448929


           Summary: [PATCH] NRE navigating MDI menu with keyboard
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


This is a patch that adds some checks to MenuAPI.cs to avoid some NRE that show
only when navigating an MDI form's menu using the keyboard.

The third check (CurrentMenu is MenuItem) is specially important because for
some reason that escapes to me, the "sender" for MenuTracker.ProcessKeys()
-which is a MenuItem for a regular form or an MDI form with no active children-
is a ContextMenu for an MDI form with an active children. To reproduce the
problem, create an MDI application, open up a children form, activate any menu
and hit left-arrow twice.


Here are some dumps:

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Windows.Forms.MenuTracker.ProcessKeys
(System.Windows.Forms.Message& msg, Keys keyData) [0x0028e] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs:743
 
  at System.Windows.Forms.Menu.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x0000d] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs:323
 
  at System.Windows.Forms.Control.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4683
 
  at System.Windows.Forms.TextBoxBase.ProcessCmdKey
(System.Windows.Forms.Message& msg, Keys keyData) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs:1100
 
  at System.Windows.Forms.Control.InternalPreProcessMessage
(System.Windows.Forms.Message& msg) [0x00038] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4176
 
  at System.Windows.Forms.Control.PreProcessMessage
(System.Windows.Forms.Message& msg) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4167
 
  at System.Windows.Forms.Control.PreProcessControlMessageInternal
(System.Windows.Forms.Message& msg) [0x00064] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4142
 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:PreProcessControlMessageInternal
(System.Windows.Forms.Message&)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x0027d] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:953
 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x0002e] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:776
 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
[0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:759
 
  at Lazaro.Aplicacion.IniciarNormal () [0x001a6] in
/home/usuario/Lazaro/Sistema/Clases/Aplicacion.cs:421 
  at Lazaro.Aplicacion.Main (System.String[] args) [0x003da] in
/home/usuario/Lazaro/Sistema/Clases/Aplicacion.cs:321 





Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Windows.Forms.MenuTracker.GetNextItem (System.Windows.Forms.Menu
menu, ItemNavigation navigation) [0x00035] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs:497
 
  at System.Windows.Forms.MenuTracker.ProcessKeys
(System.Windows.Forms.Message& msg, Keys keyData) [0x001fc] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs:729
 
  at System.Windows.Forms.Menu.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x0000d] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs:323
 
  at System.Windows.Forms.Control.ProcessCmdKey (System.Windows.Forms.Message&
msg, Keys keyData) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4683
 
  at System.Windows.Forms.TextBoxBase.ProcessCmdKey
(System.Windows.Forms.Message& msg, Keys keyData) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs:1100
 
  at System.Windows.Forms.Control.InternalPreProcessMessage
(System.Windows.Forms.Message& msg) [0x00038] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4176
 
  at System.Windows.Forms.Control.PreProcessMessage
(System.Windows.Forms.Message& msg) [0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4167
 
  at System.Windows.Forms.Control.PreProcessControlMessageInternal
(System.Windows.Forms.Message& msg) [0x00064] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4142
 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:PreProcessControlMessageInternal
(System.Windows.Forms.Message&)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x0027d] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:953
 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x0002e] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:776
 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
[0x00000] in
/home/usuario/mono/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:759
 
  at Lazaro.Aplicacion.IniciarNormal () [0x001a6] in
/home/usuario/Lazaro/Sistema/Clases/Aplicacion.cs:421 
  at Lazaro.Aplicacion.Main (System.String[] args) [0x003da] in
/home/usuario/Lazaro/Sistema/Clases/Aplicacion.cs:321


-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to