unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.95k stars 726 forks source link

Button does not revert back from a pressed state #11612

Closed brswan closed 1 year ago

brswan commented 1 year ago

Current behavior

When multiple buttons are on screen and the user makes several quick selections, buttons can be stuck in a pressed state. This could be a pointer issue but I do not know for certain.

This behavior appears most often with a GTK build (linux arm64), utilizing touch only, and while under heavy CPU usage. Note that I using software rendering as OpenGLES is not support with my current GPU.

Expected behavior

Button should revert back to the normal (unpressed state).

How to reproduce it (as minimally and precisely as possible)

Using Uno Material Win UI 2.3.0

The following page and styles were used in the provided gif and screen shots below.

Run the page below. Make multiple quick selections to buttons on screen. Eventually one will get stuck on a focused state.

<Page
      x:Class="App1.ButtonStateStuckPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="using:App1"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
      mc:Ignorable="d">
      <Page.Resources>
          <Style x:Key="FeedbackButton" TargetType="Button">
              <Setter Property="Padding" Value="0" />
              <Setter Property="Margin" Value="4" />
              <Setter Property="HorizontalContentAlignment" Value="Center" />
              <Setter Property="VerticalContentAlignment" Value="Center" />
              <Setter Property="HorizontalAlignment" Value="Stretch" />
              <Setter Property="VerticalAlignment" Value="Stretch" />
              <Setter Property="CornerRadius" Value="10" />
              <Setter Property="Template">
                  <ControlTemplate TargetType="Button">
                      <!--<Grid x:Name="MainGrid">-->
                      <ContentPresenter
                          x:Name="ContentPresenter"
                          Padding="{TemplateBinding Padding}"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}"
                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          Content="{TemplateBinding Content}"
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          CornerRadius="{TemplateBinding CornerRadius}" />
                      <!--</Grid>-->

                      <!--<VisualStateManager.VisualStateGroups>
                      <VisualStateGroup x:Name="CommonStates">
                          <VisualState x:Name="Normal">
                              <Storyboard>
                                  <PointerUpThemeAnimation Storyboard.TargetName="MainGrid" />
                              </Storyboard>
                          </VisualState>

                          <VisualState x:Name="Pressed">
                              <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Background">
                                      <DiscreteObjectKeyFrame KeyTime="0" Value="White" />
                                  </ObjectAnimationUsingKeyFrames>

                                  <PointerDownThemeAnimation Storyboard.TargetName="MainGrid" />
                              </Storyboard>
                          </VisualState>
                      </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>-->

                      <VisualStateManager.VisualStateGroups>
                          <VisualStateGroup x:Name="CommonStates">
                              <VisualState x:Name="Normal" />

                              <VisualState x:Name="Pressed">
                                  <VisualState.Setters>
                                      <Setter Target="ContentPresenter.BorderBrush" Value="White" />
                                  </VisualState.Setters>
                              </VisualState>

                              <VisualState x:Name="PointerOver">

                                  <VisualState.Setters />
                              </VisualState>
                          </VisualStateGroup>

                          <VisualStateGroup x:Name="FocusStates">

                              <VisualState x:Name="Focused" />

                              <VisualState x:Name="PointerFocused" />

                              <VisualState x:Name="Unfocused" />
                          </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                  </ControlTemplate>
              </Setter>
          </Style>
      </Page.Resources>

      <Grid>
          <Grid.ColumnDefinitions>
              <ColumnDefinition Width="100" />
              <ColumnDefinition Width="100" />
              <ColumnDefinition Width="100" />
              <ColumnDefinition Width="100" />
              <ColumnDefinition Width="100" />
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
              <RowDefinition Height="100" />
              <RowDefinition Height="100" />
              <RowDefinition Height="100" />
              <RowDefinition Height="100" />
              <RowDefinition Height="100" />
          </Grid.RowDefinitions>

          <Button Style="{StaticResource FeedbackButton}">
              <TextBlock Text="1" />
          </Button>

          <Button Grid.Column="1"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="2" />
          </Button>

          <Button Grid.Column="2"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="3" />
          </Button>

          <Button Grid.Column="3"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="4" />
          </Button>

          <Button Grid.Column="4"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="5" />
          </Button>

          <Button Grid.Row="1" Style="{StaticResource FeedbackButton}">
              <TextBlock Text="5" />
          </Button>

          <Button Grid.Row="1" Grid.Column="1"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="6" />
          </Button>

          <Button Grid.Row="1" Grid.Column="2"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="7" />
          </Button>

          <Button Grid.Row="1" Grid.Column="3"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="8" />
          </Button>

          <Button Grid.Row="1" Grid.Column="4"  Style="{StaticResource FeedbackButton}">
              <TextBlock Text="9" />
          </Button>
      </Grid>
  </Page>

