Page MenuHomePhabricator

MITK main window comes top when moving mouse over it
Closed, ResolvedPublic

Description

If you have the console on top and move your mouse over the MITK main window it comes on top automatically. This is very confusing.

This behaviour is caused by the code

#ifdef Q_OS_MAC

this->show();
this->setWindowOpacity(0.0f);

#else

this->setVisible(false);

#endif

in file QmitkRenderWindowMenu.cpp.

It may work when using the Mac OS code also for windows.

Event Timeline

What is the status of this bug? Please change the target milestone to "AfterNextRelease" if this bug is not relevant or cannot be fixed in time for the 2013-06 release.

New remote branch pushed: bug-12130-ConsoleBug

Current release is finished. Reseting target milestone...

[9f4b84]: Merge branch 'bug-12130-ConsoleBug'

Merged commits:

2013-11-27 16:10:41 Alfred Franz [a7b62e]
Now using the Mac implementation also for Windows because it fixes a bug there (caution: Linux still needs the other implementation to avoid a bug!)

Hi, seems that setWindowOpacity() leads to flickering in Windows (tested with Qt 5.3.2). Instead, setting null parent helps avoiding the problem as well as the flickering.

The problem there is that when a widget of type Qt::Tool is shown, the raise() method is called which leads to the whole window (probably propagated through parent-child relationship) is raised. To overcome this, I used a different approach - initialize the widget with parent set to NULL and saving the parent widget in a separate variable for positioning. To avoid mem leak, connecting destroyed() signal of parent object to deleteLater() slot of the menu object helps.

Please find the patch attached. The Mac behaviour is left as is because I don't have the means to test it on Mac.

We had the same problem with MITK 2014.10 and the attached patch solved the problem for us as well.

The attached patch works fine on mac.

User cordes has pushed new remote branch:

bug-12130-MitkWindowComesTop-patch

[eee3c3]: Merge branch 'bug-12130-MitkWindowComesTop-patch'

Merged commits:

2015-03-18 16:54:55 Jonas Cordes [e65a8f]
initialize the widget with parent set to NULL and saving the parent widget in a separate variable for positioning