-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some dialogue windows are not floating in tiling window managers #392
Comments
I could not find in the documentation a list of what files are for dialog windows or anything along those lines, so I searched for instances of `self.setWindowModality` and as far as I'm seeing, it looks like that's all of them? In any case, all I did was add `self.setWindowFlags(Qt.Dialog)` to the init functions of every modal I found that calls setWindowModality, the files affected are: - add_field.py - file_extension.py - fix_dupes.py - fix_unlinked.py - folders_to_tags.py - mirror_entities.py - panel.py - progress.py Do let me know if I missed any or if some of these shouldn't be changed. This fix has not been tested on Wayland yet, but based on the assumption that Qt behaves the same on both display servers, it should work the same, as this is a very basic feature that both display servers should have. This fix is for [issue TagStudioDev#392](TagStudioDev#392)
Made the pull request #464 for this issue. |
Set the Qt.Dialog flag for modal windows, such as "Add Field" so that they will be seen as dialogs in the backend. This change is unlikely to be at all noticeable in systems like Windows, but for users running tiling window managers like bspwm or Sway, this will prevent these modal windows from being tiled alongside the main window, instead they will be floating on top, which is the expected behaviour seen on floating window managers, like the ones used by Windows and macOS. Added self.setWindowFlag(Qt.Dialog, on=True) # type: ignore to the following files: - tagstudio/src/qt/modals/add_field.py - tagstudio/src/qt/modals/delete_unlinked.py - tagstudio/src/qt/modals/drop_import.py - tagstudio/src/qt/modals/file_extension.py - tagstudio/src/qt/modals/fix_dupes.py - tagstudio/src/qt/modals/fix_unlinked.py - tagstudio/src/qt/modals/folders_to_tags.py - tagstudio/src/qt/modals/mirror_entities.py - tagstudio/src/qt/widgets/paged_panel/paged_panel.py - tagstudio/src/qt/widgets/panel.py - tagstudio/src/qt/widgets/progress.py Note that without adding # type: ignore, MyPy *will* give out an error, presumably because PySide6 is missing type hints for several things, and this may *or* may not be a justifiable use of # type: ignore, which throws the MyPy type checking for that line out the window. Ref: TagStudioDev#392, TagStudioDev#464
Checklist
TagStudio Version
Alpha v9.3.2
Operating System & Version
Linux Mint 21.3 x64 (5.15.0-118-generic kernel) + bspwm
Description
Windows that should be dialogs such as "Create tag" or "Add field" are not treated as such by Xorg based tiling window managers like bspwm or i3. Presumably the same problem would be seen on Wayland managers but I have not tested for that and I'm unfamiliar with Wayland protocols.
So far only seen in bspwm, but it should apply to any tiling window manager, at least on the Xorg side. My initial presumption for this is that Qt is not giving these windows the _NET_WM_WINDOW_TYPE_DIALOG indicated in the EWMH standard, and therefore the window manager isn't told to handle it any different from the main window.
I'm willing to attempt fixing this issue myself, but I'd need to be told the basics of how the UI is supposed to be laid out in the code and look into how Qt handles EWMH hints, it probably uses a separate data type entirely for such windows.
Expected Behavior
Dialogs are expected to spawn as a floating window on top of the main window with the size specified by the program as seen bellow. This screenshot was taken after manually setting the dialog to be floating since bspwm provides a way to do that.
Steps to Reproduce
The result should look something like this:
Logs
No response
The text was updated successfully, but these errors were encountered: