mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Fixed an issue which was described in #217, also did some hardening that it doesn't happen on other locations in the TextContainer.
This commit is contained in:
parent
80c262d47f
commit
ca0095491b
1 changed files with 13 additions and 3 deletions
|
@ -158,9 +158,15 @@ namespace Greenshot.Drawing
|
|||
|
||||
protected override void SwitchParent(Surface newParent)
|
||||
{
|
||||
_parent.SizeChanged -= Parent_SizeChanged;
|
||||
if (_parent != null)
|
||||
{
|
||||
_parent.SizeChanged -= Parent_SizeChanged;
|
||||
}
|
||||
base.SwitchParent(newParent);
|
||||
_parent.SizeChanged += Parent_SizeChanged;
|
||||
if (_parent != null)
|
||||
{
|
||||
_parent.SizeChanged += Parent_SizeChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void Parent_SizeChanged(object sender, EventArgs e)
|
||||
|
@ -320,8 +326,12 @@ namespace Greenshot.Drawing
|
|||
|
||||
private void HideTextBox()
|
||||
{
|
||||
_parent.Focus();
|
||||
_parent?.Focus();
|
||||
_textBox?.Hide();
|
||||
if (_parent == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_parent.KeysLocked = false;
|
||||
_parent.Controls.Remove(_textBox);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue