View Issue Details

IDProjectCategoryView StatusLast Update
0000636FreeCADBugpublic2012-04-04 08:35
Reporterpperisin Assigned Towmayer  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
Product Version0.12 
Fixed in Version0.13 
Summary0000636: Two documents close
DescriptionHi,

I'm building FreeCAD on OpenSUSE. There is a problem on close document.

It seems that document close is being executed twice, so he closes two documents, if there is another doc on the right side. I do not understand why.

Also, after he does this, screen looks weird, and in order to get it to appear normal I need to

Regards
Petar
Additional Informationopensuse 12.1

build 0751 GIT
TagsNo tags attached.
FreeCAD Information

Relationships

has duplicate 0000760 closed Closing a file closes other files 

Activities

2012-03-13 14:11

 

1.png (Attachment missing)

2012-03-13 14:12

 

2.png (Attachment missing)

2012-03-13 14:12

 

3.png (Attachment missing)

2012-03-13 14:12

 

4.png (Attachment missing)

pperisin

2012-03-13 14:15

reporter   ~0001764

on pictures are test cases:

1 - shows which document I want to close
2 - shows what happens after the click - the document you wanted to close and the first one on the right side closes


next is the case you have if 3 docs are opened, and you want to close second one.
3 - shows the case
4 - shows how the remaining doc looks like now.

Regards,
Petar

yorik

2012-03-13 21:43

administrator   ~0001770

I can't confirm this, here all seems to work fine. But you last image looks very much like an OpenGL problem? What system are you running on? Does it have 3D driver installed? Which one?

pperisin

2012-03-14 13:30

reporter   ~0001774

Opensuse 32bit.

NVidia propritary drivers installed.

It seems to me like QT problem - is it maybe that?

Regards,
Petar

wmayer

2012-03-17 10:36

administrator   ~0001786

Is HW acceleration activated?

pperisin

2012-03-17 20:27

reporter   ~0001788

Last edited: 2012-03-17 20:27

I have no idea where to turn that on :-)

All I know is that I have added repo and installed propriate drivers of NVidia, and also on boot when opensuse screen is shown, for shot time NVidia logo appears.

I think it means that is on.

Regards,
Petar

ivanzero

2012-03-18 15:32

reporter   ~0001789

openSUSE 12.1 x64

FreeCAD
Version: 0.13.0768 (Git)
Branch: master
Hash: 5ca9ca11117873212cab6f17a0e97c9048f84f7c

I have the same problem.

Also I have a problem when I open the script, left documents are closing.

1. Create three documents
2. Open first script, third document will close
3. Open second script, second document will close

pperisin

2012-03-18 18:42

reporter   ~0001790

It is so good when you are not the only one with the issue :-)

Jriegel

2012-03-19 20:25

administrator   ~0001798

Mhh, really wired bug! Since the tab management is mostly Qt, there seams
to be a different behavior in the OpenSuse Qt package to other platforms.
Or again a grave side effect of the 3D acceleration (as mostly).

djreichel

2012-03-20 03:32

reporter   ~0001801

On Fedora 16 Qt 4.5 git commit 405e640c282edb97eb764122fc4ee87e9f5f0910
I also see the odd behavior when closing tabs. (not the video artifacts, however) If there is a document tab to the right of the tab to be closed, that document will also be closed. The log will show:
Log: Sel : Clear selection
Log: Sel : Clear selection

Closing the file in the File->Close menu option works properly.

A slightly different example: FreeCAD is launched, Start Page is displayed (in the only/left tab). Ppen a work document and make some changes. Click X to close the Start Page Tab and will be prompted to ask about saving the work document.

I do not see the problem with Version: 0.13.0674 (Git) Branch: master
Hash: 6a77635bdbb0fea476ab268234bea8d0cbe9506c Ubuntu 10.04 (Qt 4.6.2)

wmayer

2012-03-20 07:57

administrator   ~0001802

According to the last posting we have different behaviour with different Qt versions. So, to me this doesn't sound like a FreeCAD bug but rather a Qt bug maybe in combination with the window manager of the Fedore/openSuse system.

I'm using Windows + the Ubuntu versions 10.04 -- 11.10 and for none of them I have this behaviour.

djreichel

2012-03-25 00:36

reporter   ~0001810

On the fedora build there is another apparently related behavior.

Create a new document, click the X to close its tab, you are prompted to save the document, don't save or cancel. Select cancel and the same document save dialog will be presented a second time.

It looks like an OnClose event handler is being triggered twice when a tab is closed, though file close works normallly.

yorik

2012-03-25 00:41

administrator   ~0001811

Hm that would indeed explain while the other document gets closed. It would be interesting to see if the same behaviour occurs in other Qt apps that have closeable tabs...

pperisin

2012-03-25 11:42

reporter   ~0001813

Do you know any other that kind of application. I can try to install it and see...

yorik

2012-03-25 13:12

administrator   ~0001814

Last edited: 2012-03-25 13:13

Try installing arora (web browser) or dolphin (kde file manager), both have tabs...
If they work, I'll have a look at their source code to see if they make tabs a different way...

pperisin

2012-03-30 05:03

reporter   ~0001834

Hi Yorik,

I have tried both, and they do not seem to have this issue.

Regards
Petar

wmayer

2012-04-02 05:51

administrator   ~0001847

IMO it's not a direct Qt issue but again related to some OpenGL glitches.

2012-04-02 06:58

 

mdi.zip (Attachment missing)

wmayer