Environment

Windows Linux GTK

Nuget Package: Uno Material Win UI

Package Version(s): 2.3.0

Affected platform(s):

Visual Studio:

Relevant plugins:

Anything else we need to know?

button-linux-arm64 button-vid

dr1rrb commented 1 year ago

Hey @brswan I'm trying to repro your issue but unfortunately, so far without success. Are you able to provide more info? Like more reproducible steps? the specs of your device?

Also I noticed that the style you defined in your repro is actually not used (missing a Setter.Value for the Template property, and also the root panel has been commented so visual states are ignored). But no matter which state I use, I'm unable to repro.

brswan commented 1 year ago

Hi @dr1rrb!

I noticed that this happens most often when being run on an arm64 Linux device. I was able to reproduce it with a Windows 10 device. If you look at the gif - that's basically how I reproduce it - clicking quickly on random buttons. For our actual software, which I cannot unfortunately share, we use a dialpad on an arm64 linux device. Thus, when users select the dial pad buttons quickly, the state can get stuck.

I suggest running the supplied code and clicking the buttons quickly. It is a tough bug to recreate as it happens randomly.

Also I noticed that the style you defined in your repro is actually not used (missing a Setter.Value for the Template property, and also the root panel has been commented so visual states are ignored). But no matter which state I use, I'm unable to repro.

That's possibly a copy and paste error. There are two sets of visual state groups - one is commented out. That was another method I was trying that also had the same issue with the button up state stuck issue. Please let me know if you need anything else.

dr1rrb commented 1 year ago

Ok i'll try again on another device then.

For reference, my version of your repro:

<Page
    x:Class="BtnPressedState.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BtnPressedState"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"    
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.Resources>
        <Style x:Key="FeedbackButton" TargetType="Button">
            <Setter Property="Padding" Value="0" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="CornerRadius" Value="10" />
            <Setter Property="Template">
                <Setter.Value>
                <ControlTemplate TargetType="Button">
                        <Grid x:Name="MainGrid">
                            <ContentPresenter
                        x:Name="ContentPresenter"
                        Padding="{TemplateBinding Padding}"
                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        CornerRadius="{TemplateBinding CornerRadius}" />
                            <!--</Grid>-->

                            <!--<VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal">
                            <Storyboard>
                                <PointerUpThemeAnimation Storyboard.TargetName="MainGrid" />
                            </Storyboard>
                        </VisualState>

                        <VisualState x:Name="Pressed">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Background">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="White" />
                                </ObjectAnimationUsingKeyFrames>

                                <PointerDownThemeAnimation Storyboard.TargetName="MainGrid" />
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>-->

                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />

                                    <VisualState x:Name="Pressed">
                                        <VisualState.Setters>
                                            <Setter Target="ContentPresenter.BorderBrush">
                                                <Setter.Value>
                                                    <SolidColorBrush Color="DeepPink" />
                                                </Setter.Value>
                                            </Setter>
                                        </VisualState.Setters>
                                    </VisualState>

                                    <VisualState x:Name="PointerOver">

                                        <VisualState.Setters>
                                            <Setter Target="ContentPresenter.BorderBrush">
                                                <Setter.Value>
                                                    <SolidColorBrush Color="Chartreuse" />
                                                </Setter.Value>
                                            </Setter>
                                        </VisualState.Setters>
                                    </VisualState>
                                </VisualStateGroup>

                                <VisualStateGroup x:Name="FocusStates">

                                    <VisualState x:Name="Focused" />

                                    <VisualState x:Name="PointerFocused" />

                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>

        <Button Style="{StaticResource FeedbackButton}">
            <TextBlock Text="1" />
        </Button>

        <Button Grid.Column="1"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="2" />
        </Button>

        <Button Grid.Column="2"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="3" />
        </Button>

        <Button Grid.Column="3"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="4" />
        </Button>

        <Button Grid.Column="4"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="5" />
        </Button>

        <Button Grid.Row="1" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="5" />
        </Button>

        <Button Grid.Row="1" Grid.Column="1"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="6" />
        </Button>

        <Button Grid.Row="1" Grid.Column="2"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="7" />
        </Button>

        <Button Grid.Row="1" Grid.Column="3"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="8" />
        </Button>

        <Button Grid.Row="1" Grid.Column="4"  Style="{StaticResource FeedbackButton}">
            <TextBlock Text="9" />
        </Button>
    </Grid>
