stevencohn / OneMore

A OneNote add-in with simple, yet powerful and useful features
Mozilla Public License 2.0
2.65k stars 223 forks source link

Alt+F (Favourites) with multiple ON instances focuses on "random" ON window and hides fav box OM 6.6.0 #1652

Closed jasonjac2 closed 2 weeks ago

jasonjac2 commented 2 weeks ago

Thanks for the new release, I was doing some testing.

Problem to Solve

Only updated to 6.6 on one machine,. I have 4 instances of ON open - all on different pages I press Alt+F to bring up favourites (I can't remember if this is a custom keybinding or not, but it is the one I have always had) I can see the OM Fav's icon appear on teh taskbar. A different ON window gets focs, and in my case, obscures the original ON instance and the Fav's dialogue. If I click on the correct ON instance, the fav's dialogue appears.

it seems to do it if I select the fav's from the command Pallet as well.

OM 6.6.0

stevencohn commented 2 weeks ago

I do believe this is the same problem noted here. The OneNote Interop API internals select the wrong OneNote window

jasonjac2 commented 2 weeks ago

I really don't think so, i.e. they are all on different pages. That other problem occured when all instances were on the same page. Also, it is new to 6.6 and doesn't occur in 6.5.1 and previous.

I think I hit Alt+F more times a day than I breath in :-).

stevencohn commented 2 weeks ago

I'll double-check. But the actual problem, even with #1563 was that the API doesn't respect the currently active OneNote window. OneMore does nothing to try to refocus OneNote windows, but does try to set focus on its own dialogs, like the Favorites dialog. For some reason, Windows thinks a secondary OneNote window is active.

Remember that OneMore runs in a separate process. For security reasons, Windows doesn't allow one process to activate windows owned by another process. So the fact that a OneMore dialog is causing a window owned by another process to be activated is... strange.

jasonjac2 commented 2 weeks ago

I've just tried to record a little video of the differences in the two versions: On 6.5.1 you get a slight flicker and it looks like the in focus instance hides for a split second and then you get it back with the fav's in front. On 6.6 it is like it just jumps to the most recent item in the z order (like you would expect when you minimize the focused app) and then reappears either at the back or or at least 1 down in the Z order.

I know you made some changes between 6.5.1 and the latest to reduce flickering of the dialogues. Could have anything to do with it?

stevencohn commented 2 weeks ago

I stand corrected, 6.6.1 coming soon...