Skip to content
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

1.95.0 Black screen instead of a molecule #733

Closed
yurivict opened this issue Aug 17, 2021 · 28 comments · Fixed by #744
Closed

1.95.0 Black screen instead of a molecule #733

yurivict opened this issue Aug 17, 2021 · 28 comments · Fixed by #744
Assignees
Labels

Comments

@yurivict
Copy link
Contributor

Avogadro version: (please complete the following information from the About box):

  • Avogadrolibs: 1.95.0
  • Qt: 5.15.2

Desktop version: (please complete the following information):

  • OS: FreeBSD 13
  • Version: 1.95.0
  • Compiler clang-11

Describe the bug
avogadro2 starts with an entirely black molecule widget.
When *.pdb file is opened it only shows a box in white lines and nothing else.

This is a regression against 1.94.0 which showed *.pdb files fine.

$ avogadro2 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-yuri'
Locale:  "C"
Extension plugins dynamically found... 35
Checking for  "commands"  scripts in "/home/yuri/.local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/local/bin/../lib/avogadro2/scripts/commands"
OBProcess::executeObabel: Running "obabel" "-L formats read"
OBProcess::executeObabel: Running "obabel" "-L formats write"
OBProcess::executeObabel: Running "obabel" "-L forcefields"
OBProcess::executeObabel: Running "obabel" "-L charges"
OBProcess::executeObabel: Running "obabel" "-V"
"obabel"  found:  ""
Checking for  "inputGenerators"  scripts in "/home/yuri/.local/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/local/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/local/bin/../lib/avogadro2/scripts/inputGenerators"
Checking for  "formatScripts"  scripts in "/home/yuri/.local/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/local/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/local/bin/../lib/avogadro2/scripts/formatScripts"
"Navigator" added
"Editor" added
"Selection" added
"Manipulator" added
"BondCentric" added
"MeasureTool" added
"PlayerTool" added
Process encountered an error, and did not execute correctly.
	Exit code: 0
	Exit status: QProcess::NormalExit
	Exit output: ""
Open Babel formats ready:  0
Process encountered an error, and did not execute correctly.
	Exit code: 0
	Exit status: QProcess::NormalExit
	Exit output: ""
Process encountered an error, and did not execute correctly.
	Exit code: 255
	Exit status: QProcess::NormalExit
	Exit output: ""
Process encountered an error, and did not execute correctly.
	Exit code: 0
	Exit status: QProcess::NormalExit
	Exit output: ""

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here. Please consider uploading or linking test files.

@welcome
Copy link

welcome bot commented Aug 17, 2021

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

@ghutchis
Copy link
Member

Can you give us a screenshot or two? It would be very helpful, thanks.

@ghutchis ghutchis transferred this issue from OpenChemistry/avogadroapp Aug 17, 2021
@yurivict
Copy link
Contributor Author

avogadro2-2021-08-17_12.06.22.mp4

@ghutchis
Copy link
Member

I'm not sure of the bug at the moment - but the workaround is to click the "Ball and Stick" or "Cartoon" or "Wireframe" display types.

@ghutchis
Copy link
Member

(The bug would be that "Ball and Stick" should be the default on a new install.)

@yurivict
Copy link
Contributor Author

Can you release a fix in a new release?

@ghutchis
Copy link
Member

Sure, although did you have previous settings on that account? I'll test a bit later with cleared settings.

@yurivict
Copy link
Contributor Author

Sure, although did you have previous settings on that account?

Probably not.

Now this version creates settings files but doesn't initialize this value, so the problem is reproducible on reruns.

@ghutchis
Copy link
Member

I can confirm that the default value is somehow getting ignored.

Screen Shot 2021-08-18 at 11 08 05 AM

Now this version creates settings files but doesn't initialize this value

Well, if you enable "Ball and Stick" or any other display type, it will be saved to the settings on re-run.

@ghutchis
Copy link
Member

I'll take a closer look into the code later this afternoon.

@avo-bot
Copy link

avo-bot commented Aug 20, 2021

This issue has been mentioned on Avogadro Discussion. There might be relevant details there:

https://discuss.avogadro.cc/t/avogadro2-is-on-flathub/3481/9

@ghutchis ghutchis linked a pull request Aug 20, 2021 that will close this issue
@yurivict
Copy link
Contributor Author

@ghutchis

Somehow the #744 patch didn't solve it for me.

I applied it on top of avogadrolibs-1.95.0 and deleted ~/.config/OpenChemistry - still same problem.