</Page>
brswan commented 1 year ago

@dr1rrb - I think there is an issue with my provided example as you stated. I believe the my code was invalid and the app fell back using the native style and thus the use case is still valid as I was able to get the pointer stuck in the gif.
I've fixed the issue you found and I am currently unable to replicate the bug for now. I'll keep trying to get it captured. It tends to appear when the arm64 box is under heavy CPU utilization. For now it may be best to try and replicate with the original posted example (with the setter.value issue) as I was able to get it to trigger then.

Here's the updated code that I am currently unable to get to repro as well. Thank you for looking into this - I'm hoping you can replicate but it's difficult with random bugs like this.

<Page
    x:Class="App1.ButtonStateStuckPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:App1"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
    mc:Ignorable="d">
    <Page.Resources>
        <Style x:Key="FeedbackButtonOld" TargetType="Button">
            <Setter Property="Padding" Value="0" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="CornerRadius" Value="10" />
            <Setter Property="Template">
                <Setter.Value>

                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="MainGrid" Background="Blue">
                            <ContentPresenter
                                x:Name="ContentPresenter"
                                Padding="{TemplateBinding Padding}"
                                HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                CornerRadius="{TemplateBinding CornerRadius}" />
                        </Grid>

                        <!--<VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal">
                            <Storyboard>
                                <PointerUpThemeAnimation Storyboard.TargetName="MainGrid" />
                            </Storyboard>
                        </VisualState>

                        <VisualState x:Name="Pressed">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Background">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="White" />
                                </ObjectAnimationUsingKeyFrames>

                                <PointerDownThemeAnimation Storyboard.TargetName="MainGrid" />
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>-->

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="Pressed">
                                    <VisualState.Setters>
                                        <Setter Target="MainGrid.Background" Value="White" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PointerOver">

                                    <VisualState.Setters>
                                        <Setter Target="MainGrid.Background" Value="White" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="FocusStates">

                                <VisualState x:Name="Focused" />

                                <VisualState x:Name="PointerFocused" />

                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="FeedbackButton" TargetType="Button">
            <Setter Property="Padding" Value="0" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="CornerRadius" Value="10" />
            <Setter Property="Template">
                <Setter.Value>

                    <ControlTemplate TargetType="Button">
                        <Grid
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Background="Transparent"
                            IsHitTestVisible="True">
                            <Border
                                x:Name="MainBorder"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="0"
                                CornerRadius="{TemplateBinding CornerRadius}" />
                            <ContentPresenter
                                x:Name="contentPresenter"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}" />

                            <!--<VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal">
                        <Storyboard>
                            <PointerUpThemeAnimation Storyboard.TargetName="MainBorder" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="White" />
                            </ObjectAnimationUsingKeyFrames>

                            <PointerDownThemeAnimation Storyboard.TargetName="MainBorder" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="PointerOver">
                        <Storyboard>
                            <PointerUpThemeAnimation Storyboard.TargetName="MainBorder" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <PointerUpThemeAnimation Storyboard.TargetName="MainBorder" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>-->

                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />

                                    <VisualState x:Name="Pressed">

                                        <VisualState.Setters>
                                            <Setter Target="MainBorder.Background" Value="White" />
                                        </VisualState.Setters>
                                    </VisualState>

                                    <VisualState x:Name="PointerOver">

                                        <VisualState.Setters />
                                    </VisualState>
                                </VisualStateGroup>

                                <VisualStateGroup x:Name="FocusStates">

                                    <VisualState x:Name="Focused" />

                                    <VisualState x:Name="PointerFocused" />

                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>

        <Button Style="{StaticResource FeedbackButton}">
            <TextBlock Text="1" />
        </Button>

        <Button Grid.Column="1" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="2" />
        </Button>

        <Button Grid.Column="2" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="3" />
        </Button>

        <Button Grid.Column="3" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="4" />
        </Button>

        <Button Grid.Column="4" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="5" />
        </Button>

        <Button Grid.Row="1" Style="{StaticResource FeedbackButton}">
            <TextBlock Text="5" />
        </Button>

        <Button
            Grid.Row="1"
            Grid.Column="1"
            Style="{StaticResource FeedbackButton}">
            <TextBlock Text="6" />
        </Button>

        <Button
            Grid.Row="1"
            Grid.Column="2"
            Style="{StaticResource FeedbackButton}">
            <TextBlock Text="7" />
        </Button>

        <Button
            Grid.Row="1"
            Grid.Column="3"
            Style="{StaticResource FeedbackButton}">
            <TextBlock Text="8" />
        </Button>

        <Button
            Grid.Row="1"
            Grid.Column="4"
            Style="{StaticResource FeedbackButton}">
            <TextBlock Text="9" />
        </Button>
    </Grid>
