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

Command Palette blinks the main Window? #1422

Open
seaspeak opened this issue Jun 4, 2024 · 7 comments
Open

Command Palette blinks the main Window? #1422

seaspeak opened this issue Jun 4, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@seaspeak
Copy link

seaspeak commented Jun 4, 2024

Problem to Solve

Before/After the Command Palette appears/closes, it seems to briefly cause the OneNote main window to disappear, revealing the background behind it. After a brief flicker, the main window returns and the Command Palette dialog is generated.

To Reproduce

Press Ctrl+Shift+P

Expected Behavior

Screenshots

Environment (if applicable)

Version 6.4.0 with OneNote 16.0.14332.20706

Additional Context

@seaspeak seaspeak added bug Something isn't working unread I have seen it or had time to refine it yet labels Jun 4, 2024
@jasonjac2
Copy link
Sponsor

I thought it was part of attempting to capture the keyboard ASAP. I have noticed it. Is it just annoying or actually causing you problems?

@stevencohn
Copy link
Owner

There is a funky interaction between the windows. Normally, you can set the parent window of a child window and Windows will handle the rest, ensuring the child is shown above the parent. But when setting the OneNote window as the parent, the child windows disappear, and the OneNote window is pushed behind all other windows on your desktop! So OneMore plays a few tricks to set-unset-set the z-order of its windows to ensure they're correctly on top. This sometimes causes things to flicker. If anyone has a cleaner way of doing it, I'd love to hear!

@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Jun 4, 2024
@stevencohn
Copy link
Owner

More info for those who think they know the answer LOL... The funky interaction is due to the fact that there is an interop layer in between OneNote and OneMore, via a COM surrogate process. So, the normal parent/child mechanisms don't really work here which is why OneMore takes extraordinary means to force its dialogs to be on top of the OneNote window.

@stevencohn stevencohn added the wontfix This will not be worked on label Jun 4, 2024
@seaspeak
Copy link
Author

seaspeak commented Jun 4, 2024

Why is Command Palette particularly noticeably annoying?

@stevencohn
Copy link
Owner

I probably need a slower machine :-) I maybe see it once during a session. And it's a very quick flash. Is it happening more often, or every time you open the Command Palette?

Repository owner deleted a comment from stevenmcohn Jun 4, 2024
@seaspeak
Copy link
Author

seaspeak commented Jun 4, 2024

I am using Intel 8th gen, got a plan to upgrade to 16th gen if everything goes well :-)

As you said, it is pushed to the bottom of all windows. But isn't the method it used different from SearchHashTags and PreviewMarkdown?

FlickerMoment

Screenshot

Animation

Video_2024-06-04_235437.mp4

@stevencohn stevencohn removed the wontfix This will not be worked on label Jun 4, 2024
@stevencohn
Copy link
Owner

I'll do some more digging. But to answer your question, no, the Hashtags dialog and the Markdown preview dialog all use different techniques due to their technical requirements.

  • The palette uses System.Window.Forms.Form.ShowDialog() to create a modal dialog.
  • Mardown preview is a wrapper of WebView which needs an STA context.
  • Hashtag uses MoreForm.RunModeless() to create a modeless dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants