My app's document window cannot be "activated"

My app opens its docs in 2 ways: 1) the usual way using File>Open, all works as expected. 2) the 2nd mechanism is very useful: I save URLs in the form of hot RTF text in other apps. Later I copy this text to the clipboard and press the ‘Find’ on my app’s Link Manager window that is a global floating window, and this triggers the anomaly.

If my app is frontmost and i click Find, all docs open normally. If however my app is in the background (the usual scenario if say the RTF links are saved in a TextEdit doc or Curio project), the docs open but remain “inactive”. By this I mean the windows are displayed, I can move them, resize them, but their titles remain gray instead of black. Clicking on a window’s title bar brings it to the front, ahead of other doc windows, but it remains inactive, title stays gray, and its Activate event never fires.

Eventually after multiple clicking, switching back forth to other apps, etc the doc windows get “unstuck” and resume normal behavior. I have never seen a document window remain inactive with its title bar grayed out after being clicked on. I don’t recall this happening in older versions of Xojo (currently on 2025 r1, macos sonoma).

So when resolving URLs I first have to app.FrontmostMBS then open the linked docs. Normally would not be an issue, except my docs are actually large images so I wanted to be clever and let my app do the loading in the background so i can do other work, then come to front after the last image loads. Now i can’t.

Anyone seen this? The strangest thing (and of course you can’t debug this because all the back and forth between myApp.debug and the IDE fires a bunch of artificial events that doesn’t allow this to happen).

I think this is an issue with macOS because I regularly get the Finder into this state.

Try activating your application right before opening the window. That should make everything happen in the correct order.

1 Like

Are you hiding windows?

In macOS there used to be a difference between calling Window.Show and setting Window.Visible=True You might try switching these up.

I would also try using Timer.CallLater to break up the steps a bit, perhaps app.FrontmostMBS first, and then Timer.CallLater to open (and/or show) the new window.

Which MacOS version ? I experience this on Sequoia 15.7.1 if I am right.

you may be right, macOS thing, because i also upgraded that along the way. So I ended up app.FrontmostMBS early as the only workaround. Window.Visible=True made no diff.

Yeah, I’m on Sequoia but it’s been happening for a while - possibly prior to Sequoia.