H.NotifyIcon icon indicating copy to clipboard operation
H.NotifyIcon copied to clipboard

[WinUI3] ToolTipText doesn't work on Windows 11

Open peerlessDJ opened this issue 2 years ago • 10 comments

Describe the bug

<UserControl x:Class="xxx" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MultiMiracast" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:tb="using:H.NotifyIcon" mc:Ignorable="d">

<tb:TaskbarIcon
    x:Name="TrayIcon"
    ToolTipText="Test-ToolTip"
    NoLeftClickDelay="True"
    IconSource="/Assets/ShareHub.ico"
/>

Steps to reproduce the bug

No response

Expected behavior

mouse hover can display the tooltip

Screenshots

No response

NuGet package version

NotifyIcon.WinUI:2.0.108 Mircosoft.WindowsAppSDK:1.3.230502000 Miraosoft.Windows.SDK.BuildTools:10.0.22621.756

x64 net6.0-windows10.0.22621.0

Windows 11 build 22621.1702

Platform

WinUI

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

Other

WindowsAppSDK Type

Packaged

Manifest

true/PM PerMonitorV2, PerMonitor

Additional context

No response

peerlessDJ avatar May 24 '23 10:05 peerlessDJ

I think it is the same issue as this one

duyngle avatar May 24 '23 23:05 duyngle

I think it is the same issue as this one

<UserControl.Resources>
        <XamlUICommand
            x:Key="ShowHideWindowCommand"
            ExecuteRequested="ShowHideWindowCommand_ExecuteRequested"
            Label="Configuration" />
        <XamlUICommand
            x:Key="ExitApplicationCommand"
            ExecuteRequested="ExitApplicationCommand_ExecuteRequested"
            Label="Exit" />
        <MenuFlyout
            x:Key="TrayContextFlyout"
            AreOpenCloseAnimationsEnabled="False">
            <MenuFlyoutItem Command="{StaticResource ShowHideWindowCommand}" />
            <MenuFlyoutSeparator />
            <MenuFlyoutItem Command="{StaticResource ExitApplicationCommand}" />
        </MenuFlyout>
        <ToolTip x:Key="CustomToolTip">
            <StackPanel>
                <TextBlock Text="CustomToolTip" HorizontalAlignment="Center" />
            </StackPanel>
        </ToolTip>
    </UserControl.Resources>
    <tb:TaskbarIcon
        x:Name="TrayIcon"
        ToolTipText="Test-ToolTip"
        TrayToolTip="{StaticResource CustomToolTip}"
        ContextFlyout="{StaticResource TrayContextFlyout}"
        ContextMenuMode="PopupMenu"
        NoLeftClickDelay="True"
        IconSource="/Assets/Logo.ico">
    </tb:TaskbarIcon>

not fix this issue

peerlessDJ avatar May 25 '23 01:05 peerlessDJ

Same here, the tooltips doesn't work at all. I can see the new native tooltips showing without a text appear sometime. I think since windows 11 22h2 already have a new native fluent tooltips, it should use that instead.

anonymousbugmaker6 avatar Jun 15 '23 17:06 anonymousbugmaker6

Looks like v116 (or v115 ?) has fixed this bug.

JasonWei512 avatar Sep 07 '23 05:09 JasonWei512

Looks like v116 (or v115 ?) has fixed this bug.

Or another Windows update that fixed what was broken in the previous update

HavenDV avatar Sep 07 '23 05:09 HavenDV

Did some testing. On Windows 11 22621.2134:

  • Version ≤ 112 doesn't work
  • Version ≥ 113 works

JasonWei512 avatar Sep 07 '23 05:09 JasonWei512

Thanks for checking, then it's related to this commit - https://github.com/HavenDV/H.NotifyIcon/commit/e12eac8d90df1796e076d092504b63dc29a35231

HavenDV avatar Sep 07 '23 05:09 HavenDV

The WPF version (code inherited from hardcodet/wpf-notifyicon) used custom tooltips by default. Now the system ones will be used by default

HavenDV avatar Sep 07 '23 05:09 HavenDV

Awesome! Now the tooltips are appearing

anonymousbugmaker6 avatar Sep 08 '23 16:09 anonymousbugmaker6

Is this currently fixed? I'm on Windows 11 (10.0.22631.3447) and .NET 8, but the WPF version does not show custom tooltips. Only the pure text version (ToolTipText) is shown. Even the showcase examples do not show custom tooltips on my machine.

Shujee avatar Apr 17 '24 18:04 Shujee