diff options
author | Cody Russell <cody@jhu.edu> | 2015-05-27 04:19:42 +0300 |
---|---|---|
committer | Cody Russell <cody@jhu.edu> | 2015-05-27 04:23:17 +0300 |
commit | 0315aef20f4c0e84441d9f5e05f516e037b1151b (patch) | |
tree | 60ca29ce2a964ca635442e9d8254c4bc90e12ce6 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop | |
parent | df35da8e8615c20ac6dc0f80884b5a1add01c33e (diff) |
[Ide] Win32 workaround for Window.Present() breaking window snapping
When we select a different document we want to focus that document's
floating window. But calling Present() breaks edge snapping mode in
Win32, so we now raise/focus instead.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=22570
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs index bba44c2296..6f92157347 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs @@ -434,7 +434,13 @@ namespace MonoDevelop.Ide.Desktop /// </summary> public virtual void GrabDesktopFocus (Gtk.Window window) { - window.Present (); + if (Platform.IsWindows && window.IsRealized) { + /* On Windows calling Present() will break out of window edge snapping mode. */ + window.GdkWindow.Focus (0); + window.GdkWindow.Raise (); + } else { + window.Present (); + } } internal virtual void RemoveWindowShadow (Gtk.Window window) |