sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Blank screen on previous window when opening a new one

Open 3N4N opened this issue 1 year ago • 33 comments

I'm using Windows 11 and Sioyek v2.0.0. When I open a new window with Ctrl-T, the the new window opens with the same file the previous window was displaying. At this point both windows work fine. But when I open a new document in either of the windows, the other one goes blank. Scrolling it changes the page numbers in the status bar at the bottom, so it seems the issue is only with displaying the document.

I found this reddit comment from a year ago that describes the same issue. But I couldn't find it reported here. That's why I'm creating this bug report.

3N4N avatar Aug 30 '24 05:08 3N4N

Unfortunately I don't have a windows 11 machine to test this issue, maybe someone can help?

ahrm avatar Aug 30 '24 06:08 ahrm

I can look into it. But I'm having trouble compiling Sioyek with MinGW. Building MuPDF caused some errors, but I could fix those. Now the compilation needs qmake and it seems my Qt installation is not working right.

C:\Users\enan\projects\sioyek> "/Qt/5.15.2/mingw81_64/bin/qmake.exe" -tp vc pdf_viewer_build_config.
pro
WARNING: Unable to generate output for: C:/Users/enan/projects/sioyek/Makefile.Release [TEMPLATE vcapp]
QIODevice::write: device not open
WARNING: Unable to generate output for: C:/Users/enan/projects/sioyek/Makefile.Debug [TEMPLATE vcapp]
QIODevice::write: device not open

3N4N avatar Sep 03 '24 16:09 3N4N

Which branch are you trying to build? If you are building the development branch note that it requires qt 6.5+. This error seems to indicate that qt was unable to open the output file, this might be a permission issue, make sure that qmake has the permission to create the files in that directory (either by moving to another drive other than c or running qmake as administrator).

ahrm avatar Sep 03 '24 16:09 ahrm

Sorry, the error seems to be because of "-tp vc" parameter. I took it from "build_windows.bat", but since I'm using MinGW, maybe I should be following "build_linux.sh". I did that, and qmake was able to generate the makefiles. There are some C++ errors. I'll try to fix those and let you know.

P.S. I was using the main branch and qt-5.15. Switched to dev branch now and installing qt-6.5.

3N4N avatar Sep 03 '24 16:09 3N4N

After switching to dev branch, installing qt-6.5, and rebuilding MuPDF, this is the error in Sioyek compilation:

enan@enan-lenovo 13:23 ~/projects/sioyek
bash-5.2$ mingw32-make.exe CC=gcc CXX=g++ CXXFLAGS='-w'
C:/mingw64/bin/mingw32-make.exe -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/enan/projects/sioyek'
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchListView.o pdf_viewer/touchui/TouchListView.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchConfigMenu.o pdf_viewer/touchui/TouchConfigMenu.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchTextEdit.o pdf_viewer/touchui/TouchTextEdit.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchHighlightButtons.o pdf_viewer/touchui/TouchHighlightButtons.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchSettings.o pdf_viewer/touchui/TouchSettings.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchDrawControls.o pdf_viewer/touchui/TouchDrawControls.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/TouchMacroEditor.o pdf_viewer/touchui/TouchMacroEditor.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/book.o pdf_viewer/book.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/config.o pdf_viewer/config.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/database.o pdf_viewer/database.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/document.o pdf_viewer/document.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/document_view.o pdf_viewer/document_view.cpp
g++ -c -w -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/input.o pdf_viewer/input.cpp
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: release/input.o: too many sections (62228)
C:\Users\enan\AppData\Local\Temp\ccMUoo9a.s: Assembler messages:
C:\Users\enan\AppData\Local\Temp\ccMUoo9a.s: Fatal error: can't write 27 bytes to section .text of release/input.o: 'file too big'
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: release/input.o: too many sections (62228)
C:\Users\enan\AppData\Local\Temp\ccMUoo9a.s: Fatal error: release/input.o: file too big
mingw32-make[1]: *** [Makefile.Release:13592: release/input.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/enan/projects/sioyek'
mingw32-make: *** [makefile:45: release] Error 2

3N4N avatar Sep 03 '24 17:09 3N4N

Yes, I think you need to specify a compiler option that allows large files, I don't remember what it is exactly for g++ but it might be -Wa,-mbig-obj (the option for visual studio is /bigobj).

ahrm avatar Sep 03 '24 17:09 ahrm

Hmm, using -Wa,mbig-obj fixes that issue. But a different one comes up.

pdf_viewer/main_widget.cpp:36:10: fatal error: qdesktopwidget.h: No such file or directory
   36 | #include <qdesktopwidget.h>
      |          ^~~~~~~~~~~~~~~~~~

Seems like SIOYEK_QT6 isn't being defined even though I'm using qt-6.5. Any idea?

Update: My bad. This was a different issue. Fixed now.

3N4N avatar Sep 03 '24 17:09 3N4N

Facing the following error now:

enan@enan-lenovo 14:08 ~/projects/sioyek
bash-5.2$ mingw32-make.exe CC=gcc CXX=g++
C:/mingw64/bin/mingw32-make.exe -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/enan/projects/sioyek'
g++ -c -fno-keep-inline-dllexport -std=c++17 -w -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DSIOYEK_QT6 -DQT_3DINPUT_LIB -DQT_OPENGL_LIB -DQT_OPENGLEXTENSIONS_LIB -DQT_WIDGETS_LIB -DNON_PORTABLE -DLINUX_STANDARD_PATHS -DQT_NO_DEBUG -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_3DINPUT_LIB -DQT_3DCORE_LIB -DQT_SVG_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_QMLINTEGRATION_LIB -DQT_TEXTTOSPEECH_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -Ipdf_viewer -Imupdf/include -Izlib -I../../../../qt6/6.5.3/mingw_64/include -I../../../../qt6/6.5.3/mingw_64/include/QtQuickWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtQuick -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGLWidgets -I../../../../qt6/6.5.3/mingw_64/include/QtOpenGL -I../../../../qt6/6.5.3/mingw_64/include/QtWidgets -I../../../../qt6/6.5.3/mingw_64/include/Qt3DInput -I../../../../qt6/6.5.3/mingw_64/include/Qt3DCore -I../../../../qt6/6.5.3/mingw_64/include/QtSvg -I../../../../qt6/6.5.3/mingw_64/include/QtGui -I../../../../qt6/6.5.3/mingw_64/include/QtQmlModels -I../../../../qt6/6.5.3/mingw_64/include/QtQml -I../../../../qt6/6.5.3/mingw_64/include/QtNetwork -I../../../../qt6/6.5.3/mingw_64/include/QtConcurrent -I../../../../qt6/6.5.3/mingw_64/include/QtQmlIntegration -I../../../../qt6/6.5.3/mingw_64/include/QtTextToSpeech -I../../../../qt6/6.5.3/mingw_64/include/QtCore -Irelease -I/include -I../../../../qt6/6.5.3/mingw_64/mkspecs/win32-g++  -o release/main_widget.o pdf_viewer/main_widget.cpp
pdf_viewer/main_widget.cpp: In member function 'TextToSpeechHandler* MainWidget::get_tts()':
pdf_viewer/main_widget.cpp:8310:21: error: no matching function for call to 'MainWidget::connect(TextToSpeechHandler*&, void (QTextToSpeech::*)(QTextToSpeech::State), MainWidget::get_tts()::<lambda(QTextToSpeech::State)>)'
 8310 |     QObject::connect(tts, &QTextToSpeech::stateChanged, [&](QTextToSpeech::State state) {
      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 8311 |         if ((state == QTextToSpeech::Ready) || (state == QTextToSpeech::Error)) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 8312 |             if (is_reading) {
      |             ~~~~~~~~~~~~~~~~~
 8313 |                 move_visual_mark(1);
      |                 ~~~~~~~~~~~~~~~~~~~~
 8314 |                 //read_current_line();
      |                 ~~~~~~~~~~~~~~~~~~~~~~
 8315 |                 invalidate_render();
      |                 ~~~~~~~~~~~~~~~~~~~~
 8316 |             }
      |             ~
 8317 |         }
      |         ~
 8318 |         });
      |         ~~
