[Mono-bugs] [Bug 82210][Nor] New - ContextMenuStrip positioned off-screen

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 27 21:07:04 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by stephen at paskaluk.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82210

--- shadow/82210	2007-07-27 21:07:04.000000000 -0400
+++ shadow/82210.tmp.25033	2007-07-27 21:07:04.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 82210
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Windows XP
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: stephen at paskaluk.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ContextMenuStrip positioned off-screen
+
+Description of Problem: Right clicking a NotifyIcon will bring up its 
+ContextMenuStrip (if it has one) in the AboveLeft direction, causing it to 
+come up mostly off-screen when the user's taskbar is on the left or top of 
+the screen.  .NET behavior is to modify the direction as necessary to keep 
+the menu on-screen.
+
+Marked as Windows XP as that's where I've confirmed the behavior and the 
+fix.  The direction is dictated in NotifyIcon.cs and the problem appears 
+as though it would affect all platforms.  Tested with the windows package 
+for Mono-1.2.4 and a build of svn trunk from July 26, 2007 on XP/cygwin.  
+Patch created against July 26 checkout
+
+Steps to reproduce the problem:
+1. Compile and run the sample program
+2. Move the taskbar to the left or top of the screen
+3. Right click the tray icon
+
+Actual Results:
+Menu will pop up above and to the left of the mouse cursor, making it 
+barely accessible
+
+Expected Results:
+Menu should pop up below and/or to the right of the cursor as necessary
+
+Additional Information:
+
+The patch changes the right-click handler in NotifyIcon to check the 
+location of the click against the dimensions of the ContextMenuStrip and 
+the screen to make on of four different calls to Show.  The patch, as 
+supplied, is a bit ugly and will result in the menu not being shown for 
+the extreme case of the screen being too small to hold either the width or 
+height of the ContextMenuStrip rooted at the click location.
+
+The readability of the patched code could also be improved by declaring 
+(and setting a default) direction which could be modified in the 
+conditional and have one Show call at the end.


More information about the mono-bugs mailing list