Opened files affect system menu entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qpdfview |
Fix Released
|
Medium
|
Adam Reichold |
Bug Description
I stumbled across a very interesting bug, it seems that opened file tabs actually affect system menu entries and may cause them to malfuction when the name matches.
1. Open setup.pdf in qpdfview (attached).
2. Open any other file and switch to its tab.
3. Click qpdfview → Preferences to open settings window.
4. Close settings window.
5. Click qpdfview → Preferences to open settings window again.
6. Close setup.pdf tab.
7. Click qpdfview → Preferences to open settings window once more.
What actually happens is that:
- At step 5 instead of the settings window qpdfview will jump to the opened setup.pdf tab.
- At step 7 there will be no Preferences entry in the menu, since closing setup.pdf removes it.
This issue seems to be macOS-specific and might actually be Qt-specific as I cannot reproduce it on Ubuntu.
Changed in qpdfview: | |
status: | Fix Committed → Fix Released |
I believe I was able to identify the relevant code that breaks it[1]. All the filenames in this piece of code (Preferences, Setup, etc.) cause this insane behaviour. Interestingly, it is not reproducible with About, Cut, or any others. Perhaps the code path in the other place matters somehow.
I created a hack[2] that seems to work for me, but I am not sure whether you would want to include it upstream.
[1] https:/ /github. com/qt/ qtbase/ blob/1869615f/ src/plugins/ platforms/ cocoa/qcocoamen uitem.mm# L228-L234 /github. com/vit9696/ qpdfview/ blob/master/ patches/ tabname. diff
[2] https:/