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

Bug: Small API thing -- cycling docs with API does not also cycle to corresponding plugin #135

Open
ftolsson opened this issue Aug 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ftolsson
Copy link

Here's a small window layering issue which I'm quite sure used to be gone but has resurfaced:

In the editor window, using ctrl+Tab to cycle open (tabbed) documents will bring its corresponding plugin window to the front. Good and expected.

Previously, cycling tabs from within FTOutliner with Beat.nextTab() and Beat.previousTab() would do the same — but since some time back, this only cycles the document and not the plugin window (i.e. keeps focus in current plugin).

Related or not: If invoked when plugin is focused (hitting cmd+O etc) Beat dialogs like Open and Save will open behind the plugin window. Also, if crashing Beat when running from xCode, the dead plugin window lingers on top of everything obscuring the xCode controls, almost as if plugin Windows been set to uconditionally float on top?

That's all.

@ftolsson ftolsson added the bug Something isn't working label Aug 29, 2023
@lmparppei
Copy link
Owner

lmparppei commented Aug 29, 2023

I can't reproduce this with a fresh plugin. Are you sure you don't have any code that is related to plugin window focus in FTOutliner?

image image

@ftolsson
Copy link
Author

Hm. Not in conjunction with tab-switching... From the top of my mind, would using htmlWindow.focus() at some point make its layering stick? Anyway thanks, I'll have to investigate a bit to seee what else I might be doing differently.

@lmparppei
Copy link
Owner

From the top of my mind, would using htmlWindow.focus() at some point make its layering stick?

It absolutely could. Plugin window levels are set to normal when the host document isn't the main window anymore, otherwise they are floating windows (always on top), which also causes them to stay on top of Xcode when the app crashes or reaches a breakpoint. When a plugin window receives focus, it should make its host document the main window, but also changes its own level.

If you are focusing the HTML window at the wrong moment while also switching tabs, the window level might go out of sync. Try removing some of the .focus() calls and see how it affects window levels. If in any way.

@ftolsson
Copy link
Author

ftolsson commented Aug 29, 2023

Removed all instacnces of htmlWindow.focus()(one) but that didn't help much.

However -- I also now realize that I described the issue wrong.

When opening several tabs (in my case, five) the topmost plugin (i.e. the one belonging to the last opened tab) will stay on top when cycling -- except for some reason when cycling to tab # 2 which will correctly push its corresponding plugin to the top. For all others, it's the last opened one that floats up. Does that make (more/any/none) sense?

@lmparppei
Copy link
Owner

I think this is finally fixed in Beat 1.999.1.

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

2 participants