[Monodevelop-patches-list] r1174 - in trunk/MonoDevelop/src/Main/Base: Commands Gui/Workbench

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Mar 15 15:31:26 EST 2004


Author: tberman
Date: 2004-03-15 15:31:26 -0500 (Mon, 15 Mar 2004)
New Revision: 1174

Modified:
   trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
Log:
fix bug #55199 in a dirty fashion
need to look into using gnome-session and GnomeClient stuff.


Modified: trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs	2004-03-15 19:18:14 UTC (rev 1173)
+++ trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs	2004-03-15 20:31:26 UTC (rev 1174)
@@ -213,7 +213,7 @@
 			Gtk.Application.Run();
 			
 			// save the workbench memento in the ide properties
-			propertyService.SetProperty(workbenchMemento, WorkbenchSingleton.Workbench.CreateMemento());
+			//propertyService.SetProperty(workbenchMemento, WorkbenchSingleton.Workbench.CreateMemento());
 		}
 	}
 }

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs	2004-03-15 19:18:14 UTC (rev 1173)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs	2004-03-15 20:31:26 UTC (rev 1174)
@@ -59,23 +59,11 @@
 			}
 			set {
 				fullscreen = value;
-#if GTK
 				if (fullscreen) {
 					this.Fullscreen ();
 				} else {
 					this.Unfullscreen ();
 				}
-#else
-				if (fullscreen) {
-					FormBorderStyle    = FormBorderStyle.None;
-					defaultWindowState = WindowState;
-					WindowState        = FormWindowState.Maximized;
-				} else {
-					FormBorderStyle = FormBorderStyle.Sizable;
-					Bounds          = normalBounds;
-					WindowState     = defaultWindowState;
-				}
-#endif
 			}
 		}
 		
@@ -146,8 +134,8 @@
 		
 			windowChangeEventHandler = new EventHandler(OnActiveWindowChanged);
 
-			DefaultWidth = normalBounds.Width;
-			DefaultHeight = normalBounds.Height;
+			WidthRequest = normalBounds.Width;
+			HeightRequest = normalBounds.Height;
 
 			DeleteEvent += new Gtk.DeleteEventHandler (OnClosing);
 			this.Icon = resourceService.GetBitmap ("Icons.SharpDevelopIcon");
@@ -391,7 +379,14 @@
 		public IXmlConvertable CreateMemento()
 		{
 			WorkbenchMemento memento   = new WorkbenchMemento();
-			memento.Bounds             = normalBounds;
+			int x, y, width, height;
+			GdkWindow.GetSize (out width, out height);
+			GdkWindow.GetRootOrigin (out x, out y);
+			if (GdkWindow.State != Gdk.WindowState.Fullscreen && GdkWindow.State != Gdk.WindowState.Maximized) {
+				memento.Bounds             = new Rectangle (x, y, width, height);
+			} else {
+				memento.Bounds = normalBounds;
+			}
 #if GTK
 			// FIXME: GTKize
 #else
@@ -408,6 +403,8 @@
 				WorkbenchMemento memento = (WorkbenchMemento)xmlMemento;
 				
 				normalBounds = memento.Bounds;
+				Move (normalBounds.X, normalBounds.Y);
+				Resize (normalBounds.Width, normalBounds.Height);
 #if GTK
 				// FIXME: GTKize
 #else
@@ -496,6 +493,7 @@
 		protected /*override*/ void OnClosing(object o, Gtk.DeleteEventArgs e)
 		{
 			if (Close()) {
+	                        propertyService.SetProperty("SharpDevelop.Workbench.WorkbenchMemento", WorkbenchSingleton.Workbench.CreateMemento());
 				Gtk.Application.Quit ();
 			} else {
 				e.RetVal = true;




More information about the Monodevelop-patches-list mailing list