zenity icon indicating copy to clipboard operation
zenity copied to clipboard

Add AlwaysOnTop option for message dialogs on windows

Open eos175 opened this issue 1 year ago • 4 comments

Zenity dialog without AlwaysOnTop(true) image

Zenity dialog with AlwaysOnTop(true) image

eos175 avatar Jun 27 '24 04:06 eos175

I'm… not sure I want to add this.

This feature has no parallel in other OSes, and is generally somewhat frowned upon.

Have you tried Attach to ensure your dialog lives on top of another window?

I know I do have a few features that aren't cross platform, but usually their effect is subtle.

ncruces avatar Jun 27 '24 23:06 ncruces

That being the case, it should be active by default because in GNOME and macOS it shows even in full-screen mode.

Although it may be frowned upon, I was asked to do this for an app that runs in the background. The people who use it have many applications open, so they never saw the messages or saw them very late.

How would you do it with Attach?

eos175 avatar Jun 28 '24 01:06 eos175

No it most definitely should not be default.

MB_SYSTEMMODAL doesn't just bring a dialog forward, it keeps it on top of everything else, no matter what, preventing interaction with whatever is below. That's why it's frowned upon. I can add it, but it will be bad UX for your app. And it does not match behaviour of Linux or macOS.

Could you try MB_SETFOREGROUND instead? That might be a default, but I'd need to test more.

ncruces avatar Jun 28 '24 08:06 ncruces

You are right. MB_SYSTEMMODAL acts like a fatal error that blocks all other actions until it is addressed. I wasn't aware of this (Windows is not my OS).

On the other hand, MB_SETFOREGROUND also indicates an error, but it seems to be less severe. It brings the window to the foreground but still allows interaction with other applications.

eos175 avatar Jun 29 '24 00:06 eos175

Latest version always includes MB_SETFOREGROUND. Hopefully that's good enough, otherwise I'll reconsider. Hope you don't mind.

ncruces avatar Jul 04 '24 23:07 ncruces