-
Notifications
You must be signed in to change notification settings - Fork 46
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
Implemented eventFilter removal and improved Foster stability #297
Conversation
When foster mode is on, main thread often hanged on signal emission which triggered by window closing (after second reset). By running signal emission call directly instead of running in main thread could avoid the hanging.
When Foster mode is on, QML will not render properly with ninja-like window detach-attach on host with Qt4, this switch will avoid detach-attach in such host.
Here's my plugins Gist that used in tests. |
Stellar effort @davidlatwe! I've given this a go on Windows 10, Maya 2018 and all went well. There's some flickering in the window when it goes from being a child to its own window, but I can't see a way around that. I've added some docstrings, but was hoping you could fill in what "ninja" meant, here. |
This produces the same result, not sure if it helps. from pyblish_qml import show
show(foster=False) |
Also to confirm that the current master, and the master before merging the foster update, works in 2015. So there's something in this PR specifically causing it not to run. |
Thanks for quick spin @mottosso !
Yes, it's related to Qt version, but the reason it freeze was from the change in commit 7b3277c . |
pyblish_qml/ipc/server.py
Outdated
self.vessel.show() | ||
return self._dispatch("show", args=[settings or {}, | ||
self._winId, | ||
self.ninja]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spot, is the reason that make Maya 2015 and 16 freeze at startup.
ninja
is disabled if host running Qt4, and if ninja
is disabled, it need to call vessel.show
before _dispatch("show")
, or the window will not show up.
Okay, just tested on 2015, it should wok now :) I renamed the param If host's By default, the bool value of if not foster: # If Foster mode is not turned on, `foster_fixed` is False
return False
value = os.environ.get("PYBLISH_QML_FOSTER_FIXED", "").lower()
return value in ("true", "yes", "1") or QtCore.qVersion()[0] == "4"
If everything works well, this window flickering and the taskbar alert change to main window should be the last two trade off. :P One other buggy appearance was on CentOS, the window did not resize properly when it parent back to subprocess. But I am going to let it slide for now, will back to fix this one after a while. :) Does |
Works! Great work @davidlatwe. If you're ready, I'm happy to merge and release. Have you incremented the version too? |
Bump ! |
In this PR, should have:
foster
is on or not, usual window close or force quit, should remove evenFilter in the end.PYBLISH_QML_FOSTER_NINJA=True
orFalse
(Yes/No 1/0
)Here are some Foster mode running screen gif:
This is Maya 2018.0 on Windows
This is Maya 2015 on Windows
As you can see, it's really laggy.
This is Maya 2017 update 5 on CentOS 7 (Run in Hyper-V)
Foster mode works on CentOS !
One thing to be noticed is that, while in my first test on CentOS, I installed Maya 2017 and encountered an error says:
FosterVessel(QtWidgets.QDialog) has no attribute 'winId'
This is a bug, the error was gone after I installed the Maya 2017 update.
Now, I wouldn't say the Foster mode is 100% safe to use, but should at least stable as Fake child approach.
Any feedback are welcome :)
Thanks !