mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-24 21:01:33 +00:00
Fix mouse capture when picking texture in visual mode, on Mono Winforms (#1073)
This commit is contained in:
parent
98a36017ae
commit
efacbef45a
2 changed files with 32 additions and 2 deletions
|
@ -408,6 +408,9 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
protected override void OnMouseDoubleClick(MouseEventArgs e)
|
protected override void OnMouseDoubleClick(MouseEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnMouseDoubleClick(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)
|
if(General.Interface.CtrlState || General.Interface.ShiftState || selection.Count != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -4158,14 +4158,41 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
// Returns the new texture name or the same texture name when cancelled
|
// Returns the new texture name or the same texture name when cancelled
|
||||||
public string BrowseTexture(IWin32Window owner, string initialvalue)
|
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
|
// This browses for a flat
|
||||||
// Returns the new flat name or the same flat name when cancelled
|
// Returns the new flat name or the same flat name when cancelled
|
||||||
public string BrowseFlat(IWin32Window owner, string initialvalue)
|
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
|
// This browses the lindef types
|
||||||
|
|
Loading…
Reference in a new issue