</Page>
brswan commented 1 year ago

@dr1rrb I did some more testing and updated the code. On my linux arm64 box I was able to get the button state stuck. I ended up spawning off some threads to put load on the CPU as this typically happens when under higher CPU usage.

expand for code ``` #2D2E35 #363539 ``` ``` using App1.ViewModels; using Microsoft.UI.Input; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Navigation; using SPECSCommon.NetStandardLib.ViewModels; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.WindowsRuntime; using System.Threading; using System.Threading.Tasks; using System.Windows.Input; using Uno.Extensions; using Uno.Logging; using Windows.Foundation; using Windows.Foundation.Collections; // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 namespace App1 { public partial class KeyboardButton : Button { public string PrimaryButtonText { get { return (string)GetValue(PrimaryButtonTextProperty); } set { SetValue(PrimaryButtonTextProperty, value); } } // Using a DependencyProperty as the backing store for PrimaryButtonText. This enables animation, styling, binding, etc... public static readonly DependencyProperty PrimaryButtonTextProperty = DependencyProperty.Register("PrimaryButtonText", typeof(string), typeof(KeyboardButton), new Microsoft.UI.Xaml.FrameworkPropertyMetadata("")); public string SecondaryButtonText { get { return (string)GetValue(SecondaryButtonTextProperty); } set { SetValue(SecondaryButtonTextProperty, value); } } // Using a DependencyProperty as the backing store for SecondaryButtonText. This enables animation, styling, binding, etc... public static readonly DependencyProperty SecondaryButtonTextProperty = DependencyProperty.Register("SecondaryButtonText", typeof(string), typeof(KeyboardButton), new Microsoft.UI.Xaml.FrameworkPropertyMetadata("")); public bool IsCapital { get { return (bool)GetValue(IsCapitalProperty); } set { SetValue(IsCapitalProperty, value); } } // Using a DependencyProperty as the backing store for IsCapital. This enables animation, styling, binding, etc... public static readonly DependencyProperty IsCapitalProperty = DependencyProperty.Register("IsCapital", typeof(bool), typeof(KeyboardButton), new Microsoft.UI.Xaml.FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Default, OnIsCapitalChanged)); private static void OnIsCapitalChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { if (dependencyObject is KeyboardButton keyboardButton) { keyboardButton.IsCapitalUpdated(); } } public IconElement PrimaryIcon { get { return (IconElement)GetValue(PrimaryIconProperty); } set { SetValue(PrimaryIconProperty, value); } } public static DependencyProperty PrimaryIconProperty { get; } = DependencyProperty.Register("PrimaryIcon", typeof(IconElement), typeof(KeyboardButton), new FrameworkPropertyMetadata((object)null)); public IconElement SecondaryIcon { get { return (IconElement)GetValue(SecondaryIconProperty); } set { SetValue(SecondaryIconProperty, value); } } public static DependencyProperty SecondaryIconProperty { get; } = DependencyProperty.Register("SecondaryIcon", typeof(IconElement), typeof(KeyboardButton), new FrameworkPropertyMetadata((object)null)); private bool HasSecondary() { return !string.IsNullOrEmpty(SecondaryButtonText); } private void SwapPrimarySecondaryText() { string primaryTemp = PrimaryButtonText; PrimaryButtonText = SecondaryButtonText; SecondaryButtonText = primaryTemp; } private void IsCapitalUpdated() { if (!string.IsNullOrEmpty(PrimaryButtonText)) { PrimaryButtonText = IsCapital ? PrimaryButtonText.ToUpper() : PrimaryButtonText.ToLower(); } if (CommandParameter != null) { CommandParameter = IsCapital ? CommandParameter.ToString().ToUpper() : CommandParameter.ToString().ToLower(); } } } [System.ComponentModel.Bindable(true)] public abstract class ViewModelBase : INotifyPropertyChanged { private ConcurrentDictionary m_PropertyValueMap; private ConcurrentDictionary m_OnceLookup; public event PropertyChangedEventHandler PropertyChanged; public ViewModelBase() { m_PropertyValueMap = new ConcurrentDictionary(); m_OnceLookup = new ConcurrentDictionary(); } public static string GetPropertyName(Expression> expression) { if (expression == null) throw new ArgumentNullException("expression"); Expression body = expression.Body; MemberExpression memberExpression = body as MemberExpression; if (memberExpression == null) { memberExpression = (MemberExpression)((UnaryExpression)body).Operand; } return memberExpression.Member.Name; } public void OnPropertyChanged([CallerMemberName] string propertyName = "") { FirePropertyChanged(propertyName); } protected T Once(Func e, [CallerMemberName] string propertyName = "") { if (m_OnceLookup.TryGetValue(propertyName, out object val)) { return (T)val; } else { return (T)(m_OnceLookup[propertyName] = e.Invoke()); } } //[Obsolete] public void OnPropertyChanged(Expression> expression) { string propertyName = GetPropertyName(expression); FirePropertyChanged(propertyName); } protected virtual T Get([CallerMemberName] string propertyName = "", T defaultValue = default(T)) { if (m_PropertyValueMap.TryGetValue(propertyName, out object value)) { return (T)value; } return defaultValue; } protected virtual bool Set(T value, [CallerMemberName] string propertyName = "") { if (SetPropertyValue(value, propertyName)) { return true; } return false; } protected virtual void FirePropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } private bool SetPropertyValue(T value, string propertyName) { if (m_PropertyValueMap.TryGetValue(propertyName, out object oldValue)) { if (oldValue != null && oldValue.Equals(value)) { return false; } } m_PropertyValueMap[propertyName] = value; FirePropertyChanged(propertyName); return true; } } public class ButtonStuckViewModel : ViewModelBase { private const int MAX_TEXT_LENGTH = 25; public string OnScreenText { get => Get(); set => Set(value); } public ICommand KeyPressCommand { get; private set; } public ButtonStuckViewModel() { OnScreenText = ""; KeyPressCommand = new Command((o) => { Console.WriteLine($"Key pressed: {o}"); if (o == null) { return; } string key = o.ToString(); switch (key.ToLower()) { case "bkspc": { OnScreenText = OnScreenText.Substring(0, Math.Max(OnScreenText.Length - 1, 0)); break; } case "shift": { //IsCapital = !IsCapital; break; } case "clear": { OnScreenText = ""; break; } default: { if (OnScreenText.Length < MAX_TEXT_LENGTH) { OnScreenText = OnScreenText += key; } } break; } }); } } /// /// An empty page that can be used on its own or navigated to within a Frame. /// public sealed partial class ButtonStateStuckPage : Page { public ButtonStateStuckPage() { this.InitializeComponent(); this.DataContext = new ButtonStuckViewModel(); Task.Run(async () => { int taskCounter = 0; while (true) { _ = Task.Run(async () => { Console.WriteLine($"Task {++taskCounter} started"); int counter = 0; for (int i = 0; i < 10000; i++) { Console.WriteLine(10000 * 9999 / 60); await Task.Delay(100); } }); await Task.Delay(100); } }); } } } ```

