[Solved] [Bug] Fullscreen issue with 'Part' containers

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
easyw-fc
Posts: 2613
Joined: Thu Jul 09, 2015 9:34 am

[Solved] [Bug] Fullscreen issue with 'Part' containers

Postby easyw-fc » Fri May 31, 2019 10:28 am

Hi,
I have noticed the following issue when displaying a document with a 'Part' container in fullscreen:
All 'Part' container Axis get displayed and closing fullscreen, will force the Axis containers to be always displayed until the doc get closed and re-opened.

phpBB [video]

-
Here my FC details, but it has the same issue on Win
OS: Linux Mint 19.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

It is present also on FC019 daily
Last edited by Kunda1 on Tue Aug 27, 2019 8:00 pm, edited 2 times in total.
Reason: Added [Solved] to thread title
kisolre
Posts: 1243
Joined: Wed Nov 21, 2018 1:13 pm

Re: Fullscreen issue with 'Part' containers

Postby kisolre » Fri May 31, 2019 10:45 am

Here it happens with everything in the body - after exiting "document window fullscreen mode" (or at enteringr it?) it stops respecting its parrent visibility state.

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16687 (Git)
Build type: Release
Branch: master
Hash: ff1fb11af15a7c5f7f0ba3ef79588e128f397c2c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
edit: after trying with more complex file and two files open this giberish happened:
DocumentWindowAfterFullscreen.JPG
DocumentWindowAfterFullscreen.JPG (147.6 KiB) Viewed 535 times
Two copies of the ring from one file, random parts appear while moving the mouse from the hole punch.
kisolre
Posts: 1243
Joined: Wed Nov 21, 2018 1:13 pm

Re: Fullscreen issue with 'Part' containers

Postby kisolre » Fri May 31, 2019 12:20 pm

After some more play I got this: :D :D :D :D
MemeMaterial.JPG
MemeMaterial.JPG (70.66 KiB) Viewed 521 times
freecad futuristic.JPG
freecad futuristic.JPG (94.67 KiB) Viewed 521 times
User avatar
easyw-fc
Posts: 2613
Joined: Thu Jul 09, 2015 9:34 am

Re: [Bug] Fullscreen issue with 'Part' containers

Postby easyw-fc » Sat Jun 01, 2019 10:51 am

Does it create also a memory leak?
FreeCAD goes completely mad with Part Design objects if used on fullscreen...
kisolre
Posts: 1243
Joined: Wed Nov 21, 2018 1:13 pm

Re: [Bug] Fullscreen issue with 'Part' containers

Postby kisolre » Sat Jun 01, 2019 10:54 am

Did not check then. I will do some experiments when i get home.
User avatar
easyw-fc
Posts: 2613
Joined: Thu Jul 09, 2015 9:34 am

Re: [Bug] Fullscreen issue with 'Part' containers

Postby easyw-fc » Tue Jun 04, 2019 8:31 pm

Should I report it to Mantis?
kisolre
Posts: 1243
Joined: Wed Nov 21, 2018 1:13 pm

Re: [Bug] Fullscreen issue with 'Part' containers

Postby kisolre » Wed Jun 05, 2019 6:44 am

Definitely.
Today after exiting fullscreen the whole view got black. Other document opened in the same time looks Ok. But creating new view with that black view open made the whole FreCAD window to black/white giberish. Did not see a memory leak (huge memory usage).

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16886 (Git)
Build type: Release
Branch: master
Hash: ed47e962d2c821bf1792889f6d7bdf457dcf6c9e
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
NVidia graphics if it relevant. But similar happens with integrated Intel.
wmayer
Site Admin
Posts: 14621
Joined: Thu Feb 19, 2009 10:32 am

Re: [Bug] Fullscreen issue with 'Part' containers

Postby wmayer » Wed Jun 05, 2019 10:16 am

This issue is Qt5-related.
With our old Qt4 builds all this worked without any problems and with Qt5 the OpenGL support has been reworked causing many, many problems.

For me switching to fullscreen seems to work fine with Qt5.6 but switching back to normal mode causes some rendering artefacts. With Qt5.12 things are much worse: when in normal mode anti-aliasing is enabled then this will be lost when switching to fullscreen mode and when switching back the rendering looks worse and the 3d window has a huge offset, too.

From the beginning on the QOpenGLWidget class has some bad behaviour because it destroys the OpenGL context and an internal FBO when switching to fullscreen mode or back and thus loses all its settings. The workaround I once found was to simply create a new QOpenGLWidget and delete the old one when changing the mode which was working more or less fine. But with Qt5.12 this doesn't seem to work at all any more.
User avatar
Kunda1
Posts: 5149
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Bug] Fullscreen issue with 'Part' containers

Postby Kunda1 » Wed Jun 05, 2019 11:39 am

@wmayer are these opengl issues documented so we can inform folks of this limitation(s) due to Qt?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
wmayer
Site Admin
Posts: 14621
Joined: Thu Feb 19, 2009 10:32 am

Re: [Bug] Fullscreen issue with 'Part' containers

Postby wmayer » Wed Jun 05, 2019 12:20 pm

Kunda1 wrote:
Wed Jun 05, 2019 11:39 am
@wmayer are these opengl issues documented so we can inform folks of this limitation(s) due to Qt?
The other issues I was talking about affects the off-screen rendering where for many people no image or an empty image is created. I have never seen this problem on any of my systems and I assume that's driver related.

Today I checked-in the commits git commit 2a1dd8415 and git commit 57b3ca6f and these fix the rendering problems I have with Qt5.12 on Windows and a crash on my (virtual) Ubuntu 18.04 with Qt5.9.5.

Now the remaining problem is when switching back from fullscreen to normal mode by pressing ESC. The Qt5.6 version loses the anti-aliasing settings and the 5.12 version additionally has an offset.

This however is not a Qt issue but a FreeCAD issue because pressing ESC directly changes the MDI view instead of cloning and deleting it. When pressing the shortcuts v,d or v,u instead then all works correctly for me.

So, the only change for now is to disable the ESC button inside View3DInventor::keyPressEvent when using Qt5.x