dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[Dotgnu-pnet-commits] pnetlib/Xsharp TopLevelWindow.cs,1.11,1.12


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/Xsharp TopLevelWindow.cs,1.11,1.12
Date: Sat, 29 Nov 2003 23:40:48 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/Xsharp
In directory subversions:/tmp/cvs-serv5094/Xsharp

Modified Files:
        TopLevelWindow.cs 
Log Message:


Redirect Alt+F4 to close top-level windows if the window manager
doesn't do it for us.


Index: TopLevelWindow.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/TopLevelWindow.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TopLevelWindow.cs   21 Nov 2003 03:40:42 -0000      1.11
--- TopLevelWindow.cs   29 Nov 2003 23:40:46 -0000      1.12
***************
*** 921,924 ****
--- 921,945 ----
                                                }
  
+                                               // Special case: check for 
Alt+F4 to close the window.
+                                               // Some window managers trap 
Alt+F4 themselves, but not
+                                               // all.  People who are used to 
System.Windows.Forms
+                                               // under Windows expect Alt+F4 
to close the window,
+                                               // irrespective of what key the 
window manager uses.
+                                               //
+                                               // Note: this check is not 
foolproof.  The window
+                                               // manager or the kernel may 
have redirected Alt+F4
+                                               // for some other purpose (e.g. 
switching between
+                                               // virtual consoles).  On such 
systems, there is
+                                               // nothing that we can do to 
get the key event and
+                                               // this code will never be 
called.
+                                               //
+                                               if((((KeyName)keysym) == 
KeyName.XK_F4 ||
+                                                   ((KeyName)keysym) == 
KeyName.XK_KP_F4) &&
+                                                  (xevent.xkey.state & 
ModifierMask.Mod1Mask) != 0)
+                                               {
+                                                       Close();
+                                                       break;
+                                               }
+ 
                                                // Dispatch the event.
                                                widget = focusWidget;





reply via email to

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