slint icon indicating copy to clipboard operation
slint copied to clipboard

Window does not render correctly with SLINT_NO_QT and Wayland

Open wolfseifert opened this issue 1 year ago • 6 comments

The program

slint::slint! {
  export component HelloWorld inherits Window {
    title: "Helloworld";
    Text {
      text: "Hello World from Slint!";
      font-size: 30px;
    }
    preferred-width: 750px;
    preferred-height: 500px;
  }
}
fn main() {
  HelloWorld::new().unwrap().run().unwrap();
}

appears with a partially transparent background first helloworld and needs a manual resize to render correctly helloworld-resized

This happens with SLINT_NO_QT and Wayland only!

It works on Windows, X11, Wayland with backend-qt.

It also happens with the C++ version:

#include "helloworld.h"
auto main() -> int {
  HelloWorld::create()->run();
}
export component HelloWorld inherits Window {
  title: "Helloworld";
  Text {
    text: "Hello World from Slint!";
    font-size: 30px;
  }
  preferred-width: 750px;
  preferred-height: 500px;
}

wolfseifert avatar Feb 02 '24 05:02 wolfseifert

I have similar problem. version 1.40(rust) does not update widgets until the window size is changed on windows 11.

slint::slint! {
    import {LineEdit,TextEdit} from "std-widgets.slint";

    export component HelloWorld inherits Window {
      title: "bug 1.40";
      VerticalLayout{
            Text {
              text: "Any widget won't update properly until you click on LineEdit to give it focus and then drag the window size.";
            }
            LineEdit {
            }
           TextEdit {
           }
      }
      preferred-width: 750px;
      preferred-height: 500px;
    }
  }
  fn main() {
    HelloWorld::new().unwrap().run().unwrap();
  }

Jhonfunk avatar Feb 02 '24 07:02 Jhonfunk

@Jhonfunk

I can confirm: your program works on Linux/KDE using X11, but is erroneous using Wayland.

Must be something with the GL based backend on Wayland and Windows.

wolfseifert avatar Feb 02 '24 07:02 wolfseifert

Thanks for reporting this. Could you let us know what compositor you're using with wayland?

I've been trying with Gnome and Ubuntu 23.10, but it works there :(

Which version of Slint are you using?

tronical avatar Feb 02 '24 08:02 tronical

I wonder if https://github.com/rust-windowing/winit/pull/3446 fixes this perhaps.

tronical avatar Feb 02 '24 08:02 tronical

OS:

Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Kernel Version: 6.8.0-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LG Electronics
Product Name: 17Z90P-G.AA89G
System Version: 0.1

Compositor:

$ inxi -Gxx
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: LG driver: i915
    v: kernel arch: Gen-12.1 ports: active: eDP-1 empty: DP-1,DP-2,HDMI-A-1
    bus-ID: 00:02.0 chip-ID: 8086:9a49
  Device-2: Chicony LG Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 3-2:3 chip-ID: 04f2:b6fa
  Display: wayland server: X.org v: 1.21.1.11 with: Xwayland v: 23.2.4
    compositor: kwin_wayland driver: X: loaded: modesetting
    alternate: fbdev,vesa dri: iris gpu: i915 display-ID: 0
  Monitor-1: eDP-1 res: 2560x1600 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 1 drv: swrast
    surfaceless: drv: iris wayland: drv: iris x11: drv: iris inactive: gbm
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 23.3.4-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel Xe Graphics (TGL GT2)
    device-ID: 8086:9a49 display-ID: :1.0
  API: Vulkan v: 1.3.276 surfaces: xcb,xlib,wayland device: 0
    type: integrated-gpu driver: mesa intel device-ID: 8086:9a49

Slint is 1.4.0

I could also try Kubuntu 23.10 and Manjaro Linux with GNOME, if that helps.

wolfseifert avatar Feb 02 '24 09:02 wolfseifert

I reproduced the issue with Kubuntu 23.10.

Using Manjaro Linux with GNOME the problem does NOT appear.

Probably you need a KDE-Desktop to reproduce the issue, or at least compositor: kwin_wayland instead of compositor: gnome-shell.

wolfseifert avatar Feb 02 '24 15:02 wolfseifert

I have the same issue on my Gentoo+KDE+Wayland machine.

KDE 5.27.10 kwayland 5.113.0 plasma-wayland-protocols 1.12.0 wayland 1.22.0 wayland-protocols 1.32

serpack avatar Feb 05 '24 16:02 serpack

UPD.

I wonder if rust-windowing/winit#3446 fixes this perhaps.

After I have changed dependencies to slint = { git = "https://github.com/slint-ui/slint.git"} the problem seems to be fixed, for me at least.

serpack avatar Feb 05 '24 16:02 serpack

Then closing this issue as this is a bug in winit

ogoffart avatar Feb 05 '24 17:02 ogoffart