NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.53k stars 13.02k forks source link

gdm: display fixed at 1024x768 on wayland #181186

Open 3nprob opened 1 year ago

3nprob commented 1 year ago

Describe the bug

When running qtile via wayland-enabled gdm, the output is only utilizing the top right left 1024x768 corner of the display.

Intel i915 laptop with built-in display.

Steps To Reproduce

services.xserver = {
      enable = true;
      screenSection = ''
        Option "DPI" "192 x 192"
      '';
      serverFlagsSection = ''
        Option "DontZap" "true"
      '';
      dpi = 120;
      windowManager.qtile = {
          enable = true;
          extraOptions = "-b wayland";
      };
      desktopManager.gnome.enable = true;
      displayManager = {
        gdm = {
          enable = true;
          wayland = true;
        };
        defaultSession = "none+qtile";
      };

      libinput.enable = true;
};
xdg.portal = {
      enable = true;
      extraPortals = with pkgs; [
        xdg-desktop-portal-wlr
        # xdg-desktop-portal-gtk # conflicts
      ];
      gtkUsePortal = true;
};
programs.xwayland.enable = true; # or false; same behavior
hardware = {
    cpu.intel = {
      updateMicrocode = true;
    };
    opengl = {
      enable = true;
      driSupport32Bit = true;
      extraPackages = with pkgs; [
        vaapiIntel
        vaapiVdpau
        libvdpau-va-gl
      ];
    };
};

Expected behavior

The native resolution is available.

Additional context

$ xrandr
Screen 0: minimum 16 x 16, current 1024 x 768, maximum 32767 x 32767
XWAYLAND0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      59.92*+

qtile.extraOptions comes from https://github.com/3nprob/nixpkgs/commit/deb5fb2a8cce56c986e1aff23340cdeedde2a675

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.50, NixOS, 22.05 (Quokka), 22.05.git.b64476b70cddM`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(legogris): `"nixos-unstable-small, nixpkgs, unstable"`
 - channels(root): `"nixos-22.05, nixpkgs"`
 - nixpkgs: `/home/user/nix-defexpr/channels/nixpkgs`
3nprob commented 1 year ago

The issue is not present when starting qtile via greetd using the same approach as in the wiki.

Lillecarl commented 1 year ago

I'm seeing the same issue with SDDM, not sure if it's wayland enabled or not (Added the DisplayServer=wayland config to sddm.conf, but I'm still running an X process under SDDM).

Could you share more of your qtile config perhaps?

compguy284 commented 1 year ago

I think it has something to do with the qtile session file being in share/xsessions instead of share/wayland-sessions

this is what i get when i run wlr-randr

X11-1 "X11 output 1"
  Make: The X.Org Foundation
  Model: 11.0
  Serial: (null)
  Enabled: no
  Modes:
    0x0 px
Lillecarl commented 1 year ago

@compguy284 did you dig deeper into this?

compguy284 commented 1 year ago

@Lillecarl i was able to get it working using an overlay.

final: prev: {
  qtile-unwrapped = prev.qtile-unwrapped.overrideAttrs (new: old: {
    passthru.providedSessions = ["qtile" "qtile-wayland"];
    postPatch = old.postPatch + ''
      mkdir -p $out/share/wayland-sessions
      mkdir -p $out/share/xsessions
      install resources/qtile.desktop -Dt $out/share/xsessions
      install resources/qtile-wayland.desktop -Dt $out/share/wayland-sessions
    '';
  });
}

i also add the following to configuration.nix services.xserver.displayManager.sessionPackages = [ pkgs.qtile-unwrapped ];

theshatterstone commented 11 months ago

@compguy284 Thank you so much for that! It means that se now have both an X11 and Wayland session and they both work! The problem is that for some reason, I still get the old "none+qtile" X11 session which doesn't work, alongside the regular "Qtile" X11 session which works. Do you know why that is? Is there a way to get rid of this "ghost session"? Thanks.

Edit: Forget the ghost session, I'm having a more serious issue. When trying to launch Qtile Wayland on a cold boot, the system sends me to a tty. But when I try logging in to Qtile Wayland after I've entered another session e.g. AwesomeWM and exited it, then Qtile Wayland launches and works perfectly.