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

Tool tips don't work when it's partly off the screen on X11 client #11179

Open
YohDeadfall opened this issue Apr 28, 2023 · 0 comments
Open

Tool tips don't work when it's partly off the screen on X11 client #11179

YohDeadfall opened this issue Apr 28, 2023 · 0 comments
Labels
area-x11 bug help-wanted A contribution from the community would be most welcome. os-linux

Comments

@YohDeadfall
Copy link
Contributor

YohDeadfall commented Apr 28, 2023

Describe the bug

If a tool tip is partly outside of the screen, then it doesn't appear o the user.

To Reproduce

Use the example application provided below and move the mouse over a gray rectangle. Another way to reproduce is to move the window close to the bottom of the screen.

Expected behavior

Tool tips must work in any case.

Desktop (please complete the following information):

  • OS: Linux (Arch) with GNOME
  • Version: Bleeding edge

Additional context

The issue happens due to a Leave event sent to Avalonia, so the tool tip actually shows, but then closes immediately. Can be reproduced on 0.10.19 and 11.0.0 Preview 6.

public class App : Application
{
    public override void OnFrameworkInitializationCompleted()
    {
        Styles.Add(new FluentTheme(new Uri("avares://ControlCatalog/Styles")));
        Styles.Add(new Style(s => s.OfType<ToolTip>()) { Setters = { new Setter { Property = ToolTip.ClipToBoundsProperty, Value = false } } });

        if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            desktop.MainWindow = new Window { Background = Brushes.White, Content = new Rectangle { Height = 16, Width = 16, Margin = new(16), VerticalAlignment = VerticalAlignment.Bottom, Fill = Brushes.Gray, [ToolTip.TipProperty] = "A few words here just to cause a line break." }};

        base.OnFrameworkInitializationCompleted();

        ToolTip.IsOpenProperty.Changed.Subscribe(c => Console.WriteLine($"{c.NewValue} {DateTime.UtcNow}"));
        InputManager!.PreProcess.Subscribe(e =>
        {
            if (e is RawPointerEventArgs p && p.Type is RawPointerEventType.LeaveWindow)
                Console.WriteLine($"{p.Type}");
        });
    }

    public static int Main(string[] args)
        => AppBuilder.Configure<App>().UsePlatformDetect().UseSkia().StartWithClassicDesktopLifetime(args);
}

Not maximized:

True 4/28/2023 5:17:03PM
False 4/28/2023 5:17:05PM
LeaveWindow

Maximized:

True 4/28/2023 5:17:13PM
LeaveWindow
False 4/28/2023 5:17:13PM
LeaveWindow
@YohDeadfall YohDeadfall changed the title Tool tips don't work for maximized windows using X11 client Tool tips don't work when it's partly off the screen on X11 client Apr 28, 2023
@maxkatz6 maxkatz6 added help-wanted A contribution from the community would be most welcome. area-x11 labels Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-x11 bug help-wanted A contribution from the community would be most welcome. os-linux
Projects
None yet
Development

No branches or pull requests

2 participants