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
21.25k stars 896 forks source link

kgx, foot, code-oss, and others apps close when unplugging thunderbolt monitor #3267

Closed cypresslf closed 1 year ago

cypresslf commented 1 year ago

Hyprland Version

Hyprland, built from branch at commit 96d555e8e794627bfc561e294e148ab8a9961fcc dirty (). Tag: v0.29.1 flags: (if any)

Bug or Regression?

Regression

Description

If I unplug my monitor from my laptop, several apps close. I haven't tested this thoroughly, but I've observed

Code-OSS kgx (gnome-console) foot

all close

Firefox stays open for some reason

How to reproduce

open the mentioned apps and firefox. Plug into a BenQ PD3220U via thunderbolt. Unplug. Screen turns off briefly. When it turns back on, all apps except for firefox are closed.

hyprctl monitors        
Monitor eDP-1 (ID 0):
    3456x2160@60.000999 at 0x0
    description: Samsung Display Corp. 0x414D (eDP-1)
    make: Samsung Display Corp.
    model: 0x414D
    serial: 
    active workspace: 3 (3)
    special workspace: 0 ()
    reserved: 0 0 0 0
    scale: 1.50
    transform: 0
    focused: no
    dpmsStatus: 1
    vrr: 0

Monitor DP-2 (ID 1):
    3840x2160@59.997002 at 2304x0
    description: BNQ BenQ PD3220U J7K01266019 (DP-2)
    make: BNQ
    model: BenQ PD3220U
    serial: J7K01266019
    active workspace: 1 (1)
    special workspace: 0 ()
    reserved: 0 0 0 0
    scale: 1.00
    transform: 0
    focused: yes
    dpmsStatus: 1
    vrr: 0

After the apps close, if I open a new terminal I can confirm that there are no clients except for the new terminal window anf firefox:

hyprctl clients 
Window 5567028d4920 -> New Issue · hyprwm/Hyprland — Mozilla Firefox:
    mapped: 1
    hidden: 0
    at: 4231,7
    size: 1906,2146
    workspace: 1 (1)
    floating: 0
    monitor: 1
    class: firefox
    title: New Issue · hyprwm/Hyprland — Mozilla Firefox
    initialClass: firefox
    initialTitle: Mozilla Firefox
    pid: 4196
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

Window 5567028f5350 -> cypress@jig:~:
    mapped: 1
    hidden: 0
    at: 2311,7
    size: 1906,2146
    workspace: 1 (1)
    floating: 0
    monitor: 1
    class: org.gnome.Console
    title: cypress@jig:~
    initialClass: org.gnome.Console
    initialTitle: 
    pid: 5782
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

Any tips for finding the logs related to these closures would be appreciated. I'm unsure if they are closing cleanly or crashing.

Crash reports, logs, images, videos

No response

cypresslf commented 1 year ago

If relevant: I was using waybar. I did a pkill -9 waybar to reproduce without it, and it still occurred.

cypresslf commented 1 year ago

my entire config is mostly the default, with a couple modifications to display scaling for my built-in display and my work display (not the one I'm having the issue with). I don't have any dynamic rules for changing displays other than exec-once = swayidle -w timeout 500 'swaylock' timeout 505 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'

# change monitor to high resolution, the last argument is the scale factor
monitor=,preferred,auto,auto

# work desk monitor, don't scale
monitor=DP-7,preferred,auto,1

# builtin monitor, scale less
monitor=eDP-1,preferred,auto,1.5

exec-once = waybar
exec-once = dunst
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = swaybg -i Pictures/otters.jpg
exec-once = swayosd-server
exec-once = swayidle -w timeout 500 'swaylock' timeout 505 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'

# use intel graphics card for hyprland to save power, fallback to nvidia
env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1

# prevent ssh from asking for passphrase every time
env = SSH_AUTH_SOCK,$XDG_RUNTIME_DIR/gcr/ssh

xwayland {
  force_zero_scaling = true
}

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options = altwin:ctrl_alt_win,ctrl:lalt,ctrl:swap_rwin_rctl,caps:escape
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = yes
        clickfinger_behavior = yes
        tap-to-click = false
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 5
    gaps_out = 5
    border_size = 2
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    layout = dwindle
    resize_on_border = true
    hover_icon_on_border = false
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 10

    blur {
        enabled = true
        size = 3
        passes = 1
    }

    drop_shadow = yes
    shadow_range = 4
    shadow_render_power = 3
    col.shadow = rgba(1a1a1aee)
}

animations {
    enabled = yes

    # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.05, 0.9, 0.1, 1.03

    animation = windows, 1, 4, myBezier
    animation = windowsOut, 1, 4, default, popin 80%
    animation = border, 1, 10, default
    animation = borderangle, 1, 8, default
    animation = fade, 1, 4, default
    animation = workspaces, 1, 6, default
    animation = specialWorkspace, 1, 1, default, fade
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = true
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = on
}

misc {
    disable_hyprland_logo = true
    disable_splash_rendering = true
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
    sensitivity = -0.5
}

# always float the authentication prompt
windowrule = float, org.kde.polkit-kde-authentication-agent-1

# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$l
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more

# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, killactive,
bind = $mainMod, W, exec, killall waybar && waybar
bind = $mainMod SHIFT, Q, exit,
bind = $mainMod, L, exec, swaylock
bind = $mainMod, F, fullscreen,
bind = $mainMod SHIFT,S,movetoworkspace,special
bind = $mainMod, S,togglespecialworkspace,
bind = $mainMod, E, exec, nautilus
bind = $mainMod, Space, togglefloating, 
bind = $mainMod, R, exec, tofi-drun | xargs hyprctl dispatch exec --
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, D, exec, darkman toggle
bind=,Print,exec,filename=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s.png') && grim -g "$(slurp)" $filename && wl-copy < $filename --type image/png

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Multimedia
bindle=, XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise
bindle=, XF86AudioLowerVolume, exec, swayosd-client --output-volume lower
bindl=, XF86AudioMute, exec, swayosd-client --output-volume mute-toggle
bind=, XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle
bindl=, XF86AudioPlay, exec, playerctl play-pause
bindl=, XF86AudioPause, exec, playerctl play-pause
bindl=, XF86AudioNext, exec, playerctl next
bindl=, XF86AudioPrev, exec, playerctl previous

# Screen brightness
binde=, XF86MonBrightnessUp, exec, brightnessctl s +5%
binde=, XF86MonBrightnessDown, exec, brightnessctl s 5%-

# Lock screen when lid closed
bindl=,switch:Lid Switch,exec,swaylock
vaxerski commented 1 year ago

fixed in git