button-stuck

brswan commented 1 year ago

output2 (1)

dr1rrb commented 1 year ago

output2 (1)

@brswan On this video, the text is not being updated on screen. Is it expected or it's because buttons are no longer working once the 4 key is stuck in press / over state ? (Note: I think that actually it's the "over" state that remain active, not the "pressed" state)

dr1rrb commented 1 year ago

@brswan On this video, the text is not being updated on screen. Is it expected or it's because buttons are no longer working once the 4 key is stuck in press / over state ? (Note: I think that actually it's the "over" state that remain active, not the "pressed" state)

Ok just looked at your code

if (OnScreenText.Length < MAX_TEXT_LENGTH)
{
    OnScreenText = OnScreenText += key;
}

so it's probably just because you reached the MAX_TEXT_LENGTH ^^

brswan commented 1 year ago

@brswan On this video, the text is not being updated on screen. Is it expected or it's because buttons are no longer working once the 4 key is stuck in press / over state ? (Note: I think that actually it's the "over" state that remain active, not the "pressed" state)

Ok just looked at your code

if (OnScreenText.Length < MAX_TEXT_LENGTH)
{
    OnScreenText = OnScreenText += key;
}

so it's probably just because you reached the MAX_TEXT_LENGTH ^^

Correct - I have a max length in there. The buttons are still working.

The main point, as you noted, is that the press or over state gets stuck at random times. I believe this may have something to do with Software rendering when the CPU has a high utilization.

I realize this is a difficult bug as it can be very hard to replicate. Please let me know if you need anything else.

dr1rrb commented 1 year ago