In file included from C:/qt6/6.5.3/mingw_64/include/QtCore/qabstractitemmodel.h:10,
                 from pdf_viewer/main_widget.cpp:27:
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:201:43: note: candidate: 'template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)'
  201 |     static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
      |                                           ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:201:43: note:   candidate expects 4 arguments, 3 provided
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:233:13: note: candidate: 'template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
  233 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
      |             ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:233:13: note:   template argument deduction/substitution failed:
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h: In substitution of 'template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QTextToSpeech::*)(QTextToSpeech::State); Func2 = MainWidget::get_tts()::<lambda(QTextToSpeech::State)>]':
pdf_viewer/main_widget.cpp:8310:21:   required from here
 8310 |     QObject::connect(tts, &QTextToSpeech::stateChanged, [&](QTextToSpeech::State state) {
      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 8311 |         if ((state == QTextToSpeech::Ready) || (state == QTextToSpeech::Error)) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 8312 |             if (is_reading) {
      |             ~~~~~~~~~~~~~~~~~
 8313 |                 move_visual_mark(1);
      |                 ~~~~~~~~~~~~~~~~~~~~
 8314 |                 //read_current_line();
      |                 ~~~~~~~~~~~~~~~~~~~~~~
 8315 |                 invalidate_render();
      |                 ~~~~~~~~~~~~~~~~~~~~
 8316 |             }
      |             ~
 8317 |         }
      |         ~
 8318 |         });
      |         ~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:233:13: error: no type named 'type' in 'struct std::enable_if<false, QMetaObject::Connection>'
  233 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
      |             ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:242:13: note: candidate: 'template<class Func1, class Func2> static typename std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)'
  242 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
      |             ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:242:13: note:   candidate expects 4 arguments, 3 provided
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:276:13: note: candidate: 'static typename std::enable_if<((QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QTextToSpeech::*)(QTextToSpeech::State); Func2 = MainWidget::get_tts()::<lambda(QTextToSpeech::State)>; typename std::enable_if<((QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type = QMetaObject::Connection; typename QtPrivate::FunctionPointer<Func>::Object = QTextToSpeech]'
  276 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
      |             ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:276:79: note:   no known conversion for argument 1 from 'TextToSpeechHandler*' to 'const QtPrivate::FunctionPointer<void (QTextToSpeech::*)(QTextToSpeech::State)>::Object*' {aka 'const QTextToSpeech*'}
  276 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:287:13: note: candidate: 'template<class Func1, class Func2> static typename std::enable_if<((QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)'
  287 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
      |             ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:287:13: note:   candidate expects 4 arguments, 3 provided
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:181:36: note: candidate: 'static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)'
  181 |     static QMetaObject::Connection connect(const QObject *sender, const char *signal,
      |                                    ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:181:36: note:   candidate expects 5 arguments, 3 provided
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:184:36: note: candidate: 'static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)'
  184 |     static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal,
      |                                    ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:184:36: note:   candidate expects 5 arguments, 3 provided
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:432:32: note: candidate: 'QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const'
  432 | inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
      |                                ^~~~~~~
C:/qt6/6.5.3/mingw_64/include/QtCore/qobject.h:432:64: note:   no known conversion for argument 1 from 'TextToSpeechHandler*' to 'const QObject*'
  432 | inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
      |                                                 ~~~~~~~~~~~~~~~^~~~~~~
mingw32-make[1]: *** [Makefile.Release:14534: release/main_widget.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/enan/projects/sioyek'
mingw32-make: *** [makefile:45: release] Error 2

3N4N avatar Sep 03 '24 18:09 3N4N

Hmmm I think you can comment the part between #else and #endif for now (line 8310), (it only disables some TTS-related stuff you can comment it out if you don't care about TTS).

ahrm avatar Sep 03 '24 18:09 ahrm

Commenting out that part works but a bunch of other error come up. I think the qmake project file needs to be updated for MinGW. Currently it only considers MSVC (win32 section) and GNU toolchain (unix section):

https://github.com/ahrm/sioyek/blob/40151569b95cac47d708447b181e645178082aa0/pdf_viewer_build_config.pro#L141-L193

Maybe we need a mixture of the two for MinGW to compile properly. I tried to come up with something (checking for MinGW is done with win32-g++ keyword) but didn't work out.

3N4N avatar Sep 05 '24 01:09 3N4N

My bad. The issue was totally different. It was due to a faulty if-defined conditional in SyncTeX:

https://github.com/ahrm/sioyek/blob/40151569b95cac47d708447b181e645178082aa0/pdf_viewer/synctex/synctex_parser_utils.h#L66

Changing it to #if defined(_WIN32) && defined __CYGWIN__ fixes the mountain of errors coming in from the standard c libraries. I will try to compile Sioyek again and let you know.

3N4N avatar Sep 05 '24 02:09 3N4N

I managed to compile Sioyek with MinGW, but there is one linker error:

C:/mingw64/bin/mingw32-make.exe -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/enan/projects/sioyek'
g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release/sioyek.exe @release/object_script.sioyek.Release -Lmupdf/build/debug -Lmupdf/build/release -lmupdf -lmupdf-third -lmupdf-threads -lmupdf-pkcs7 -Lzlib -lz -lopengl32 C:/qt/6.7.2/mingw_64/lib/libQt6QuickWidgets.a C:/qt/6.7.2/mingw_64/lib/libQt6Quick.a C:/qt/6.7.2/mingw_64/lib/libQt6OpenGLWidgets.a C:/qt/6.7.2/mingw_64/lib/libQt6OpenGL.a C:/qt/6.7.2/mingw_64/lib/libQt6Widgets.a C:/qt/6.7.2/mingw_64/lib/libQt63DInput.a C:/qt/6.7.2/mingw_64/lib/libQt63DCore.a C:/qt/6.7.2/mingw_64/lib/libQt6Svg.a C:/qt/6.7.2/mingw_64/lib/libQt6TextToSpeech.a C:/qt/6.7.2/mingw_64/lib/libQt6Multimedia.a C:/qt/6.7.2/mingw_64/lib/libQt6Gui.a C:/qt/6.7.2/mingw_64/lib/libQt6QmlModels.a C:/qt/6.7.2/mingw_64/lib/libQt6Qml.a C:/qt/6.7.2/mingw_64/lib/libQt6Network.a C:/qt/6.7.2/mingw_64/lib/libQt6Concurrent.a C:/qt/6.7.2/mingw_64/lib/libQt6Core.a release/sioyek_resource_res.o -lmingw32 C:/qt/6.7.2/mingw_64/lib/libQt6EntryPoint.a -lshell32
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/qt/6.7.2/mingw_64/lib/libQt6EntryPoint.a(qtentrypoint_win.cpp.obj):qtentrypoint_win.cpp:(.rdata$.refptr.__imp___argc[.refptr.__imp___argc]+0x0): undefined reference to `__imp___argc'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [Makefile.Release:289: release/sioyek.exe] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/enan/projects/sioyek'
mingw32-make: *** [makefile:45: release] Error 2

N.B. Might be a problem with my MinGW installation 👀

Update: I needed to use the same version of mingw as qt is built with. Errors fixed now.

3N4N avatar Sep 05 '24 02:09 3N4N

Was finally able to build Sioyek. Both release and debug versions. I will try and find the cause of the bug later on.

3N4N avatar Sep 05 '24 05:09 3N4N

I have the same issue. When I open a new window and switch between them using alt tab, the first window becomes blank. I'm using Windows 10 and Sioyek v2.0.0, which I downloaded from the releases. recording

BTW, thank you for the awesome reader. I love it so much.

WvW-vOiDs avatar Sep 06 '24 07:09 WvW-vOiDs

I couldn't reproduce the issue with the latest 'development' branch. Neither in release nor in debug mode.

@WvW-vOiDs can you check if you can reproduce the issue with this release?

Update: Sorry. The issue still exists. I'll double check.

3N4N avatar Sep 06 '24 16:09 3N4N

I couldn't reproduce the issue with the latest 'development' branch. Neither in release nor in debug mode.

@WvW-vOiDs can you check if you can reproduce the issue with this release?

Update: Sorry. The issue still exists. I'll double check.

Sorry, I wasn't clear enough before. I downloaded sioyek-release-windows.zip from the release page. I didn't build it.

Thank you @3N4N for taking the time to recheck. I really appreciate it! I regret that I'm not very proficient in coding, so I can't provide any assistance.

WvW-vOiDs avatar Sep 07 '24 09:09 WvW-vOiDs

Both issues do not show up on my Windows 11 PC.

recording

But they still exist on Windows 10.

WvW-vOiDs avatar Sep 09 '24 07:09 WvW-vOiDs

@WvW-vOiDs I am running Windows 11 and I can still reproduce the issue. I tried to find the bug in the 'dev' branch, but still no luck. I can only say that the bug exists only in Windows, not in Linux. I'll try looking. But @ahrm, any suggestion would be really appreciated.

I found the relevant function:

https://github.com/ahrm/sioyek/blob/40151569b95cac47d708447b181e645178082aa0/pdf_viewer/input.cpp#L4246-L4258

3N4N avatar Sep 11 '24 06:09 3N4N

This is the command that creates a new window. Based on your screencasts, this command seems to be working fine, as the window is created, however, no content is being rendered in that window. The rendering-related code is in pdf_view_opengl_widget.cpp. For example, you could set a breakpoint on PdfViewOpenGLWidget::my_render and see if there is a difference between the execution of the window that is rendering correctly and the other window.

ahrm avatar Sep 11 '24 07:09 ahrm

Just found this out, hard to have homework and textbooks open at the same time. I'm using windows 11

Jacinto27 avatar Oct 06 '24 10:10 Jacinto27

Can the issue be reproduced in the experimental builds here: https://github.com/ahrm/sioyek/releases/tag/sioyek3-alpha0 ?

ahrm avatar Oct 06 '24 10:10 ahrm

works just as intended sir 🫡 cant wait for the full release sir 🫡🫡 my homework will be decimated sir 🫡🫡🫡

Jacinto27 avatar Oct 06 '24 19:10 Jacinto27

Can the issue be reproduced in the experimental builds here: https://github.com/ahrm/sioyek/releases/tag/sioyek3-alpha0 ?

I am having the same issue with this new version. I'm using windows 11. The new window wors fine, but the last one is blocked.

Noninn1 avatar Oct 13 '24 08:10 Noninn1

Are you sure you are running the new version? ( do you have access to new commands such as add_freetext_bookmark in the commands menu)?

ahrm avatar Oct 13 '24 09:10 ahrm

Heres a video: https://imgur.com/a/zOPAY4c

Noninn1 avatar Oct 13 '24 10:10 Noninn1

Unfortunately I can't reproduce it on my system (I don't have a windows 11 machine, it might be a windows 11-specific issue). Can you share your prefs_user.config? Maybe there is a specific configuration that is causing the issue.

ahrm avatar Oct 13 '24 10:10 ahrm

I didn't modify anything in the prefs_user.config file. I have just tried opening two windows in my laptop and it worked fine, but in my pc, the last windows crashes. This is quite strange, its something to do with my pc, but I don't know what is. (Both on windows 11, also in my laptop I can't run the sioyek 3 alpha version. I run the program but then nothing happens).

Noninn1 avatar Oct 13 '24 16:10 Noninn1

This is the command that creates a new window. Based on your screencasts, this command seems to be working fine, as the window is created, however, no content is being rendered in that window. The rendering-related code is in pdf_view_opengl_widget.cpp. For example, you could set a breakpoint on PdfViewOpenGLWidget::my_render and see if there is a difference between the execution of the window that is rendering correctly and the other window.

@ahrm I tried to pinpoint the bug but my_render function is too long to find the differences between the two instances/windows. Lemme know if you wanna do pair programming. Since you wrote the program, you'd be much more efficient in finding the potential issue.

3N4N avatar Oct 23 '24 03:10 3N4N

https://www.reddit.com/r/archlinux/comments/tk0sem/unable_to_open_2_instances_of_sioyek_pdf_reader/

Noninn1 avatar Nov 27 '24 13:11 Noninn1

Pinging this. This still occurs on Win 11.

CXBoyy avatar Nov 22 '25 22:11 CXBoyy