Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for TextBox GPU memory leak #3060

Merged
merged 2 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes/1.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ More informations about the reason of this decision can be found here:
- [#3054](https://github.com/MahApps/MahApps.Metro/issues/3054) WindowsSettingBehaviour broken after using ControlzEx
- [#3028](https://github.com/MahApps/MahApps.Metro/issues/3028) SaveWindowPosition causes application to crash
- [#3023](https://github.com/MahApps/MahApps.Metro/issues/3023) Custom Dialog Theme Issue
- [#2990](https://github.com/MahApps/MahApps.Metro/issues/2990) TextBox memory leak
25 changes: 10 additions & 15 deletions src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@
</ControlTemplate.Resources>
<Grid>
<AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
<AdornerDecorator.CacheMode>
<BitmapCache EnableClearType="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator.CacheMode>
<Border x:Name="PART_WaitingForDataEffectGrid"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
Effect="{DynamicResource WaitingForDataEffect}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator>
<Border x:Name="Base"
Expand Down Expand Up @@ -306,14 +304,12 @@
<Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{DynamicResource WaitingForDataEffect}" />
<MultiTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
</MultiTrigger.EnterActions>
</MultiTrigger>
<Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -359,13 +355,11 @@
</ControlTemplate.Resources>
<Grid>
<AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
<AdornerDecorator.CacheMode>
<BitmapCache EnableClearType="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator.CacheMode>
<Border x:Name="PART_WaitingForDataEffectGrid"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
Effect="{DynamicResource WaitingForDataEffect}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator>
<Border x:Name="Base"
Expand Down Expand Up @@ -521,14 +515,12 @@
<Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{DynamicResource WaitingForDataEffect}" />
<MultiTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
</MultiTrigger.EnterActions>
</MultiTrigger>
<Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -572,13 +564,11 @@
</ControlTemplate.Resources>
<Grid>
<AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
<AdornerDecorator.CacheMode>
<BitmapCache EnableClearType="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator.CacheMode>
<Border x:Name="PART_WaitingForDataEffectGrid"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
Effect="{DynamicResource WaitingForDataEffect}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator>
<Border x:Name="Base"
Expand Down Expand Up @@ -769,14 +759,12 @@
<Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{DynamicResource WaitingForDataEffect}" />
<MultiTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
</MultiTrigger.EnterActions>
</MultiTrigger>
<Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -794,3 +782,10 @@
</Style>

</ResourceDictionary>







15 changes: 5 additions & 10 deletions src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@
</ControlTemplate.Resources>
<Grid>
<AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
<AdornerDecorator.CacheMode>
<BitmapCache EnableClearType="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator.CacheMode>
<Border x:Name="PART_WaitingForDataEffectGrid"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
Effect="{DynamicResource WaitingForDataEffect}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator>
<Border x:Name="Base"
Expand Down Expand Up @@ -229,14 +227,12 @@
<Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{DynamicResource WaitingForDataEffect}" />
<MultiTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
</MultiTrigger.EnterActions>
</MultiTrigger>
<Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -283,13 +279,11 @@
</ControlTemplate.Resources>
<Grid>
<AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
<AdornerDecorator.CacheMode>
<BitmapCache EnableClearType="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator.CacheMode>
<Border x:Name="PART_WaitingForDataEffectGrid"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
Effect="{DynamicResource WaitingForDataEffect}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</AdornerDecorator>
<Border x:Name="Base"
Expand Down Expand Up @@ -435,14 +429,12 @@
<Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{DynamicResource WaitingForDataEffect}" />
<MultiTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
</MultiTrigger.EnterActions>
</MultiTrigger>
<Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
<Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_WaitingForDataEffectGrid" Property="Effect" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -550,3 +542,6 @@
</Setter>
</Style>
</ResourceDictionary>



2 changes: 2 additions & 0 deletions src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
Exponent="2" />

<DropShadowEffect x:Key="WaitingForDataEffect"
po:Freeze="True"
x:Shared="False"
BlurRadius="10"
Opacity="0"
ShadowDepth="0"
Expand Down