2012-04-02 07:00

administrator   ~0001848

Attached you find the file mdi.zip. You can build the test application with:
qmake mdi.pro (or qmake-qt4 mdi.pro)
make
./mdi

pperisin

2012-04-02 07:07

reporter   ~0001850

I have also tried to make two tabs be differrent length, to se if mouse click event is being executed twice. If they are the same length tabs and mouse click event was executed twice, boith would be closed.

It looks like it is not the problem, so it is not issue with mouse click event. if one has much longer name than another one, both are closed.

Regards
Petar

pperisin

2012-04-02 10:03

reporter   ~0001851

Last edited: 2012-04-02 10:04

Werner,

yup, it closes two tabs, also. (MDI example you made)

Regards,
Petar

pperisin

2012-04-02 10:23

reporter   ~0001852

Hi,

It looks like PyQT/PySide bug

http://code.google.com/p/spyderlib/issues/detail?id=813

Regards
Petar

wmayer

2012-04-02 17:08

administrator   ~0001865

No, this can't be a PyQt/PySide bug because the test application uses only C++ Qt, nothing else.

OK, that's good that the test application confirms the issue. So, to proceed whether it's related to an OpenGL issue you can slightly modify the source code.

Replace this line:
setCentralWidget(new QGLWidget(this));
with e.g.
setCentralWidget(new QTextEdit(this));

If it still happens then it's a general Qt bug.

wmayer

2012-04-02 17:22

administrator   ~0001866

I have installed an Ubuntu Precise which uses Qt 4.8.0 and this has exactly the same problem. For further testing I can play with my little test application.

My guess is that the QTabBar fires the signal tabCloseRequested() twice. So, a workaround could be to start a timer and if the signal is emitted twice within e.g. 1 second then the latter one will be ignored.

wmayer

2012-04-02 17:35

administrator   ~0001867

tabCloseRequested() is emitted only once per click.

Apparently Qt 4.8 (or earlier) has changed its behaviour. With older versions one had to explicitly connect the tabCloseRequested() signal to a slot function and do the close oneself. But now Qt does it on its own.

So, the solution is simple: do not connect the tabCloseRequested() signal for a newer Qt version. Now the question is for which Qt version?
Petar, what Qt version do you have?

djreichel

2012-04-03 15:52

reporter   ~0001873

This behavior is present on Fedora 16, which is also using Qt 4.8.

My other linux with freecad is Ubuntu 10.04. That uses Qt 4.6 and the tab closing works normally.

Sorry that I can't report on qt 4.7.

wmayer

2012-04-03 19:36

administrator   ~0001877

Ubuntu 11.10 uses Qt 4.7.4 and there the issue is not shown.

So, after all it seems that the new behaviour was introduced with Qt 4.8

wmayer

2012-04-03 19:44

administrator   ~0001878

git e89a93467c08192f9652653a061c146ca56c2d04 solves the issue.

Issue History

Date Modified Username Field Change
2012-03-13 14:07 pperisin New Issue
2012-03-13 14:11 pperisin File Added: 1.png
2012-03-13 14:12 pperisin File Added: 2.png
2012-03-13 14:12 pperisin File Added: 3.png
2012-03-13 14:12 pperisin File Added: 4.png
2012-03-13 14:15 pperisin Note Added: 0001764
2012-03-13 21:43 yorik Note Added: 0001770
2012-03-14 13:30 pperisin Note Added: 0001774
2012-03-17 10:36 wmayer Note Added: 0001786
2012-03-17 20:27 pperisin Note Added: 0001788
2012-03-17 20:27 pperisin Note Edited: 0001788
2012-03-18 15:32 ivanzero Note Added: 0001789
2012-03-18 18:42 pperisin Note Added: 0001790
2012-03-19 20:25 Jriegel Note Added: 0001798
2012-03-20 03:32 djreichel Note Added: 0001801
2012-03-20 07:57 wmayer Note Added: 0001802
2012-03-25 00:36 djreichel Note Added: 0001810
2012-03-25 00:41 yorik Note Added: 0001811
2012-03-25 11:42 pperisin Note Added: 0001813
2012-03-25 13:12 yorik Note Added: 0001814
2012-03-25 13:13 yorik Note Edited: 0001814
2012-03-30 05:03 pperisin Note Added: 0001834
2012-04-02 05:51 wmayer Note Added: 0001847
2012-04-02 06:58 wmayer File Added: mdi.zip
2012-04-02 07:00 wmayer Note Added: 0001848
2012-04-02 07:07 pperisin Note Added: 0001850
2012-04-02 10:03 pperisin Note Added: 0001851
2012-04-02 10:04 pperisin Note Edited: 0001851
2012-04-02 10:23 pperisin Note Added: 0001852
2012-04-02 17:08 wmayer Note Added: 0001865
2012-04-02 17:22 wmayer Note Added: 0001866
2012-04-02 17:35 wmayer Note Added: 0001867
2012-04-03 15:52 djreichel Note Added: 0001873
2012-04-03 19:36 wmayer Note Added: 0001877
2012-04-03 19:44 wmayer Note Added: 0001878
2012-04-03 19:44 wmayer Status new => resolved
2012-04-03 19:44 wmayer Fixed in Version => 0.13
2012-04-03 19:44 wmayer Resolution open => fixed
2012-04-03 19:44 wmayer Assigned To => wmayer
2012-04-04 08:35 wmayer Status resolved => closed
2012-06-25 06:40 wmayer Relationship added has duplicate 0000760