hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.91k stars 849 forks source link

External display flickers when switching window focus on main display #6127

Open neilking01 opened 4 months ago

neilking01 commented 4 months ago

Hyprland Version

v0.40.0

Bug or Regression?

Bug

Description

External screen flickers sometimes when switching window focus.

Please see video: https://youtu.be/FTt0BPJ43Cg

How to reproduce

Its intermittent. Not sure what triggers it. Am using Arch on a Dell XPS 13 Plus.

Crash reports, logs, images, videos

No response

vaxerski commented 4 months ago

what if you open a window on the display?

neilking01 commented 4 months ago

I've seen it happening with windows on the display too. It's intermittent, so hard to reproduce. I'm sticking to v0.38.1 for now but can tempararily test v0.40.0 if there are more things you want me to try that will help in fixing the bug.

vaxerski commented 4 months ago

does that mean it's a regression? You haven't marked it as such.

neilking01 commented 4 months ago

I'm not sure if this specific bug has been reported before by someone else. If you're referring to a similar bug that I reported, this one is slightly different in that a large portion of the screen flickers rather than a specific window that overlaps displays.

ajmasia commented 3 months ago

The same here on external monitor using HDMI with AMD Ryzen winth NixOS Unstable

Hyprland 0.41.1

https://github.com/hyprwm/Hyprland/assets/23419327/7e56f804-12f4-4d52-bdd5-0e0422e314cb

I've noted that it;s more frequent using Firefox

Hyprland module

{ inputs, pkgs, ... }:
# let
#   openglPackage = pkgs.mesa.drivers;
#   openglPackage32 = pkgs.pkgsi686Linux.mesa.drivers;
# in
{

  programs.hyprland = {
    enable = true;

    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    xwayland.enable = true;

    portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override
      {
        inherit (pkgs) mesa;
      };

    # https://github.com/hyprwm/Hyprland/issues/5148
    # portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
    #   inherit (pkgs) mesa;
    # };
  };

  programs.dconf.enable = true;

  environment.sessionVariables = {
    NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland
    MOZ_ENABLE_WAYLAND = "1"; # ensure enable wayland for Firefox
    WLR_RENDERER_ALLOW_SOFTWARE = "1"; # enable software rendering for wlroots
    WLR_NO_HARDWARE_CURSORS = "1"; # disable hardware cursors for wlroots
    NIXOS_XDG_OPEN_USE_PORTAL = "1"; # needed to open apps after web login
  };

  services = {
    # Applications messaging system
    dbus = {
      enable = true;

      packages = with pkgs; [
        gcr # crypto services (from gnome)
        dconf # settings daemon (from gnome)
      ];
    };
  };

  xdg = {
    portal = {
      enable = true;

      extraPortals = with pkgs; [
        xdg-desktop-portal-gtk
      ];
      configPackages = [
        pkgs.xdg-desktop-portal-gtk
      ];
    };
  };

  hardware = {
    opengl =
      {
        enable = true;

        # package = openglPackage;
        # package32 = openglPackage32;

        driSupport = true;
        driSupport32Bit = true;
      };
  };
}