-
Notifications
You must be signed in to change notification settings - Fork 375
2.6 debug #1040
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
base: RB-2.6
Are you sure you want to change the base?
2.6 debug #1040
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,10 +18,10 @@ | |
| # ***** END LICENSE BLOCK ***** | ||
|
|
||
| set(Natron_SOURCES NatronApp_main.cpp) | ||
| if(WINDOWS) | ||
| list(APPEND Natron_SOURCES ../Natron.rc) | ||
| endif() | ||
| add_executable(Natron ${Natron_SOURCES}) | ||
| if(WIN32) | ||
| target_sources(Natron PRIVATE ../Natron.rc) | ||
| endif() | ||
| if(APPLE) | ||
| set_target_properties(Natron PROPERTIES | ||
| MACOSX_BUNDLE TRUE | ||
|
|
@@ -59,3 +59,40 @@ install(FILES ../Gui/Resources/Images/natronIcon256_linux.png | |
| DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps") | ||
| install(FILES ../Gui/Resources/Images/natronProjectIcon_linux.png | ||
| DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps") | ||
|
|
||
| IF(WIN32 AND DEPLOYQT_FOUND) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't force this, make it optional. |
||
| SET(CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/install_deps_${CMAKE_BUILD_TYPE}.cmake) | ||
|
|
||
| # Find and install needed DLLs | ||
| file(GENERATE OUTPUT | ||
| "${CONFIG_FILE}" CONTENT | ||
| [[ | ||
| EXECUTE_PROCESS(COMMAND del ${INSTALL_BINPATH}/*.dll) | ||
| SET(TARGET_APP $<TARGET_FILE:Natron>) | ||
| FILE(GET_RUNTIME_DEPENDENCIES | ||
| RESOLVED_DEPENDENCIES_VAR deps_resolved | ||
| UNRESOLVED_DEPENDENCIES_VAR deps_unresolved | ||
| EXECUTABLES ${TARGET_APP} | ||
| DIRECTORIES ${CMAKELIBPATH} | ||
| PRE_EXCLUDE_REGEXES "api-ms-*" "ext-ms-*" | ||
| POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" | ||
| ) | ||
| MESSAGE(STATUS "Resolving runtime dependencies for ${TARGET_APP}") | ||
| FOREACH(dep ${deps_resolved}) | ||
| FILE(INSTALL ${dep} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
| MESSAGE(STATUS "Installing ${dep}") | ||
| ENDFOREACH() | ||
| FOREACH(dep ${deps_unresolved}) | ||
| MESSAGE(WARNING "Runtime dependency ${dep} could not be resolved.") | ||
| ENDFOREACH() | ||
| EXECUTE_PROCESS(COMMAND ${DEPLOYQT_EXE} --no-angle --compiler-runtime ${INSTALL_BINPATH}/Natron.exe) | ||
| ]]) | ||
|
|
||
| INSTALL(CODE "SET(INSTALL_BINPATH \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\")") | ||
| INSTALL(CODE "SET(DEPLOYQT_EXE \"${DEPLOYQT_EXE}\")") | ||
| INSTALL(CODE "SET(CMAKELIBPATH \"${CMAKE_SYSTEM_LIBRARY_PATH};${CMAKE_MINGW_SYSTEM_LIBRARY_PATH};${MINGWPATH}\")") | ||
| INSTALL(SCRIPT ${CONFIG_FILE}) | ||
| INSTALL(DIRECTORY ${Python3_LIBRARY_DIRS}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} | ||
| DESTINATION lib | ||
| PATTERN "*.pyc" EXCLUDE) | ||
| ENDIF() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -315,6 +315,8 @@ AppManager::loadFromArgs(const CLArgs& cl) | |
| std::cout << "argv[" << i << "] = " << StrUtils::utf16_to_utf8( std::wstring(_imp->commandLineArgsWide[i]) ) << std::endl; | ||
| } | ||
| #endif | ||
| // This should fix GL widgets when undocked | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice to add a comment, but it would be nice to have a link to the "why". I found this one, maybe you have a better one? |
||
| QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); | ||
|
|
||
| // This needs to be done BEFORE creating qApp because | ||
| // on Linux, X11 will create a context that would corrupt | ||
|
|
@@ -323,6 +325,7 @@ AppManager::loadFromArgs(const CLArgs& cl) | |
| _imp->renderingContextPool.reset( new GPUContextPool() ); | ||
| initializeOpenGLFunctionsOnce(true); | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please avoid formatting changes in PRs (or make a formatting-only PR) |
||
| // QCoreApplication will hold a reference to that appManagerArgc integer until it dies. | ||
| // Thus ensure that the QCoreApplication is destroyed when returning this function. | ||
| initializeQApp(_imp->nArgs, &_imp->commandLineArgsUtf8.front()); // calls QCoreApplication::QCoreApplication(), which calls setlocale() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,7 @@ CurveWidget::initializeGL() | |
| // always running in the main thread | ||
| assert( qApp && qApp->thread() == QThread::currentThread() ); | ||
| appPTR->initializeOpenGLFunctionsOnce(); | ||
| makeCurrent(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why you call makeCurrent here. From the doc: There is no need to call makeCurrent() because this has already been done when this function is called.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So these calls are needed because initializeOpenGLFunctionsOnce() can end up creating a context, making it current, and then does not restore the old context. I believe we should fix that behavior instead of papering over it here and below. I started looking into that but haven't got a full solution yet. I also am a little skeptical about the need to init all the GL functions in these various places. ISTM that this should happen very early in startup instead of here, but I'm not as familiar with this code yet. I suspect making something like my ScopedGLContext on Windows cross-platform would make resolving this and any other similar situation we encounter simpler.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, I thought it was a good idea to push what I found to help maintainers debug the code. |
||
| } | ||
|
|
||
| void | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3171,6 +3171,8 @@ DopeSheetView::initializeGL() | |
| return; | ||
| } | ||
|
|
||
| makeCurrent(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, no need to call makeCurrent, according to the doc
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, I think it's something I left while debugging |
||
|
|
||
| _imp->generateKeyframeTextures(); | ||
| } | ||
|
|
||
|
|
||
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.
I can't review the WIN32 stuff, @acolwell can you give it a look?
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.
Also it would be nice to have two separate PRs (one for the CMake stuff, one for the OpenGL stuff)
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.
I agree. The CMake stuff should be in its own PR so it can be landed quickly. I mentioned this in the previous incarnation of these changes.