ModernDocking icon indicating copy to clipboard operation
ModernDocking copied to clipboard

Bad Flicking on Linux with Integrated Graphics

Open andrewauclair opened this issue 1 year ago • 14 comments

Looks like the overlays flicker on and off really bad when dragging a window in Gnome on Arch.

andrewauclair avatar May 13 '24 01:05 andrewauclair

Played around with this for a while and reducing the number of repaint helps. I'm wondering if it's because I'm on an old laptop with integrated graphics. I'm sure that doesn't help.

andrewauclair avatar May 14 '24 02:05 andrewauclair

~~This will be fixed with the overlay refactor and was finally achieved by using a BufferStrategy instead of manually repainting the JFrame.~~

This didn't work out in the end. Need to test on a archlinux machine with an actual graphics card.

andrewauclair avatar May 16 '24 01:05 andrewauclair

Same issue on Linux Mint 21.1 with integrated graphics. Laptop is fairly new though. The flickering causes a huge lag.

https://github.com/user-attachments/assets/f31c18aa-59b9-464b-9644-c7601354e2a8

Edit: After some unsuccessful tinkering with the source code, I figured out the root cause is renderPanel.setOpaque(false) inside FloatUtilsFrame. However, I was unable to fix it

This 11-year-old stackoverflow question describes the exact problem, but it has no answer

Mino260806 avatar Aug 02 '24 15:08 Mino260806

Interesting. That is the exact behavior I've seen on Arch. Maybe integrated graphics is the common issue. I had found a fix for it, but it broke the windows side of Modern Docking. I'll look into some way that I can do Linux specific code.

andrewauclair avatar Aug 03 '24 16:08 andrewauclair

Maybe integrated graphics is the common issue.

Maybe it's an issue with Gnome rather than integrated graphics? The person in the SO question mentions having "nvidia drivers", so he most likely has dedicated graphics.

Did you confirm it works in a linux computer with dedicated graphics ?

I had found a fix for it, but it broke the windows side of Modern Docking

Why don't you put a check on the OS type and operate accordingly ?


There is something else to point out, the overlay thinks the window size is bigger than it originally is, so the right and bottom handles overflow the screen (see video again). Did you also find a fix for this ?

Mino260806 avatar Aug 03 '24 17:08 Mino260806

Maybe it's an issue with Gnome rather than integrated graphics? The person in the SO question mentions having "nvidia drivers", so he most likely has dedicated graphics.

Did you confirm it works in a linux computer with dedicated graphics ?

Yes. I use this at work on Gnome on CentOS and haven't encountered this issue there.

I had found a fix for it, but it broke the windows side of Modern Docking

Why don't you put a check on the OS type and operate accordingly ?

That's likely what I'll try.


There is something else to point out, the overlay thinks the window size is bigger than it originally is, so the right and bottom handles overflow the screen (see video again). Did you also find a fix for this ?

That is intentional. The overlap frame is larger to account for drawing handles off the edge of the main frame.

andrewauclair avatar Aug 03 '24 19:08 andrewauclair

Maybe integrated graphics is the common issue.

Good news. I finally had the time and energy to fix this. I believe I have a working solution. The common issue appears to be integrated graphics not supporting multi-buffer. Wrote some code that will work one way for multi-buffer and another when it's not available and have tested that.

There is something else to point out, the overlay thinks the window size is bigger than it originally is, so the right and bottom handles overflow the screen (see video again). Did you also find a fix for this ?

Sorry, I just realized this is actually an issue. Looks to be specific to using the application in full screen mode. Looking into it now.

andrewauclair avatar Aug 17 '24 20:08 andrewauclair

I recently acquired a new Windows 11 laptop with integrated graphics and verified that this does not happen there.

andrewauclair avatar Jan 27 '25 12:01 andrewauclair