MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
291 stars 180 forks source link

MRview erroneous toolbars on dual screen #249

Open Lestropie opened 9 years ago

Lestropie commented 9 years ago

I'm taking a guess that this is a dual-screen problem, but I suspect it's the case.

Sometimes when opening a toolbar, the dock widget gets drawn twice: once where it should be (i.e. docked on the right side of the main window), and once floating on the other screen. The first is drawn, but does not respond to user inputs; the second does, and so needs to be dragged across screens to where it should be. The second one often also has visual glitches, e.g. buttons & check boxes drawn, but not the background.

May well be a QT bug, but is worth looking into.

thijsdhollander commented 9 years ago

I get this as well, just as you describe it, apart from 1 important difference: the wrongly drawn one never floats on the other screen, but appears as if it's "docked" (well, not really) to the top left corner of the main window... so not sure if it's a dual-screen thing (due to how it appears in my case, I would actually guess it's not). Here's what it looks like when it happens (not deterministically reproducible):

screenshot from 2015-05-07 17 12 36

Simply opened an image, played a bit around with the contrast and colour map, opened the overlay tool, and this came out. Simply changing anything else about the window layout (slightly nudging any window corner/edge/divider, etc...) instantly fixed it again. Looks like a QT bug to me.

thijsdhollander commented 9 years ago

Tested some more: when things go right (as in, not like the screenshot) sometimes I actually see something flashing for a split second on the left hand side before the dock appears on the right hand side. I guess the supposed QT bug sometimes accidentally doesn't cause a redraw of that left hand side area. Hence, the crap is still there, as in the screenshot.

draffelt commented 9 years ago

I get something similar, however it also happens with only a single screen too.

I open an image then open the ODF tool, it will very briefly be displayed (as per Thijs screen) before being rendered correctly on the right hand side. This is reproducible for me.

On Thu, May 7, 2015 at 5:20 PM, Thijs Dhollander notifications@github.com wrote:

I get this as well, just as you describe it, apart from 1 important difference: the wrongly drawn one never floats on the other screen, but appears as if it's "docked" (well, not really) to the top left corner of the main window... so not sure if it's a dual-screen thing (due to how it appears in my case, I would actually guess it's not). Here's what it looks like when it happens (not deterministically reproducible):

[image: screenshot from 2015-05-07 17 12 36] https://cloud.githubusercontent.com/assets/11952694/7510150/85b844a2-f4dc-11e4-956d-1938c76e6147.png

Simply opened an image, played a bit around with the contrast and colour map, opened the overlay tool, and this came out. Simply changing anything else about the window layout (slightly nudging any window corner/edge/divider, etc...) instantly fixed it again. Looks like a QT bug to me.

— Reply to this email directly or view it on GitHub https://github.com/MRtrix3/mrtrix3/issues/249#issuecomment-99753170.

draffelt commented 9 years ago

When I say briefly, it's a flash as Thijs mentioned. It never stays there for me..

On Thu, May 7, 2015 at 5:28 PM, Thijs Dhollander notifications@github.com wrote:

Tested some more: when things go right (as in, not like the screenshot) sometimes I actually see something flashing for a split second on the left hand side before the dock appears on the right hand side. I guess the supposed QT bug sometimes accidentally doesn't cause a redraw of that left hand side area. Hence, the crap is still there, as in the screenshot.

— Reply to this email directly or view it on GitHub https://github.com/MRtrix3/mrtrix3/issues/249#issuecomment-99754128.

jdtournier commented 9 years ago

OK, it probably is a Qt issue, and will probably depend on what version of Qt you're running under what desktop environment...

That said, I reckon this will have something to do with the assault course we have to go through to have the Tools pop up where we want them. I remember @draffelt had a fair bit of fun with that, and I had a go more recently. The problem there is to get the dock widget to be a sensible size when it appears, which is (or at least was) remarkably hard to achieve. The current solution IIRC is to show it first as floating, which somehow gets it to set itself up with the appropriate size, then dock it (if that's the setup in the config file). So that brief flash of the Tool is most likely what you're all describing...

Actually, on second thoughts, the real issue is that if the widget is shown docked, the main window resizes to accomodate it as if it was going to be shown below the existing dock widgets, even when the dock area is set to use tabbed widgets... The workaround is to show the widget as floating first, then dock afterwards...

If anyone feels like having a go at sorting this out, please feel free...

thijsdhollander commented 9 years ago

Tested yet some more. :-) So I do (deterministically) always get the flash (as in Dave's case), but only sometimes does the thing "stick". Also: when loading multiple tools: each tool only gets to do "the flash" once. If I close a particular tool, and reopen it using the tool menu, it doesn't flash. So it doesn't happen if the tool was already loaded at least once (i.e. when it already appears in the menu that you get when right clicking the main toolbar). Also, when I open a tool initially not through the Tool menu, but by the Ctrl+Fkey combination, the flash happens on the right hand side. It can stick there as well, but it happens less often. Here's a case where I already opened some tools (with Ctrl+Fkey), and then the tractography tool with Ctrl+F4:

screenshot from 2015-05-07 17 49 07