question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window with ExtendClientAreaToDecorationsHint="True" cannot be moved in 0.10.5

See original GitHub issue

Describe the bug In version 0.10.3 moving window with flag ExtendClientAreaToDecorationsHint = “True” worked fine. I also checked version 0.10.4 and there it works too. After upgrading package to version 0.10.5 window is stuck in place and cannot be moved.

To Reproduce

  1. Create avalonia project (mine is creating in vesrion 0.10.3 by default and im and creating MVVM template).
  2. Upgrade Avalonia packages to version 0.10.5 (Avalonia, Avalonia.Desktop, Avalonia.Diagnostics, Avalonia.ReactiveUI).
  3. In MainWindow.axaml add flag ExtendClientAreaToDecorationsHint="True" in Window tag. Xaml is looking like this
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="using:AvaloniaMoveTest.ViewModels"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="AvaloniaMoveTest.Views.MainWindow"
        Icon="/Assets/avalonia-logo.ico"
        Title="AvaloniaMoveTest"
	ExtendClientAreaToDecorationsHint="True">

    <Design.DataContext>
        <vm:MainWindowViewModel/>
    </Design.DataContext>

    <TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>

</Window>
  1. Build project and run.
  2. Window cannot be moved.

Expected behavior Should be possible to move window with mouse.

Desktop (please complete the following information):

  • OS: Window
  • Version: 20H2 (19042.985)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
KillyMXIcommented, Sep 2, 2022

I was also affected by the issue in 0.10.18. Adding margin to the root control helped to restore the draggable header.

Is it so by design now? Documentation should probably be updated to explain this caveat. How should I go about adding non-interactive elements to the header area without affecting the window draggability?

Update: Setting ExtendClientAreaChromeHints="PreferSystemChrome" on my Window as found there had no observable effect. Setting CanResize explicitly to any value has no observable effect.

Update 2: Using IsHitTestVisible allows to have controls in the header area without affecting the draggability.

2reactions
pikselcommented, Jun 6, 2021

Confirmed as fixed in 0.10.6, closeable?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot move window via top bar or resize window after ...
Click and drag the window using the top bar, notice it works normally · Go to settings to add account, click add account...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found