tomboy r2117 - branches/tomboy-portable2/Tomboy



Author: sharm
Date: Wed Sep  3 20:51:44 2008
New Revision: 2117
URL: http://svn.gnome.org/viewvc/tomboy?rev=2117&view=rev

Log:
* Tomboy/Tray.cs: Use GetPointer to handle screen coordinates, since
  GetGeometry isn't working on Windows.  Based on patch from Doug
  Johnston.

Modified:
   branches/tomboy-portable2/Tomboy/Tray.cs

Modified: branches/tomboy-portable2/Tomboy/Tray.cs
==============================================================================
--- branches/tomboy-portable2/Tomboy/Tray.cs	(original)
+++ branches/tomboy-portable2/Tomboy/Tray.cs	Wed Sep  3 20:51:44 2008
@@ -195,10 +195,15 @@
 			Gdk.Rectangle area;
 			Gtk.Orientation orientation;
 			try {
+#if WIN32
+				menu.Screen.Display.GetPointer (out x, out y);
+				screen = menu.Screen;
+				area.Height = 0;
+#else
 				GetGeometry (out screen, out area, out orientation);
-
 				x = area.X;
 				y = area.Y;
+#endif
 
 				Gtk.Requisition menu_req = menu.SizeRequest ();
 				if (y + menu_req.Height >= screen.Height)
@@ -267,24 +272,26 @@
 
 		public bool MenuOpensUpward ()
 		{
-#if WIN32
-			return true;
-#else
 			bool open_upwards = false;
 			int val = 0;
 			Gdk.Screen screen = null;
 
 			Gdk.Rectangle area;
 			Gtk.Orientation orientation;
+#if WIN32
+			int x;
+			tray.TomboyTrayMenu.Screen.Display.GetPointer (out x, out val);
+			screen = tray.TomboyTrayMenu.Screen;
+#else
 			GetGeometry (out screen, out area, out orientation);
 			val = area.Y;
+#endif
 
 			Gtk.Requisition menu_req = tray.TomboyTrayMenu.SizeRequest ();
 			if (val + menu_req.Height >= screen.Height)
 				open_upwards = true;
 
 			return open_upwards;
-#endif
 		}
 	}
 



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