Hi @brswan I tried again on another device, but unfortunately I'm still unable to repro:

https://user-images.githubusercontent.com/8635919/225752200-80a54bdd-4513-4602-b618-817a465c5311.MOV

Are you able to enable trace logging on the Uno.UI.Xaml.Core.InputManager.PointerManager? (cf. https://platform.uno/docs/articles/logging.html#configuring-logging)

(We are looking for message like "CoreWindow_Pointer***" cf. here)

Logging
brswan commented 1 year ago

@dr1rrb Thanks for trying again.

I was able to get the button to get stuck again, but it didn't appear to log. Can you verify I have the logging set properly?

I am building for Debug Linux arm64 I am writing out a log message to enure trace if configured properly and I do see it in the output:

if (this.Log().IsEnabled(LogLevel.Trace))
{
    this.Log().Trace($"Trace level is enabled.");
}

Mar 17 12:37:06 Sk[89405]: Unable to load sb_up_arrow from the cursor theme Mar 17 12:37:14 Skia.Gtk[89405]: trce: App1.ButtonStateStuckPage[0] Mar 17 12:37:14 Skia.Gtk[89405]: Trace level is enabled.

using App1.ViewModels;
using App1.Views;
using Microsoft.Extensions.Logging;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
using Serilog;
using System;
using System.Diagnostics;
using System.Text;
using Uno.Extensions;
using Uno.Logging;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.ViewManagement;

namespace App1
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    public sealed partial class App : Application
    {
        private Window _window;

        public static MainViewModel MainViewModel { get; set; }

        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            //#if DEBUG
            InitializeLogging();
            //#endif
            this.InitializeComponent();
            Uno.UI.ApplicationHelper.RequestedCustomTheme = "Dark";
#if HAS_UNO || NETFX_CORE
            this.Suspending += OnSuspending;
#endif

            //Log.Logger = new LoggerConfiguration()
            //   .MinimumLevel.Debug()
            //   .WriteTo.Console()
            //   .WriteTo.File("logs/myapp.txt", rollingInterval: RollingInterval.Day)
            //   .CreateLogger();

            //Log.Information("Started...");

            //this.UnhandledException += (o, e) =>
            //{
            //    Log.Error(e.Exception, $"Unhandled exception caught {e.Message}, {e.Exception.StackTrace}");
            //};
        }

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="args">Details about the launch request and process.</param>
        protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

#if NET6_0_OR_GREATER && WINDOWS && !HAS_UNO
            _window = new Window();
            _window.Activate();
#else
            _window = Microsoft.UI.Xaml.Window.Current;
#endif

            var rootFrame = _window.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (args.UWPLaunchActivatedEventArgs.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                _window.Content = rootFrame;
            }

#if !(NET6_0_OR_GREATER && WINDOWS)
            if (args.UWPLaunchActivatedEventArgs.PrelaunchActivated == false)
#endif
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(ButtonStateStuckPage), args.Arguments);
                }
                // Ensure the current window is active
                _window.Activate();
            }
        }

        /// <summary>
        /// Invoked when Navigation to a certain page fails
        /// </summary>
        /// <param name="sender">The Frame which failed navigation</param>
        /// <param name="e">Details about the navigation failure</param>
        private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}");
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }

        /// <summary>
        /// Configures global Uno Platform logging
        /// </summary>
        private static void InitializeLogging()
        {
            // Logging is disabled by default for release builds, as it incurs a significant
            // initialization cost from Microsoft.Extensions.Logging setup. If startup performance
            // is a concern for your application, keep this disabled. If you're running on web or
            // desktop targets, you can use url or command line parameters to enable it.
            //
            // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html

            var factory = LoggerFactory.Create(builder =>
            {
#if __WASM__
                builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider());
#elif __IOS__
                builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider());
#elif NETFX_CORE
                builder.AddDebug();
#else
                builder.AddConsole();
#endif

                // Exclude logs below this level
                builder.SetMinimumLevel(LogLevel.Trace);

                // Default filters for Uno Platform namespaces
                builder.AddFilter("Uno", LogLevel.Warning);
                builder.AddFilter("Windows", LogLevel.Warning);
                builder.AddFilter("Microsoft", LogLevel.Warning);

                // Generic Xaml events
                // builder.AddFilter("Windows.UI.Xaml", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.VisualStateGroup", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.StateTriggerBase", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.UIElement", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.FrameworkElement", LogLevel.Trace );

                // Layouter specific messages
                // builder.AddFilter("Windows.UI.Xaml.Controls", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.Controls.Layouter", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.Controls.Panel", LogLevel.Debug );

                // builder.AddFilter("Windows.Storage", LogLevel.Debug );

                // Binding related messages
                // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug );
                // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug );

                // Binder memory references tracking
                // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug );

                // RemoteControl and HotReload related
                // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information);

                // Debug JS interop
                // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug );
            });

            global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory;

