Dialog() Needs System Model Option and/or Added to the start bar so it can be found
RE: https://copyq.readthedocs.io/en/latest/scripting-api.html#dialog
On Windows 11 and COPYQ 9.1.0
Sometime dialogs are slow to show and they go behind other windows, there is no way to find those. You may find them if you minimise each window but not if you minimise them all at once (WIN+D). Similar issue if a window opens on top of the copyq dialog. This is happening often enough to be really annoying, and to minimise the window popping on top I first have to close some of its dialogs.
As the dialog() title doesn't get added to the start bar you can't see it that way. It doesn't go into anywhere in copyq that I have seen.
What I'd like is an option to make the dialog system modal (on top) or an always on top option and/or an option to add the title to the start bar. Maybe an option to abort the script after a period on dialog inactivity also.
Can you check if new build fixes this? https://ci.appveyor.com/project/hluk/copyq/builds/51457867/artifacts
There are additional attributes you can set for the dialog():
- '.modal' - set to true to make the dialog modal (to avoid other windows to get input focus)
- '.onTop' - set to true for the dialog to stay above other windows
- '.noParent' - set to true to avoid attaching the dialog to the main window
For example: dialog(..., '.modal', true)
Not sure which combination of attributes would help.
Thanks for the code update.
- ".onTop" works for me, without any obvious side effects.
- ".modal" doesn't work so I assume it is application (not system) model (which should keep it above the main CopyQ dialog).
- ".noParent" doesn't seem to do much :-)
I tried combinations without any obvious effect.
Thanks for testing. Would the ".onTop" attribute work for you?
I've added few more attributes to modify the dialog window type: https://ci.appveyor.com/project/hluk/copyq/builds/51462901/artifacts
- '.popupWindow', '.sheetWindow', '.toolWindow', '.foreignWindow' - set/unset the type of dialog window (see Qt::WindowFlags for details)
Example: dialog(..., '.sheetWindow', false, '.popupWindow', true, '.foreignWindow', true)
I went to the QT page you mention, there modal can be made Windows or system modal, yours I'm guessing was application modal. System Model should work as well if not better if that was an option...
WindowModality { NonModal, WindowModal, ApplicationModal }
RE: Would the ".onTop" attribute work for you? Not sure what you are asking unless you misread my response where I said it it does work. So far I've had a minor feature that it may not maintain focus, but a system model dialog should.
But WindowModal means modal to the parent window only (if set). I'm not aware of any option in Qt that would allow setting a window to be modal in the system. But maybe I'm misunderstanding the problem.
RE: Would the ".onTop" attribute work for you? Not sure what you are asking unless you misread my response where I said it it does work. So far I've had a minor feature that it may not maintain focus, but a system model dialog should.
I mean, would implementing just the .onTop fix this issue for you?