Launching apps on Haiku | Haiku Project

Argument handling on Haiku

Hi, I’m Nephele. I’ve not made a blog post before, but this seemed like a good opportunity.


This is a companion discussion topic for the original entry at https://www.haiku-os.org/blog/nephele/2023-07-12_launching_apps_on_haiku
11 Likes

Hi, thank you @nephele for your post. Can you tell me more precise please, how the Screenshot app depends on this that Applications have to respond to messages? I mean, what happens if B_ARGV_ONLY is set and I’d like to take a Screenshot? Does it affect only screenshotting certain windows?

B_ARGV_ONLY is more like an “informative property” than a command, in that it tells others that app doesn´t accept messages.

My bet is that the Screenshot app sends a message to other apps for them to forward it an “image” of their windows. If the app doesn´t receive messages, it would never hear Screenshot asking

From looking at the source code (here), I can tell at least one use. If you run screenshot from the command line with the --window option, it will use messages to try to figure out which window of the application’s windows is active.

Hi thaflo,
The app_server (or ScreenShot?) queries the focused application window for it’s position and dimension. If for some reason the application does not respond ScreenShot does not have this information and does not have a cropped view. It will instead screenshot the entire desktop.

If B_ARGV_ONLY is set the BMessage will not be delivered as the OS ( i think launch_roster?) assumed that the application is unable to handle BMessages.

You can test this if you handle BMessages yourself for a window but do not forward unhandled messages up to the BApplicatiom class in the default case."

1 Like