nuke does not pass parent widget for workfiles tool and tell it to change on top flag

This commit is contained in:
Jakub Trllo 2022-07-20 13:16:57 +02:00
parent 3fac738361
commit b128e98c8f
2 changed files with 15 additions and 5 deletions

View file

@ -2440,10 +2440,12 @@ def _launch_workfile_app():
if starting_up or closing_down:
return
from .pipeline import get_main_window
main_window = get_main_window()
host_tools.show_workfiles(parent=main_window)
# Make sure on top is enabled on first show so the window is not hidden
# under main nuke window
# - this happened on Centos 7 and it is because the focus of nuke
# changes to the main window after showing because of initialization
# which moves workfiles tool under it
host_tools.show_workfiles(parent=None, on_top=True)
def process_workfile_builder():

View file

@ -142,6 +142,14 @@ def uninstall():
_uninstall_menu()
def _show_workfiles():
# Make sure parent is not set
# - this makes Workfiles tool as separated window which
# avoid issues with reopening
# - it is possible to explicitly change on top flag of the tool
host_tools.show_workfiles(parent=None, on_top=False)
def _install_menu():
# uninstall original avalon menu
main_window = get_main_window()
@ -158,7 +166,7 @@ def _install_menu():
menu.addSeparator()
menu.addCommand(
"Work Files...",
lambda: host_tools.show_workfiles(parent=main_window)
_show_workfiles
)
menu.addSeparator()