-
Notifications
You must be signed in to change notification settings - Fork 49
Activate each tool window. #522
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
Conversation
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.
Is this for Photoshop integration ?
Just tested in other DCCs (Houdini, Maya, Nuke) and everything is fine. :)
Nice work !
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.
Looks good to me. I recall reading somewhere this doesn't work on all OS platforms. Could be wrong but might something you want to check up on. It won't error but just wouldn't give the expected results.
For example here it describes using .raise() on Mac OS X.
|
Roy is right, raising a window is a big mess cross-platform with Qt. Here's what QML does. Each of those are necessary, in that order, to cover all edge cases and platforms. Though I've still heard some having issues with it appearing behind another window? It's been rare though, but took a while to figure out. |
Yes, this is in particular for the Photoshop integration where the python process runs in the background, so the windows get hidden behind the Photoshop window.
I cant test on OSX but adding the call does hurt anything.
Using Will update the PR in a bit. |
- When in standalone add WindowStaysOnTopHint. - For MacOS "raise_()".
|
The latest commit made it so that the Windows always stay on top of all Windows when standalone right? So even over other applications. I'm expecting we wouldn't want that. Correct? |
It only stays ontop of the windows within the QApplication, so not other OS windows. |
If that's the case then it's fine with me. But are you sure? I quickly tried on a random Qt application window that I had running in Houdini and with that flag set it would never go behind other applications. As such it was always on top in front of my Browser, Windows Explorer, everything. (except for Windows Task Manager, it would appear behind that one - until I disabled "Options > Always on Top" for Task Manager) E.g. this always stays on top: # assumes a running QApplication instance
from PySide2 import QtWidgets, QtCore
class Window(QtWidgets.QDialog):
def __init__(self, parent=None):
super(Window, self).__init__(parent=parent)
self.setWindowFlags(
self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint
)
window = Window()
window.show() |
The flag is only added when we use the tools standalone, so Maya/Nuke/Houdini would not be affected. In standalone (Photoshop) I get this behaviour: |
That is odd. That is not at all what I'm seeing in my standalone runs. I wonder where the behavior differs. I pulled your branch into my repository to give it a go and ran a standalone Loader from the Launcher. It stays on top of everything... then I run it again, suddenly it's allowed to go behind. Then I run it again, and it's the opposite. It seems a bit random. It seems whenever I run that application and do nothing as a user in-between so it comes in with focus... then suddenly it will always stay on top of everything. If however I shift focus and continue in another browser for example during the launch of the application then suddenly the Show on Top behavior does not happen? @tokejepsen can you reproduce this? |
I cant reproduce the oddness, but can reproduce the always ontop issue. I can just remove the flag setting? |
👍 I think there's reason why @mottosso did this for Pyblish QML too so it could be worth actually doing that too if it's there with good reason. Or maybe it's redundant by now, no idea. |
|
Tiling window manager anyone? Who needs floating windows, they are so 90's. 😛 😬 |
|
How do we feel about this PR? |
|
Just looked through the commits and comments, I think this is good to merge. |
…ate_window # Conflicts: # avalon/tools/contextmanager/app.py
|
Apart from the errors with coveralls, this is ready to be merged now. |


What's changed?
Added an
window.activateWindowto each tool.When running the tools standalone triggered from a different window, the tools can get hidden behind the triggering window. This will bring them to the front of the user attention.