Skip to content
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

Fix alt tab by not embedding blender window in qt #27

Closed
wants to merge 6 commits into from

Conversation

hannesdelbeke
Copy link
Collaborator

@hannesdelbeke hannesdelbeke commented Sep 15, 2022

this PR is the "final" PR that fixes the alt tab issues bqt caused, making blender absolutely useless.
without this IMO bqt is not production ready.

the alt tab issues happened when we wrapped blender in a qt window.
however, the main purpose of bqt is to support qt in blender.
this PR deliveres on that core promise, at the cost of removing wrapping the blender window.
this means that qt windows are not always on top.
but your qt app will work without requiring any special qt setup, and wont bug when alt tabbing.

an optional ENV variable let's you re-enable the window wrapping again. (which ofcourse re-introduces the alt tab bug)

it depends on previous PRs which should be merged in first.

@friedererdmann
Copy link
Collaborator

Hey Hannes, I'll try this PR locally, but maybe you can already answer: If the Blender window doesn't get wrapped in Qt, doesn't this create an issue with tool windows not staying attached/in the foreground of the Blender app?

@hannesdelbeke
Copy link
Collaborator Author

Hey Hannes, I'll try this PR locally, but maybe you can already answer: If the Blender window doesn't get wrapped in Qt, doesn't this create an issue with tool windows not staying attached/in the foreground of the Blender app?

indeed, as mentioned in the top post:

this means that qt windows are not always on top

But better to have a working blender, than a wrapped blender window that doesn't work

@hannesdelbeke
Copy link
Collaborator Author

adding the following enables you to hack your widget and always have it on top.
widget.setWindowFlags(QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint)

note that without the tool flag the widget doesn't show up when using WindowStaysOnTopHint, so both flags are needed

@hannesdelbeke hannesdelbeke changed the title Fix alt tab Fix alt tab by not embedding blender window in qt Sep 25, 2022
@hannesdelbeke
Copy link
Collaborator Author

this PR has been replaced by #32
however it might be worth adding part of this PR to let the user chose if they want to embed blender in a qt window or not

@hannesdelbeke hannesdelbeke added the enhancement New feature or request label Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants