[Monodevelop-patches-list] r1768 - trunk/MonoDevelop/src/Libraries/Gdl
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Jun 16 13:35:44 EDT 2004
Author: jzwart
Date: 2004-06-16 13:35:44 -0400 (Wed, 16 Jun 2004)
New Revision: 1768
Modified:
trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs
Log:
Set the Extra parameter on the DockRequest so it will reorder when moving a
floating item around instead of crashing.
Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs 2004-06-15 16:54:31 UTC (rev 1767)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockMaster.cs 2004-06-16 17:35:44 UTC (rev 1768)
@@ -282,7 +282,7 @@
request.Target.Dock (request.Applicant,
request.Position,
- null);
+ request.Extra);
EmitLayoutChangedEvent ();
}
@@ -302,12 +302,7 @@
/* first look under the pointer */
Gdk.Window window = Gdk.Window.AtPointer (out winX, out winY);
- if (window != null) {
- if (window.UserData == IntPtr.Zero) {
- Console.WriteLine ("The Gdk.Window should contain the Widget owner");
- return;
- }
-
+ if (window != null && window.UserData != IntPtr.Zero) {
/* ok, now get the widget who owns that window and see if we can
get to a Dock by walking up the hierarchy */
Widget widget = GLib.Object.GetObject (window.UserData, false) as Widget;
@@ -327,8 +322,6 @@
if (rootX >= winX && rootX < winX + winW &&
rootY >= winY && rootY < winY + winH)
dock = widget as Dock;
- } else {
- Console.WriteLine ("Gdk.Window does not contain the owner in the UserData field");
}
}
@@ -342,6 +335,8 @@
} else {
/* try to dock the item in all the docks in the ring in turn */
foreach (Dock topDock in toplevelDocks) {
+ if (topDock.GdkWindow == null)
+ Console.WriteLine ("Dock has no GdkWindow: {0}, {1}", topDock.Name, topDock);
/* translate root coordinates into dock object
coordinates (i.e. widget coordinates) */
topDock.GdkWindow.GetOrigin (out winX, out winY);
@@ -363,6 +358,12 @@
myRequest.Height = preferredSize.Height;
myRequest.X = rootX - item.DragOffX;
myRequest.Y = rootY - item.DragOffY;
+
+ Gdk.Rectangle rect = new Gdk.Rectangle (myRequest.X,
+ myRequest.Y,
+ myRequest.Width,
+ myRequest.Height);
+ myRequest.Extra = rect;
}
if (!(myRequest.X == request.X &&
More information about the Monodevelop-patches-list
mailing list