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

Fix lost mouse clicks on inactive window (#1021) #1710

Merged
merged 3 commits into from Mar 29, 2020

Conversation

@greuelpirat
Copy link
Contributor

greuelpirat commented Mar 25, 2020

The click on the dialog is lost when window.Activate() is called. The clicks works normal when the call is removed or the window gets the focus with window.Focus()

@Keboo Keboo added this to the 3.1.0 milestone Mar 25, 2020
@greuelpirat

This comment has been minimized.

Copy link
Contributor Author

greuelpirat commented Mar 25, 2020

It seems that window.Focus() does not work. I think the better solution would be to give up the window.Activate() completely.

I removed the whole OnPreviewMouseDown since all it does is to activate the window.

Are there known issue for window.Activate() to be required?

@greuelpirat

This comment has been minimized.

Copy link
Contributor Author

greuelpirat commented Mar 25, 2020

I made some further tests without window.Activate():
click on Button in inactive SAMPLE 1 Dialog works
click on Button in inactive SAMPLE 3 Dialog works
click on TextField in inactive SAMPLE 3 Dialog does not work.

Do not merge this pull request. I need to make changes again.

@Keboo Keboo changed the title Fix lost mouse clicks on inactive window (#1021) WIP: Fix lost mouse clicks on inactive window (#1021) Mar 25, 2020
@Keboo

This comment has been minimized.

Copy link
Member

Keboo commented Mar 25, 2020

@greuelpirat no problem I added "WIP" (work in progress) to the title, simply remove it when you are done.

@greuelpirat

This comment has been minimized.

Copy link
Contributor Author

greuelpirat commented Mar 26, 2020

I looked deeper into it and found that the focus logic implemented with #232 was the problem. It prevented that the mouse event could proceed its logic. It was also a problem that when there are multiple DialogHost in a single window (like in the demo app) they could steal the focus each other.

I made some tests and it showed that window.Activate() is fully sufficient to handle the focus issues #232 and #1281.

@greuelpirat greuelpirat changed the title WIP: Fix lost mouse clicks on inactive window (#1021) Fix lost mouse clicks on inactive window (#1021) Mar 26, 2020
@Keboo

This comment has been minimized.

Copy link
Member

Keboo commented Mar 29, 2020

Great research and work. Thank you for the contribution.

@Keboo Keboo merged commit fff21fa into MaterialDesignInXAML:master Mar 29, 2020
1 check passed
1 check passed
MaterialDesignInXAML.MaterialDesignInXamlToolkit Build #20200326.1 succeeded
Details
@greuelpirat

This comment has been minimized.

Copy link
Contributor Author

greuelpirat commented Mar 29, 2020

@Keboo Thank you!

This was my first pull request and I missed to link it to the issue #1021. So the issue is still open. Would you close it? Thank you.

@Keboo

This comment has been minimized.

Copy link
Member

Keboo commented Mar 29, 2020

@greuelpirat I missed that links as well. Closed, thank you.

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.