diff --git a/Source/Core/Controls/ImageSelectorPanel.cs b/Source/Core/Controls/ImageSelectorPanel.cs index 82f0315d..bdd21484 100755 --- a/Source/Core/Controls/ImageSelectorPanel.cs +++ b/Source/Core/Controls/ImageSelectorPanel.cs @@ -408,6 +408,9 @@ namespace CodeImp.DoomBuilder.Controls protected override void OnMouseDoubleClick(MouseEventArgs e) { base.OnMouseDoubleClick(e); + //TODO: testing this on Windows, it looks like General.Interface.CtrlState and + // General.Interface.ShiftState are always false, because as the main window + // doesn't have focus and won't update these states if(General.Interface.CtrlState || General.Interface.ShiftState || selection.Count != 1) return; diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 52cfa7d0..83dcb596 100755 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -4158,14 +4158,41 @@ namespace CodeImp.DoomBuilder.Windows // Returns the new texture name or the same texture name when cancelled public string BrowseTexture(IWin32Window owner, string initialvalue) { - return TextureBrowserForm.Browse(owner, initialvalue, false);//mxd + + DisableProcessing(); + #if MONO_WINFORMS + //Mono's Winforms treat dialogs a little differently + // they don't implicitly take focus from the parent window + // and keyboard input from focus window isn't reset when the dialog takes focus + BreakExclusiveMouseInput(); + ReleaseAllKeys(); + #endif + string tex = TextureBrowserForm.Browse(owner, initialvalue, false);//mxd + #if MONO_WINFORMS + ResumeExclusiveMouseInput(); + #endif + EnableProcessing(); + return tex; } // This browses for a flat // Returns the new flat name or the same flat name when cancelled public string BrowseFlat(IWin32Window owner, string initialvalue) { - return TextureBrowserForm.Browse(owner, initialvalue, true); //mxd. was FlatBrowserForm + DisableProcessing(); + #if MONO_WINFORMS + //Mono's Winforms treat dialogs a little differently + // they don't implicitly take focus from the parent window + // and keyboard input from focus window isn't reset when the dialog takes focus + BreakExclusiveMouseInput(); + ReleaseAllKeys(); + #endif + string tex = TextureBrowserForm.Browse(owner, initialvalue, true); //mxd. was FlatBrowserForm + #if MONO_WINFORMS + ResumeExclusiveMouseInput(); + #endif + EnableProcessing(); + return tex; } // This browses the lindef types