--- The context ---
I'm using Openbox to create a dedicated workspace/desktop for my browser -- the browser only opens on that workspace, and any other windows created on it get kicked onto a different workspace.
This works for most of my browsing, but with fullscreen-capable content such as streaming videos or Flash apps, switching to 'fullscreen mode' actually creates a new window for the content to play in... so Openbox kicks it off the dedicated workspace. Meaning, when I exit fullscreen mode I'm on my random clutter workspace instead of back in my browser.
I need to write an exception so Openbox lets the fullscreen content stay on the dedicated workspace.
--- The problem ---
I would like to use
xprop (or just
wmctrl -l) to get some info on the window that the fullscreen web content plays in, but the window automatically closes as soon as it loses focus (as far as I can tell) so I can't just switch to my terminal and do it manually. I need some way to log the info in the background. Ideally I'd like some kind of background monitor that logs the name of every window that gets opened.
Is there a relatively simple way to script this? I'm sure I could find a monitoring software package that could do this, but it seems like overkill for what I need.
EDIT to add answer:
Just using a timer (
sleep 10; xprop) as suggested by Gilles worked. For future reference the relevant line was
_OB_APP_CLASS(UTF8_STRING) = "Plugin-container"