@ghutchis
Copy link
Member

Can you try this patch to avogadroapp, which absolutely positively removes all settings?

diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp
index d2676c6..9479b16 100644
--- a/avogadro/mainwindow.cpp
+++ b/avogadro/mainwindow.cpp
@@ -248,11 +248,11 @@ MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings)
   m_ui->setupUi(this);
 
   // If disable settings, ensure we create a cleared QSettings object.
-  if (disableSettings) {
+  //if (disableSettings) {
     QSettings settings;
     settings.clear();
     settings.sync();
-  }
+  //}
   // The default settings will be used if everything was cleared.
   readSettings();

The #744 patch definitely works on Mac and Windows:
Screen Shot 2021-08-25 at 4 55 49 PM

For reasons I don't understand, some settings seem to be cached on my Mac - either by Qt or the OS even when I rm the settings files. So i've been testing with this avogadroapp branch.

@yurivict
Copy link
Contributor Author

Still same problem with the patch in avogadro/mainwindow.cpp

@avo-bot
Copy link

avo-bot commented Aug 26, 2021

This issue has been mentioned on Avogadro Discussion. There might be relevant details there:

https://discuss.avogadro.cc/t/avogadro2-is-on-flathub/3481/14

@ghutchis
Copy link
Member

Everyone else has tested and it works for them. I'd like to close this and get it working for you. Can you send me your patched source? That would seem to be the best way to get to the bottom of it. Thanks.

@yurivict
Copy link
Contributor Author

I tarballed source directories as used by ports:

@ghutchis
Copy link
Member

I built from that source on my Mac and on an Ubunutu VM I had around. (Sorry I don't yet have a FreeBSD image running.)

It seems to work fine. 🤷‍♂️

I'm going to release 1.95.1 - but I'd definitely like to figure out what's happening for you, so I'll reopen this.

Screen Shot 2021-08-26 at 4 28 59 PM

@ghutchis ghutchis reopened this Aug 26, 2021
@serk12
Copy link
Collaborator

serk12 commented Aug 31, 2021

I think I solved the problem with the black screen.
Yuri is not only starting a fresh install, but also opening a file. So ballandstick/enable patch the 1º run but MainWindow/plugin has not changed, so when the file is opened it gets back to false.
This should solve it, but we need the plugin name which is set up in the CMakeList.txt, any clean solution?

@@ -89,9 +89,11 @@ void PluginLayerManager::setEnabled(bool enable)
     if (m_name == BallAndStick::getName()) {
       enable = settings.value("ballandstick/enable", true).toBool();
       settings.setValue("ballandstick/enable", false);
+      settings.setValue("MainWindow/" + pluginName, false);
     } else if (m_name == Cartoons::getName()) {
       enable = settings.value("cartoon/enable", true).toBool();
       settings.setValue("cartoon/enable", false);
+      settings.setValue("MainWindow/" + pluginName, false);
     }

@ghutchis
Copy link
Member

I still don't understand why the code is calling setValue() with false - shouldn't we be using enable so that on 2nd run, etc. it's correct?

As far as loading from a file, I think that needs to be solved in avogadroapp - perhaps a check if a file doesn't have any plugins enabled, to turn one on for the user .. but it's a small population that has files like this.

@serk12
Copy link
Collaborator

serk12 commented Aug 31, 2021

Yes, if we add a isDefault to ScenePlugin then all of this can be solved trivialy in avogadroapp.

@PeterKraus
Copy link

Has this been resolved? I'm seeing the same issue (ball & stick unchecked every time I open an xyz file, even if previously checked) on Linux with 1.95.1.

@yurivict
Copy link
Contributor Author

I didn't see it resolved. I stopped updating the FreeBSD until this is resolved.

@serk12
Copy link
Collaborator

serk12 commented Nov 23, 2021

The PR #807 and avogadrolibs#235 should fix this. But they are posterior to 1.95.1.

@ghutchis
Copy link
Member

We need a 1.96 release, but I'm marking this closed.

@ghutchis
Copy link
Member

If problems re-occur with HEAD, please open a new bug report.

@yurivict
Copy link
Contributor Author

We need a 1.96 release, but I'm marking this closed.

Does this mean that the problem will be fixed in 1.96 ?

@ghutchis
Copy link
Member

ghutchis commented Apr 26, 2022

Yes. As far as I can tell, it's fixed in HEAD with #807 and avogadroapp#235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants