Skip to content

Commit

Permalink
Merge pull request #251 from HendrikMennen/fixlinuxtoolwindowdragging
Browse files Browse the repository at this point in the history
Fix HostWindow drag on linux/macos
  • Loading branch information
wieslawsoltes authored Nov 3, 2022
2 parents 2423ddd + 7100649 commit 1510363
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Dock.Avalonia/Controls/ToolChromeControl.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Metadata;
Expand Down Expand Up @@ -79,7 +80,8 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);

if (VisualRoot is HostWindow window)
//On linux we dont attach to the HostWindow because of inconsistent drag behaviour
if (VisualRoot is HostWindow window && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Grip = e.NameScope.Find<Control>("PART_Grip");
CloseButton = e.NameScope.Find<Button>("PART_CloseButton");
Expand Down

0 comments on commit 1510363

Please sign in to comment.