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.43k stars 898 forks source link

Keybinds are not working if there's no monitor available. #4237

Open rszyma opened 10 months ago

rszyma commented 10 months ago

Hyprland Version

Hyprland, built from branch main at commit 68e57b7ee36f015d99988f38cb3a8b83c23ae7c3 (renderer: proper full occlusion checks for back layer). Tag: v0.32.3-79-g68e57b7e flags: (if any)

Bug or Regression?

Bug

Description

I've set up a keybinding that runs a script that cycles between monitor configs. It works as long as at least 1 monitor is enabled, and if no monitors are available the keybind don't work and I'm stuck on black screen unless I kill Hyprland, go to tty, run the script manually and start Hyprland again.

How to reproduce

  1. Disable all monitors
  2. Press some keybind
  3. The keybind doesn't work

Crash reports, logs, images, videos

No response

vaxerski commented 10 months ago

IIRC in unsafe state keybinds are purposefully disabled. What's the keybind?

rszyma commented 10 months ago

What's the keybind?

bind = SUPERSHIFT, H, exec, ~/.config/hypr/scripts/switch-monitors-cfg

switch-monitors-cfg is bash script that uses sed to change monitors config path between:

source = ~/.config/hypr/configs/monitors/0.conf

and

source = ~/.config/hypr/configs/monitors/1.conf
rszyma commented 10 months ago

IIRC in unsafe state keybinds are purposefully disabled

What is the reason? IG some dispatchers don't make sense to call when no monitor is available e.g. moving windows around, so maybe only allow some dispatchers selectively? I think exec should be ok to allow.

vaxerski commented 10 months ago

true

rszyma commented 10 months ago

Cool. Are you planning to work on this anytime soon?

vaxerski commented 10 months ago

no clue. You can make a mr, that would help speed this up.

kik4444 commented 7 months ago

Just came across the same issue myself. I noticed none of my shortcuts work when no monitors are enabled, not just shortcuts related to monitors. This poses a problem especially when I disconnect my external monitor, but then can't use the shortcut to re-enable my builtin monitor.

vaxerski commented 7 months ago

keybindmanager.cpp:291 remove check for unsafe state and it should work I guess

TalinTheDev commented 3 months ago

I have this problem too and it is kind of an issue since I can't switch monitors to my laptop after unplugging the HDMI cable.