#if HAS_UNO
            global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize();
#endif
        }
    }
}
brswan commented 1 year ago

@dr1rrb Hi David, I just wanted to follow back up with you to ensure I have the logging set properly in my comment above. I did not see any console logging when running this.

dr1rrb commented 1 year ago

Hey @brswan I think you just need to add the line below to enable the trace level for the right namespace by adding in the InitializeLogging method:

builder.AddFilter("Uno.UI.Xaml.Core.InputManager", LogLevel.Trace );
brswan commented 1 year ago

@dr1rrb I have two logs. This is the first from the same test app code I've shared. The next comment will be with my actual app. I currently have the actual app with the buttons in a pressed state no matter what.

erPressed [RootVisual-00B35B38 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [KeyboardButton-01781780 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-037828AF Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [RootVisual-00B35B38 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [RootVisual-00B35B38 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037828AF Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [KeyboardButton-00C376CD Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-00C376CD Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-00C376CD Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-0326740C Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0326740C Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02FDF917 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [KeyboardButton-00974E1F Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-00974E1F Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-00974E1F Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-0326740C Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0326740C Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0326740C Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-037B1F72 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02D9C0F2 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02D9C0F2 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02D9C0F2 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02D9C0F2 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02D9C0F2 Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:36 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02A193CE Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02A193CE Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02A193CE Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [TextBlock-00EEFCD1 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [TextBlock-00EEFCD1 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02A193CE Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02A193CE Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [RootVisual-00B35B38 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [RootVisual-00B35B38 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [TextBlock-00EEFCD1 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-01EFD4F8 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-01E09E3B Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-01EFD4F8 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-01E09E3B Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-01E09E3B Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-01E09E3B Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-01E09E3B Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-0101D857 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-0101D857 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0101D857 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02074447 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02074447 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0101D857 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0101D857 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02074447 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02074447 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-01FE8DE1 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-01FE8DE1 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [RootVisual-00B35B38 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-02074447 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [RootVisual-00B35B38 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [RootVisual-00B35B38 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-03FCB171 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-03FCB171 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-03FCB171 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-0002ACBD Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0002ACBD Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-03FCB171 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-0002ACBD Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [MainGrid-0002ACBD Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerMoved [KeyboardButton-0291263E Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-0291263E Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [KeyboardButton-0291263E Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-00509557 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-00509557 Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:37 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-00509557 Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-00509557 Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-00509557 Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:15:38 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0

Waited and press the stuck button once

Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02074447 Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerEntered [MainGrid-02074447 Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02074447 Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02074447 Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [MainGrid-02074447 Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:20:27 app-device appdevice.Skia.Gtk[476]: CoreWindow_PointerPressed [Frame-00BFDCE0

Appears that Frame-008BFDCE0 is the Button that gets stuck

brswan commented 1 year ago

I was able to get 2 buttons stuck on my actual app (4 and R):

Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Grid-030CF7BB Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Grid-030CF7BB Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Grid-030CF7BB Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Grid-030CF7BB Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Grid-030CF7BB Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:44 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:45 app-device appdevice.Skia.Gtk[655]: fail: Microsoft.UI.Xaml.Controls.ScrollContentPresenter[0] Mar 22 11:33:45 app-device appdevice.Skia.Gtk[655]: The member float ZoomFactor is not implemented. For more information, visit https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.Controls.ScrollContentPresenter.float%20ZoomFactor Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Root-000113E4 Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Root-000113E4 Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Root-000113E4 Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Root-000113E4 Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Root-000113E4 Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:54 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-011C9B5C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-011C9B5C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-011C9B5C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-011C9B5C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-011C9B5C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Border-009E44BE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [Border-009E44BE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Border-009E44BE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-0080650C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0080650C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Border-009E44BE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0080650C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [TextBlock-02F73527 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-02F73527 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0080650C Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-02F73527 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-02F73527 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-0295238E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-0295238E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0295238E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-004487CE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-004487CE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0295238E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-0295238E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [TextBlock-00F3E9B8 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-00F3E9B8 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-004487CE Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-00F3E9B8 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-025A521E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-025A521E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-025A521E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-03E4FA66 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-03E4FA66 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerMoved [MainGrid-03E4FA66 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-03E4FA66 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-03E4FA66 Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-025A521E Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:33:55 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D

After getting stuck, selecting the buttons individually that got stuck

Selecting button 4 Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [TextBlock-0207A58B Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [TextBlock-0207A58B Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-0207A58B Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [TextBlock-0207A58B Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:41:34 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D

The above log was after selecting button 4 - note that button 4 still remained in a Pressed statement

Selecting button R Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-011C9B5C Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerEntered [MainGrid-011C9B5C Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-011C9B5C Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [MainGrid-011C9B5C Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: trce: Uno.UI.Xaml.Core.InputManager+PointerManager[0] Mar 22 11:42:53 app-device appdevice.Skia.Gtk[655]: CoreWindow_PointerPressed [Frame-012A388D

The above log was after selecting button 4 - note that button R still remained in a Pressed statement

brswan commented 1 year ago

@dr1rrb I don't see anything that sticks out as an issue. Is there a way to also log the pointer up and other events?

jeromelaban commented 1 year ago

@brswan could you also add those two in your logging configuration:

builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug );
builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug );

Try posting as .txt files, as the log will get bigger.

brswan commented 1 year ago

@jeromelaban @dr1rrb Thanks for the tip on adding more info the log. Attached is the log file with the updates. 2023.03.22-0958-button-stuck-logs.txt

Line 1057 is the last line before I saw the button stuck state One thing I notice is that occasionally the TextBlock will register a pressed state event. I am wondering if the nested controls in the Control Template could be causing conflicting Press States. Perhaps setting IsHitTestVisible on the nested controls would alleviate this?

brswan commented 1 year ago

@jeromelaban @dr1rrb Setting IsHitTest Visible didn't seem to help. Do you know if there is a way to get the actual name of the control being interacted with to be logged? The current log is: Go to state [CommonStates/Normal] on [App1.KeyboardButton]. It would be helpful to get the control's name logged as well. I tried adding the x:Name attribute and it did not appear to log.

dr1rrb commented 1 year ago

Unfortunately no I'm not able to find any relevant log that would dump the element name. However you have something like "TextBlock-00F3E9B8" the "00F3E9B8" is .GetHashCode().ToString("X8"), so you can dump in your page init the hashcode with the name o we can match.

Unfortunately looking at your logs, I realized that they are not making any sense, and indeed: https://github.com/unoplatform/uno/pull/11771 :/ So please could send us new logs with packages updated? (once this PR has been merged and package published.)

Another option, if you are willing to, would be to re-compile uno with this line un-commented https://github.com/unoplatform/uno/blob/927a09f70d90f6fb1c9f03a3b77f5577d57240fe/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs#L1 and use it in your app (cf. Debugging Uno in another application) ... it will dump AT LOT of logs (with control names).

brswan commented 1 year ago

Unfortunately no I'm not able to find any relevant log that would dump the element name. However you have something like "TextBlock-00F3E9B8" the "00F3E9B8" is .GetHashCode().ToString("X8"), so you can dump in your page init the hashcode with the name o we can match.

Unfortunately looking at your logs, I realized that they are not making any sense, and indeed: #11771 :/ So please could send us new logs with packages updated? (once this PR has been merged and package published.)

Another option, if you are willing to, would be to re-compile uno with this line un-commented

https://github.com/unoplatform/uno/blob/927a09f70d90f6fb1c9f03a3b77f5577d57240fe/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs#L1

and use it in your app (cf. Debugging Uno in another application) ... it will dump AT LOT of logs (with control names).

I'll see if I can compile the source but it may be some time before I can get to it. I will definitely update to the latest once you have merged #11771

brswan commented 1 year ago

@dr1rrb Hi David - was this ever merged into the main branch? If so, what version should I look for in nuget? Thank you.

jeromelaban commented 1 year ago

@brswan it will be in 4.9.0-dev.763 and later (it's still building).

brswan commented 1 year ago

@jeromelaban Thank you so much! I wasn't able to figure out how to tell where it would end up. I appreciate it.

dr1rrb commented 1 year ago

Hey @brswan were you able to confirm if your issue was fixed?

brswan commented 1 year ago

@dr1rrb David - I haven't been able to build from source. Is there a Nuget package of 4.9.0-dev.763?

jeromelaban commented 1 year ago

You can use 4.9.0-dev.834, or any later build.

MartinZikmund commented 1 year ago

@brswan Did you have a chance to validate this has been fixed please?

brswan commented 1 year ago

@brswan Did you have a chance to validate this has been fixed please?

I haven't seen this happen with the latest release. I'm good with closing this. Thanks for your assistance.

jeromelaban commented 1 year ago

Thanks for the update and testing!