Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <llsan@microsoft.com>2018-07-06 12:12:47 +0300
committerGitHub <noreply@github.com>2018-07-06 12:12:47 +0300
commit35cd3d62d3dd9e10cecc3b8dd7b089106db3ffa1 (patch)
treecf0665d4a13efdcbd49efa7de32544b7caef3a39 /main/src/addins
parent7ceffc1e3d78ae498083af6406e9303380d31b4e (diff)
parent47443b400943a22eb1f3a30407a2c9d0dbc19c6a (diff)
Merge pull request #5195 from mono/fix-window-launch-glitch
Fix window launch glitch
Diffstat (limited to 'main/src/addins')
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs207
1 files changed, 98 insertions, 109 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
index aca3855241..133db60e95 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
@@ -1,34 +1,34 @@
-//
-// WindowsPlatform.cs
-//
-// Author:
-// Jonathan Pobst <monkey@jpobst.com>
-// Lluis Sanchez Gual <lluis@novell.com>
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (C) 2007-2011 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2012-2013 Xamarin Inc. (https://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
+//
+// WindowsPlatform.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+// Lluis Sanchez Gual <lluis@novell.com>
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (C) 2007-2011 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2012-2013 Xamarin Inc. (https://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.IO;
using System.Drawing;
@@ -42,18 +42,18 @@ using MonoDevelop.Ide.Desktop;
using System.Diagnostics;
using MonoDevelop.Core.Execution;
using System.Text;
-using MonoDevelop.Core;
+using MonoDevelop.Core;
using Microsoft.WindowsAPICodePack.InternetExplorer;
using Microsoft.WindowsAPICodePack.Taskbar;
using MonoDevelop.Ide;
using MonoDevelop.Components.Windows;
using WindowsPlatform.MainToolbar;
-using MonoDevelop.Components.Commands;
+using MonoDevelop.Components.Commands;
using System.Windows.Controls;
using System.Collections.ObjectModel;
-using System.Windows;
-using System.Windows.Input;
-
+using System.Windows;
+using System.Windows.Input;
+
namespace MonoDevelop.Platform
{
public class WindowsPlatform : PlatformService
@@ -70,8 +70,8 @@ namespace MonoDevelop.Platform
public override string Name {
get { return "Windows"; }
- }
-
+ }
+
#region Toolbar implementation
Components.Commands.CommandManager commandManager;
string commandMenuAddinPath;
@@ -89,13 +89,13 @@ namespace MonoDevelop.Platform
const int WM_SYSCHAR = 0x0106;
internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar)
{
- titleBar = new TitleBar ();
- var topMenu = new WPFTitlebar (titleBar);
-
- //commandManager.IncompleteKeyPressed += (sender, e) => {
- // if (e.Key == Gdk.Key.Alt_L) {
- // Keyboard.Focus(titleBar.DockTitle.Children[0]);
- // }
+ titleBar = new TitleBar ();
+ var topMenu = new WPFTitlebar (titleBar);
+
+ //commandManager.IncompleteKeyPressed += (sender, e) => {
+ // if (e.Key == Gdk.Key.Alt_L) {
+ // Keyboard.Focus(titleBar.DockTitle.Children[0]);
+ // }
//};
parent.PackStart (topMenu, false, true, 0);
SetupMenu ();
@@ -104,20 +104,20 @@ namespace MonoDevelop.Platform
}
void SetupMenu ()
- {
- // TODO: Use this?
+ {
+ // TODO: Use this?
CommandEntrySet appCes = commandManager.CreateCommandEntrySet (appMenuAddinPath);
CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
- var mainMenu = new Menu {
- IsMainMenu = true,
- FocusVisualStyle = null,
+ var mainMenu = new Menu {
+ IsMainMenu = true,
+ FocusVisualStyle = null,
};
- foreach (CommandEntrySet ce in ces)
- {
- var item = new TitleMenuItem (commandManager, ce, menu: mainMenu);
- mainMenu.Items.Add(item);
- }
+ foreach (CommandEntrySet ce in ces)
+ {
+ var item = new TitleMenuItem (commandManager, ce, menu: mainMenu);
+ mainMenu.Items.Add(item);
+ }
titleBar.DockTitle.Children.Add (mainMenu);
DockPanel.SetDock (mainMenu, Dock.Left);
@@ -128,36 +128,25 @@ namespace MonoDevelop.Platform
TitleBar titleBar;
internal override Components.MainToolbar.IMainToolbarView CreateMainToolbar (Gtk.Window window)
- {
- return new WPFToolbar {
- HeightRequest = 40,
+ {
+ return new WPFToolbar {
+ HeightRequest = 40,
};
- }
+ }
#endregion
- public override bool GetIsFullscreen (Components.Window window)
+ public override bool GetIsFullscreen (Components.Window window)
{
- WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
- lpwndpl.length = Marshal.SizeOf (lpwndpl);
-
- Gtk.Window controlWindow = window;
- IntPtr handle = GdkWin32.HgdiobjGet (controlWindow.GdkWindow);
- Win32.GetWindowPlacement (handle, ref lpwndpl);
- return lpwndpl.showCmd == Win32.SW_SHOWMAXIMIZED;
+ //the Fullscreen functionality is broken in GTK on Win7+
+ //TODO: implement a workaround.
+ return false;
}
- public override void SetIsFullscreen (Components.Window window, bool isFullscreen)
+ public override void SetIsFullscreen (Components.Window window, bool isFullscreen)
{
- WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
- lpwndpl.length = Marshal.SizeOf (lpwndpl);
-
- Gtk.Window controlWindow = window;
- IntPtr handle = GdkWin32.HgdiobjGet (controlWindow.GdkWindow);
- Win32.GetWindowPlacement (handle, ref lpwndpl);
- lpwndpl.showCmd = isFullscreen ? Win32.SW_SHOWMAXIMIZED : Win32.SW_SHOWNORMAL;
- Win32.SetWindowPlacement (handle, ref lpwndpl);
+ //no-op as we have not yet implemented this
}
-
+
internal static Xwt.Toolkit WPFToolkit;
public override void Initialize ()
@@ -165,8 +154,8 @@ namespace MonoDevelop.Platform
// Only initialize elements for Win7+.
if (TaskbarManager.IsPlatformSupported) {
TaskbarManager.Instance.ApplicationId = BrandingService.ApplicationName;
- }
- // Set InternetExplorer emulation mode
+ }
+ // Set InternetExplorer emulation mode
InternetExplorer.EmulationMode = IEEmulationMode.IE11;
}
@@ -550,8 +539,8 @@ namespace MonoDevelop.Platform
try {
SHOpenFolderAndSelectItems (dir, (uint)files.Length, files, 0);
} finally {
- ILFree (dir);
- foreach (var file in files)
+ ILFree (dir);
+ foreach (var file in files)
ILFree (file);
}
}
@@ -573,34 +562,34 @@ namespace MonoDevelop.Platform
foreach (string file in files)
Process.Start (ExePath, ProcessArgumentBuilder.Quote (file));
}
- }
-
- static void ApplyTheme (System.Windows.Window window)
- {
- var color = System.Windows.Media.Color.FromArgb (
- (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Alpha * 255.0),
- (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Red * 255.0),
- (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Green * 255.0),
- (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Blue * 255.0));
- window.Background = new System.Windows.Media.SolidColorBrush (color);
- }
-
- public class ThemedWpfWindowBackend : Xwt.WPFBackend.WindowBackend
- {
- public override void Initialize ()
- {
- base.Initialize ();
- ApplyTheme (Window);
- }
- }
-
- public class ThemedWpfDialogBackend : Xwt.WPFBackend.DialogBackend
- {
- public override void Initialize ()
- {
- base.Initialize ();
- ApplyTheme (Window);
- }
+ }
+
+ static void ApplyTheme (System.Windows.Window window)
+ {
+ var color = System.Windows.Media.Color.FromArgb (
+ (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Alpha * 255.0),
+ (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Red * 255.0),
+ (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Green * 255.0),
+ (byte)(MonoDevelop.Ide.Gui.Styles.BackgroundColor.Blue * 255.0));
+ window.Background = new System.Windows.Media.SolidColorBrush (color);
+ }
+
+ public class ThemedWpfWindowBackend : Xwt.WPFBackend.WindowBackend
+ {
+ public override void Initialize ()
+ {
+ base.Initialize ();
+ ApplyTheme (Window);
+ }
+ }
+
+ public class ThemedWpfDialogBackend : Xwt.WPFBackend.DialogBackend
+ {
+ public override void Initialize ()
+ {
+ base.Initialize ();
+ ApplyTheme (Window);
+ }
}
}
}