supermerill / SuperSlicer

G-code generator for 3D printers (Prusa, Voron, Creality, etc.)
4.12k stars 519 forks source link

GUI issues when in regular mode #1576

Open LazaroFilm opened 3 years ago

LazaroFilm commented 3 years ago

Describe the bug The GUI doesn't show the right hand menu and sometimes the whole window when in regular GUI. The GUI works fine with the old Prusa Layout.

To Reproduce From GUI in Old Prusa layout, set the GUI to regular, then switch around between tabs.

>> Project File << Issue apparent with every projects.

Expected behavior GUI should display normally when switching tabs.

Screenshots Screen Shot 2021-09-19 at 3 30 17 PM Screen Shot 2021-09-19 at 3 30 22 PM Screen Shot 2021-09-19 at 3 30 58 PM

Desktop (please complete the following information):

Additional context Let me know what we need.

supermerill commented 3 years ago

That's why I added '!! Can be unstable in some os distribution !!' Maybe I should just remove the option on macos. I can't fix it right now, I need a mac.

GarthSnyder commented 3 years ago

@supermerill, do you have a theory as to what might be going on? I can take a look in the debugger, but I'm hampered by my rusty C++ and not being familiar with whatever cross-platform GUI is being used.

supermerill commented 3 years ago

For this to work, I have to move the panel from the previous tab to the new one. it's a bit hacky, and each os has to be given the "please don't refresh' and 'please refresh now' at the good time and on the right thing (and the good method, as there are many ways to do that). Trials & errors is the only real method I have.

GarthSnyder commented 3 years ago

OK, but where is the code that does this? I need something really basic like "The tab bar is a FooTabBar object. When you click a tab, it calls BlahBlahBlah. The actual panel rearrangement is done in SomeDumbFunction."

supermerill commented 3 years ago

OK, but where is the code that does this? I need something really basic like "The tab bar is a FooTabBar object. When you click a tab, it calls BlahBlahBlah. The actual panel rearrangement is done in SomeDumbFunction."

Most of the problem should lie in MainFrame::init_tabpanel() (src/slic3r/GUI/mainFrame.cpp:line670), you can easily spot macos-only debug lines. At line 701, it's the callback for when you click on a tab 'button' (or call a change via a function, like for when the slicing ends). It's inside the if (this->m_layout == ESettingsLayout::Tabs) that is the problematic code.

For more context, m_plater contains a 'priv' object that contains and manage the wxGLCanvas that is drawing all that. I don't remember exactly, but the plater priv has the ponter for the "3D view" and the "preview" and swap them when needed. The preview has 3D object for the "preview" and the "gcode", and hide/destroy the one it deasn't want to see.

Imo, This may nee some refactoring to simplify that and put each thing in its own controllable panel, so they can be put where we want them. But this is a very big refactoring and make merges with prusaslicer a real chore.