Skip to content

Dialog() Needs System Model Option and/or Added to the start bar so it can be found #2947

Closed

Description

@dbareis

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.

Activity

  1. added a commit that references this issue on Feb 5, 2025
    b901ef7
  2. hluk commented on Feb 5, 2025

    @hluk
    Owner

    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.

  3. dbareis commented on Feb 6, 2025

    @dbareis
    Author

    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.

  4. added a commit that references this issue on Feb 6, 2025
    210425f
  5. hluk commented on Feb 6, 2025

    @hluk
    Owner

    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)

  6. dbareis commented on Feb 11, 2025

    @dbareis
    Author

    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.

  7. hluk commented on Feb 11, 2025

    @hluk
    Owner

    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?

  8. added 2 commits that reference this issue on Sep 5, 2025
    0b82126
    b560e91
  9. added a commit that references this issue on Sep 5, 2025
    30c6363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions