wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.11k stars 1.21k forks source link

Resizing window causes flickering in wails apps in Linux/Kwin #1655

Closed kelvie closed 2 years ago

kelvie commented 2 years ago

Description

This happens in the svelte demo app, but it also happens with wombat 0.5.0 downloaded from their site: https://github.com/rogchap/wombat/releases/tag/v0.5.0

To Reproduce

  1. Start wombat, or wails dev in Linux
  2. resize the window

Expected behaviour

That it resizes smoothly, like on Mac, for example.

Screenshots

https://user-images.githubusercontent.com/5893/180896667-bace77f3-f1b2-4ee8-ba65-e310e0091d4c.mp4

Attempted Fixes

No response

System Details

Wails CLI v2.0.0-beta.42

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Arch Linux
Version:        Unknown
ID:             arch
Go Version:     go1.18.4
Platform:       linux
Architecture:   amd64

Wails
------
Version:                v2.0.0-beta.42
Package Manager:        pacman

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
*docker         docker          Installed       1:20.10.17-1
gcc             gcc             Installed       12.1.0-3
libgtk-3        gtk3            Installed       1:3.24.34-1
libwebkit       webkit2gtk      Installed       2.36.4-2
npm             npm             Installed       8.15.0-1
pkg-config      pkgconf         Installed       1.8.0-1

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony


### Additional context

I use a nvidia graphics card, and KDE plasma 5.96.0 on X11.

I have tried turning the compositor both on and off on kwin.
leaanthony commented 2 years ago

Hi. I believe this is a local issue, potentially related to gtk/kde integration WRT transparency on your system, and not a Wails bug, for the following reasons:

Closing this for now but if someone else can reproduce it or you can track down exactly how this is a Wails bug, then we will reopen it 👍

kelvie commented 2 years ago

It looks like I reproduced it using a webkit2gtk example program, so it's probably there. I'll do some more digging.

leaanthony commented 2 years ago

Nice find 👍 Perhaps try a non WebKit program too. I suspect there's some clash with your transparency plugin that triggers based on a repaint or something. Perhaps WebKit is issuing a crazy amount of repaints.

kelvie commented 2 years ago

This definitely doesn't happen on any other GUI app I use (including chrome, but that uses its own bundled webkit). I also tried it with compositing off, which disables any effects like transparency, so I don't think it's that, but it still might be the window manager.

I'll try this on sway/wayland and perhaps another lightweight X11 window manager. Either way it's not a wails bug (directly).

leaanthony commented 2 years ago

There's a lot of hits when you google "gtk window flickering when resizing". I've reproduced it on my re-installed laptop. Do you see this issue @ianmjones ?

This is an interesting article: http://www.ruska.it/michal/flicker.html

ianmjones commented 2 years ago

I don't see this issue with b42 and the example app on NixOS unstable using i3-gaps and picom with Nvidia hardware. :shrug:

I listed all those things because I agree that it's very likely an issue fixed by some config or video driver change, and not something that can be fixed in wails.