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

Dock floated tool window cant be docked #319

Closed
KrzysztofDusko opened this issue Mar 3, 2024 · 8 comments · Fixed by #327
Closed

Dock floated tool window cant be docked #319

KrzysztofDusko opened this issue Mar 3, 2024 · 8 comments · Fixed by #327

Comments

@KrzysztofDusko
Copy link

Hi.
On current master (11.1.999-cibuild0045533-beta) floated tool window cannot be docked.

11.0.9
image

11.1.999-cibuild0045533-beta
no drop indicator is visible.
image

11.1.999-cibuild0045533-beta is prerelase but maybe this will be hapefull for you.

PS Thanks for so great project !

@KrzysztofDusko KrzysztofDusko changed the title Dock floated tool windows Dock floated tool window cant be docked Mar 3, 2024
@wieslawsoltes
Copy link
Owner

I do not use yet 11.1 betas and those contain breaking changes. Do either you can fix yourself them or wait for official release. The other question is why it got broken and maybe it's just Avalonia bugs.

@KrzysztofDusko
Copy link
Author

Thanks for answer. I will try investigate this myself ( its bug or behavior change planed with 11.1). With newest Official everything works fine.

@KrzysztofDusko
Copy link
Author

KrzysztofDusko commented Mar 4, 2024

last version with proper behavior is 11.1.999-cibuild0043540-beta
11.1.999-cibuild0043576-beta is first version of Avalonia with "bug"
this commit
AvaloniaUI/Avalonia@36e7ab5

or this? AvaloniaUI/Avalonia@9708426

@wieslawsoltes
Copy link
Owner

Yeah that looks like it might broke the drag ☹️

@KrzysztofDusko
Copy link
Author

KrzysztofDusko commented Mar 4, 2024

i checked and AvaloniaUI/Avalonia@36e7ab5 is causing this issue..
-> this code works fine

                if (e.Pointer.IsPrimary)
                {
                    // SendMessage's return value is dependent on the message send.  WM_SYSCOMMAND
                    // and WM_LBUTTONUP return value just signify whether the WndProc handled the
                    // message or not, so they are not interesting
                    SendMessage(_hwnd, (int)WindowsMessage.WM_SYSCOMMAND, (IntPtr)SC_MOUSEMOVE, IntPtr.Zero);
                    SendMessage(_hwnd, (int)WindowsMessage.WM_LBUTTONUP, IntPtr.Zero, IntPtr.Zero);
                }
                else
                {
                    throw new InvalidOperationException("BeginMoveDrag Failed");
                }

but Dispatcher.UIThread.Post introduced by this commit causing problem....

@KrzysztofDusko
Copy link
Author

...And from Dock perpective:

BeginMoveDrag(e);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
EndDrag(e);
}

BeginMoveDrag with new (dispatcher) implemetation immediatly returns and this fires on windows platforms EndDrag(e). Old BeginMoveDrag...

@KrzysztofDusko
Copy link
Author

FYI ->
AvaloniaUI/Avalonia#14891

@BAndysc
Copy link
Contributor

BAndysc commented Mar 10, 2024

I don't think EndDrag was needed there at all: #327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants