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

How to set window focus in Hyprland to return to the original window after closing the popup dialog? #7579

Closed Guan9Wu closed 1 month ago

Guan9Wu commented 2 months ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259 (props: bump version to 0.42.0). Date: Wed Aug 7 19:17:10 2024 Tag: v0.42.0, commits: 5069 flags: (if any) System Information: System name: Linux Node name: ************** Release: 6.10.6-zen1-1-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Mon, 19 Aug 2024 17:02:05 +0000 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c) (prog-if 00 [VGA controller]) os-release: NAME=ArcoLinux ID=arcolinux ID_LIKE=arch BUILD_ID=rolling ANSI_COLOR="0;36" HOME_URL="https://arcolinux.info/" SUPPORT_URL="https://arcolinuxforum.com/" BUG_REPORT_URL="https://github.com/arcolinux" LOGO=arcolinux-hello plugins: hyprfocus by Vortex ver 2.0 ======Config-Start====== Config File: /home/guan9/.config/hypr/hyprland.conf: Read Succeeded # _ _ _ _ # | | | |_ _ _ __ _ __| | __ _ _ __ __| | # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | # | _ | |_| | |_) | | | | (_| | | | | (_| | # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| # |___/|_| # # ----------------------------------------------------- # Monitor # ----------------------------------------------------- # See https://wiki.hyprland.org/Configuring/Monitors/ # monitor=,preferred,auto, monitor=eDP-1,2560x1600@60,0x0,1.33 monitor=HDMI-A-1,1920x1080@60,-1920x0,1 # monitor=eDP-1,2560x1600@60,0x0,1.6 # monitor=HDMI-A-1,1920x1080@60,1600x0,1 $ConfigDir=$HOME/.config $HyprDir=$ConfigDir/hypr $ScriptDir=$HyprDir/scripts $HyprConfDir=$HyprDir/conf # ----------------------------------------------------- # Autostart # ----------------------------------------------------- source = $HyprConfDir/autostart.conf # ----------------------------------------------------- # Environment # ----------------------------------------------------- source = $HyprConfDir/environment.conf # ----------------------------------------------------- # Keyboard # ----------------------------------------------------- source = $HyprConfDir/device.conf # ----------------------------------------------------- # Load pywal color file # ----------------------------------------------------- source = ~/.cache/wal/colors-hyprland.conf # ----------------------------------------------------- # Load configuration files # ----------------------------------------------------- source = $HyprConfDir/window.conf source = $HyprConfDir/decoration.conf source = $HyprConfDir/layout.conf source = $HyprConfDir/misc.conf source = $HyprConfDir/keybinding.conf source = $HyprConfDir/windowrule.conf # ----------------------------------------------------- # Animation # ----------------------------------------------------- source = $HyprConfDir/animation.conf # ----------------------------------------------------- # Custom # ----------------------------------------------------- # source = $HyprConfDir/custom.conf Config File: /home/guan9/.config/hypr/conf/autostart.conf: Read Succeeded # ----------------------------------------------------- # Autostart # ----------------------------------------------------- # To fix issue: Programs don’t work in systemd services, but do on the terminal exec-once = dbus-update-activation-environment --systemd --all # Load Notification Manager exec-once = $ScriptDir/notification.sh # Initialize waypaper exec-once = ~/.azotebg-hyprland # Launch Waybar exec-once = $ConfigDir/waybar/launch.sh # Load GTK settings exec-once = ~/$ScriptDir/gtk.sh # set cursor theme and size exec-once = hyprctl setcursor Bibata-Modern-Ice 16 # Setup XDG for screen sharing exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = ~/$ScriptDir/xdg-portal.sh # Start Polkit exec-once = /usr/lib/polkit-kde-authentication-agent-1 # Using hypridle to start hyprlock exec-once = hypridle # Load cliphist history exec-once = wl-clip-persist --clipboard regular exec-once = wl-paste --watch cliphist store # Start ewww daemon # exec-once = $ScriptDir/eww.sh # Start autostart cleanup exec-once = ~/$ScriptDir/cleanup.sh # Xauthority exec-once = $ScriptDir/xauthority.sh # Input method exec-once = fcitx5 --replace -d # NetworkManager exec-once = nm-applet & # Blueman for bluetooth exec-once = blueman-applet & # Hyprpm exec-once = hyprpm reload -n # Aria2 exec-once = aria2c & # Terminal # exec-once = [workspace 1 silent] alacritty # Obsidian exec-once = [workspace 2] obsidian # Auto mount exec-once = udiskie & Config File: /home/guan9/.config/hypr/conf/environment.conf: Read Succeeded # ----------------------------------------------------- # Environment Variables # name: "Default" # ----------------------------------------------------- # Set the cursor size for xcursor env = XCURSOR_SIZE,16 # XDG Desktop Portal env = XDG_CURRENT_DESKTOP, Hyprland env = XDG_SESSION_TYPE, wayland env = XDG_SESSION_DESKTOP, Hyprland # QT env = QT_QPA_PLATFORM, wayland;xcb env = QT_QPA_PLATFORMTHEME, qt6ct env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1 env = QT_AUTO_SCREEN_SCALE_FACTOR, 1 # env = QT_STYLE_OVERRIDE, kvantum # GTK env = GDK_BACKEND, wayland,x11,* env = GDK_SCALE, 1 # SDL # env = SDL_VIDEODRIVER, wayland # CLUTTER # env = CLUTTER_BACKEND,wayland # For OpenSSL env = CRYPTOGRAPHY_OPENSSL_NO_LEGACY, 1 # Mozilla env = MOZ_ENABLE_WAYLAND, 1 # env = MOZ_DBUS_REMOTE, 1 # Disable appimage launcher by default # env = APPIMAGELAUNCHER_DISABLE, 1 # Hyprland env = HYPRLAND_LOG_WLR, 1 # Fcitx5 env = XMODIFIERS, @im=fcitx5 # env = GTK_IM_MODULE, fcitx5 env = QT_IM_MODULE, fcitx5 env = SDL_IM_MODULE, fcitx5 env = GLFW_IM_MODULE, ibus # ----------------------------------------------------- # Environment Variables # name: "KVM" # ----------------------------------------------------- # env = WLR_RENDERER_ALLOW_SOFTWARE, 1 # env = WLR_NO_HARDWARE_CURSORS, 1 # ----------------------------------------------------- # Environment Variables # name: "Nvidia" # ----------------------------------------------------- # https://wiki.hyprland.org/Nvidia/ # env = LIBVA_DRIVER_NAME,nvidia # env = GBM_BACKEND,nvidia-drm # env = __GLX_VENDOR_LIBRARY_NAME,nvidia # env = __GL_VRR_ALLOWED,1 # env = WLR_DRM_NO_ATOMIC,1 Config File: /home/guan9/.config/hypr/conf/device.conf: Read Succeeded # ----------------------------------------------------- # Keyboard Layout # https://wiki.hyprland.org/Configuring/Variables/#input # ----------------------------------------------------- input { # qwerty kb_layout = us # azerty #kb_layout = be kb_variant = kb_model = # swap ESC and CapsLock # kb_options = caps:swapescape kb_rules = numlock_by_default = 0 natural_scroll = false follow_mouse = 1 float_switch_override_focus = 2 touchpad { disable_while_typing = true natural_scroll = true scroll_factor = 1.0 clickfinger_behavior = true tap-to-click = true } #sensitivity = 0.0 # -1.0 - 1.0, 0 means no modification } cursor { inactive_timeout = 5 persistent_warps = true } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more #device:epic mouse V1 { # sensitivity = -0.5 #} device { name = 06cbce44:00-06cb:cec0-touchpad enabled = false } Config File: /home/guan9/.cache/wal/colors-hyprland.conf: Read Succeeded $background = rgb(241b22) $foreground = rgb(e6e1e2) $color0 = rgb(241b22) $color1 = rgb(9A7887) $color2 = rgb(D07A86) $color3 = rgb(758EAE) $color4 = rgb(A396A5) $color5 = rgb(DBA4A8) $color6 = rgb(B4BDD0) $color7 = rgb(e6e1e2) $color8 = rgb(a19d9e) $color9 = rgb(9A7887) $color10 = rgb(D07A86) $color11 = rgb(758EAE) $color12 = rgb(A396A5) $color13 = rgb(DBA4A8) $color14 = rgb(B4BDD0) $color15 = rgb(e6e1e2) Config File: /home/guan9/.config/hypr/conf/window.conf: Read Succeeded source = $HyprConfDir/windows/default.conf Config File: /home/guan9/.config/hypr/conf/windows/default.conf: Read Succeeded # ----------------------------------------------------- # General window layout and colors # name: "Default" # ----------------------------------------------------- general { gaps_in = 10 gaps_out = 14 border_size = 3 col.active_border = $color11 col.inactive_border = rgba(ffffffff) layout = dwindle resize_on_border = true } Config File: /home/guan9/.config/hypr/conf/decoration.conf: Read Succeeded source = $HyprConfDir/decorations/default.conf Config File: /home/guan9/.config/hypr/conf/decorations/default.conf: Read Succeeded # ----------------------------------------------------- # General window decoration # name: "Default" # ----------------------------------------------------- decoration { rounding = 10 blur { enabled = true size = 6 passes = 2 new_optimizations = on ignore_opacity = false xray = true blurls = waybar } active_opacity = 1.0 inactive_opacity = 0.9 fullscreen_opacity = 1.0 drop_shadow = true shadow_range = 30 shadow_render_power = 3 col.shadow = 0x66000000 } Config File: /home/guan9/.config/hypr/conf/layout.conf: Read Succeeded # ----------------------------------------------------- # Layouts # ----------------------------------------------------- dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = true preserve_split = false smart_split = false permanent_direction_override = false } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more mfact = 0.5 } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = false workspace_swipe_fingers = 3 } Config File: /home/guan9/.config/hypr/conf/misc.conf: Read Succeeded # ----------------------------------------------------- # Misc settings # ----------------------------------------------------- misc { disable_hyprland_logo = true disable_splash_rendering = true mouse_move_enables_dpms = false key_press_enables_dpms = true focus_on_activate = true # no_direct_scanout = true #for fullscreen games new_window_takes_over_fullscreen = 1 } xwayland { use_nearest_neighbor = false force_zero_scaling = false } binds { workspace_back_and_forth = true workspace_center_on = 1 disable_keybind_grabbing = true } debug { disable_logs = false disable_time = false error_position=1 } plugin:hyprfocus { enabled = yes animate_floating = yes animate_workspacechange = yes focus_animation = shrink # Beziers for focus animations bezier = bezIn, 0.5,0.0,1.0,0.5 bezier = bezOut, 0.0,0.5,0.5,1.0 bezier = overshot, 0.05, 0.9, 0.1, 1.05 bezier = smoothOut, 0.36, 0, 0.66, -0.56 bezier = smoothIn, 0.25, 1, 0.5, 1 bezier = realsmooth, 0.28,0.29,.69,1.08 # Flash settings flash { flash_opacity = 0.95 in_bezier = realsmooth in_speed = 0.5 out_bezier = realsmooth out_speed = 3 } # Shrink settings shrink { shrink_percentage = 0.99 in_bezier = realsmooth in_speed = 1 out_bezier = realsmooth out_speed = 2 } } Config File: /home/guan9/.config/hypr/conf/keybinding.conf: Read Succeeded # ----------------------------------------------------- # Key bindings # name: "Default" # ----------------------------------------------------- # SUPER KEY $mainMod = SUPER $ScriptDir = ~/.config/hypr/scripts $SCRIPTS = ~/dotfiles/scripts # $browser = microsoft-edge-dev --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime $browser = vivaldi --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime # $browser = firefox # $browser = export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7890;vivaldi # Applications bind = $mainMod, Return, exec, alacritty bind = $mainMod, B, exec, $browser bind = $mainMod SHIFT, Return, exec, thunar bind = $mainMod SHIFT, P, exec, piclist upload bind = CTRL SHIFT, Escape, exec, $term --class htop -T htop -e htop # bind = , F8, exec, grim -g "$(slurp)" ~/.cache/com.pot-app.desktop/pot_screenshot_cut.png && curl "127.0.0.1:60828/ocr_recognize?screenshot=false" bind = , F9, exec, grim -g "$(slurp)" ~/.cache/com.pot-app.desktop/pot_screenshot_cut.png && curl "127.0.0.1:60828/ocr_translate?screenshot=false" # bind = , F10, exec, curl "127.0.0.1:60828" -d "$(wl-paste)" bind = , F10, exec, curl "127.0.0.1:60828/input_translate" $fullmenu = $scriptsDir/fullmenu bind = $mainMod SHIFT, D, exec, $fullmenu bind = $mainMod, O, exec, $colorpicker # bind = $mainMod SHIFT, O, exec, $term --class hyprpicker --hold -e hyprpicker bind = $mainMod CTRL, S, exec, $wofi_beats # effect bind = ALT, g, exec, $scriptsDir/glassmorphismToggle # Actions bind = $mainMod SHIFT, A, exec, $ScriptDir/toggle-animations.sh # Toggle animations bind = $mainMod, PRINT, exec, $ScriptDir/screenshot.sh # Take a screenshot bind = $mainMod, X, exec, wlogout # Start wlogout # bind = $mainMod SHIFT, W, exec, waypaper --random # Change the wallpaper bind = $mainMod CTRL, W, exec, waypaper # Open wallpaper selector bind = $mainMod ALT, W, exec, $ScriptDir/wallpaper-automation.sh # Start random wallpaper script bind = $mainMod , D, exec, rofi -show drun -replace -i # Open application launcher bind = $mainMod CTRL, H, exec, $ScriptDir/keybindings.sh # Show keybindings bind = $mainMod SHIFT, B, exec, ~/dotfiles/waybar/launch.sh # Reload waybar bind = $mainMod CTRL, B, exec, ~/dotfiles/waybar/toggle.sh # Toggle waybar bind = $mainMod CTRL, T, exec, ~/dotfiles/waybar/themeswitcher.sh # Open waybar theme switcher bind = $mainMod SHIFT, R, exec, hyprctl reload # Reload hyprland config bind = $mainMod, V, exec, $SCRIPTS/cliphist.sh # Open clipboard manager bind = $mainMod SHIFT, S, exec, $ScriptDir/hyprshade.sh # Toggle screenshader bind = $mainMod ALT, G, exec, $ScriptDir/gamemode.sh # Toggle game mode bind = $mainMod, mouse_down, workspace, e+1 # Open next workspace bind = $mainMod, mouse_up, workspace, e-1 # Open previous workspace bind = $mainMod CTRL, down, workspace, empty # Open the next empty workspace # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, period, changegroupactive, f bind = $mainMod, comma, changegroupactive, b # Passthrough SUPER KEY to Virtual Machine bind = $mainMod, P, submap, VM # Passthrough SUPER key to virtual machine submap = VM bind = SUPER, Escape, submap, reset # Get SUPER key back from virtual machine submap = reset # Fn keys # bind = , xf86audioraisevolume, exec, $volume --inc # bind = , xf86audiolowervolume, exec, $volume --dec # bind = , xf86audiomute, exec, $volume --toggle # bind = , xf86monbrightnessup, exec, $brightness --inc # bind = , xf86monbrightnessdown, exec, $brightness --dec bind = , xf86audiostop, exec, playerctl stop bind = , XF86MonBrightnessUp, exec, brightnessctl -q s +10% # Increase brightness by 10% bind = , XF86MonBrightnessDown, exec, brightnessctl -q s 10%- # Reduce brightness by 10% bind = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% # Increase volume by 5% bind = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% # Reduce volume by 5% bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # Toggle mute bind = , XF86AudioPlay, exec, playerctl play-pause # Audio play pause bind = , XF86AudioPause, exec, playerctl pause # Audio pause bind = , XF86AudioNext, exec, playerctl next # Audio next bind = , XF86AudioPrev, exec, playerctl previous # Audio previous bind = , XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle # Toggle microphone bind = , XF86Calculator, exec, qalculate-gtk # Open calculator bind = , XF86Lock, exec, hyprlock # Open screenlock ######## Windows bind = $mainMod, Q, killactive # Kill active window bind = $mainMod, Escape, exec, hyprctl kill bind = $mainMod, F, fullscreen # Set active window to fullscreen bind = $mainMod SHIFT, Space, togglefloating # Toggle active windows into floating mode bind = $mainMod SHIFT, T, exec, $ScriptDir/toggleallfloat.sh # Toggle all windows into floating mode bind = $mainMod, J, togglesplit # Toggle split bindm = $mainMod, mouse:272, movewindow # Move window with the mouse bindm = $mainMod, mouse:273, resizewindow # Resize window with the mouse bind = $mainMod, G, togglegroup # Toggle window group bind = ALT, tab, workspace, m+1 bind = ALT SHIFT, tab, workspace, m-1 # Special workspace bind = $mainMod SHIFT, U, movetoworkspace, special bind = $mainMod, U, togglespecialworkspace, # Resize binde = $mainMod SHIFT, H, resizeactive,-50 0 binde = $mainMod SHIFT, L, resizeactive,50 0 binde = $mainMod SHIFT, K, resizeactive,0 -50 binde = $mainMod SHIFT, J, resizeactive,0 50 # Move bind = $mainMod CTRL, H, movewindow, l bind = $mainMod CTRL, L, movewindow, r bind = $mainMod CTRL, K, movewindow, u bind = $mainMod CTRL, J, movewindow, d # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, left, alterzorder, top bind = $mainMod, right, movefocus, r bind = $mainMod, right, alterzorder, top bind = $mainMod, up, movefocus, u bind = $mainMod, up, alterzorder, top bind = $mainMod, down, movefocus, d bind = $mainMod, down, alterzorder, top # Move focus with mainMod + h, j, k, l keys bind = $mainMod, H, movefocus, l bind = $mainMod, H, alterzorder, top bind = $mainMod, L, movefocus, r bind = $mainMod, L, alterzorder, top bind = $mainMod, k, movefocus, u bind = $mainMod, k, alterzorder, top bind = $mainMod, J, movefocus, d bind = $mainMod, J, alterzorder, top # 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, F1, workspace, 6 bind = $mainMod, F2, workspace, 7 bind = $mainMod, F3, workspace, 8 bind = $mainMod, F4, workspace, 9 bind = $mainMod, F5, workspace, 10 # Move active window and follow to workspace bind = $mainMod CTRL, 1, movetoworkspace, 1 bind = $mainMod CTRL, 2, movetoworkspace, 2 bind = $mainMod CTRL, 3, movetoworkspace, 3 bind = $mainMod CTRL, 4, movetoworkspace, 4 bind = $mainMod CTRL, 5, movetoworkspace, 5 bind = $mainMod CTRL, F1, movetoworkspace, 6 bind = $mainMod CTRL, F2, movetoworkspace, 7 bind = $mainMod CTRL, F3, movetoworkspace, 8 bind = $mainMod CTRL, F4, movetoworkspace, 9 bind = $mainMod CTRL, F5, movetoworkspace, 10 bind = $mainMod CTRL, bracketleft, movetoworkspace, -1 bind = $mainMod CTRL, bracketright, movetoworkspace, +1 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2 bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3 bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4 bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5 bind = $mainMod SHIFT, F1, movetoworkspacesilent, 6 bind = $mainMod SHIFT, F2, movetoworkspacesilent, 7 bind = $mainMod SHIFT, F3, movetoworkspacesilent, 8 bind = $mainMod SHIFT, F4, movetoworkspacesilent, 9 bind = $mainMod SHIFT, F5, movetoworkspacesilent, 10 bind = $mainMod SHIFT, bracketleft, movetoworkspacesilent, -1 bind = $mainMod SHIFT, bracketright, movetoworkspacesilent, +1 # bind = $mainMod CTRL, 1, exec, $ScriptDir/moveTo.sh 1 # Move all windows to workspace 1 # bind = $mainMod CTRL, 2, exec, $ScriptDir/moveTo.sh 2 # Move all windows to workspace 2 # bind = $mainMod CTRL, 3, exec, $ScriptDir/moveTo.sh 3 # Move all windows to workspace 3 # bind = $mainMod CTRL, 4, exec, $ScriptDir/moveTo.sh 4 # Move all windows to workspace 4 # bind = $mainMod CTRL, 5, exec, $ScriptDir/moveTo.sh 5 # Move all windows to workspace 5 # bind = $mainMod CTRL, 6, exec, $ScriptDir/moveTo.sh 6 # Move all windows to workspace 6 # bind = $mainMod CTRL, 7, exec, $ScriptDir/moveTo.sh 7 # Move all windows to workspace 7 # bind = $mainMod CTRL, 8, exec, $ScriptDir/moveTo.sh 8 # Move all windows to workspace 8 # bind = $mainMod CTRL, 9, exec, $ScriptDir/moveTo.sh 9 # Move all windows to workspace 9 # bind = $mainMod CTRL, 0, exec, $ScriptDir/moveTo.sh 10 # Move all windows to workspace 10 # bind = $mainMod SHIFT, M, exec, hyprctl dispatch splitratio -0.1 # bind = $mainMod, M, exec, hyprctl dispatch splitratio 0.1 # bind = $mainMod, D, layoutmsg, removemaster # bind = $mainMod, I, layoutmsg, addmaster # bind = $mainMod, J, layoutmsg, cyclenext # bind = $mainMod, K, layoutmsg, cycleprev # bind = $mainMod, P, pseudo # bind = $mainMod CTRL, Return, layoutmsg, swapwithmaster # bind = $mainMod, Space, exec, $scriptsDir/changeLayout # # # Backlight control # bind = $mainMod SHIFT, equal, submap, backlight # submap = backlight # bind = , equal, exec, $backlight --inc # bind = , minus, exec, $backlight --dec # bind = , escape, submap, reset # submap = reset # Volume control # bind = $mainMod, equal, submap, volume # submap = volume # bind = , equal, exec, $volume --inc # bind = , minus, exec, $volume --dec # bind = , 0, exec, $volume --toggle # bind = , 9, exec, $volume --toggle-mic # bind = , escape, submap, reset # submap = reset Config File: /home/guan9/.config/hypr/conf/windowrule.conf: Read Succeeded # ----------------------------------------------------- # Window rules # ----------------------------------------------------- # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Example windowrule v1 # windowrule = float, yad|nm-connection-editor|pavucontrol # windowrule = float, feh|Gimp|qt5ct windowrulev2 = float, class:^(CoolArch-Script)$ # Example windowrule v2 windowrulev2 = tile, class:^(Spotify)$ windowrule = float,^(blueman-manager)$ windowrule = float,^(qalculate-gtk)$ windowrulev2 = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 windowrulev2 = bordercolor rgb(FF0000) rgb(880808),fullscreen:1 # set bordercolor to red if window is fullscreen windowrulev2 = bordercolor rgb(282737) rgb(1E1D2D), floating:1 windowrulev2 = opacity 0.8 0.8, pinned:1 # for fcitx5 windowrulev2 = float, class:^(.*)(fcitx5-config-qt)$ # for yay update click windowrulev2 = animation popin, class:^(update)$, title:^(update)$ windowrulev2 = float, class:^(update)$, title:^(update)$ windowrulev2 = size 50% 50%, class:^(update)$, title:^(update)$ windowrulev2 = center, class:^(update)$, title:^(update)$ windowrulev2 = workspace 10, class:^(update)$, title:^(update)$ # for RuiJie windowrulev2 = float, class:^(RuiJie)$, title:^(RuiJie)$ windowrulev2 = workspace 10, class:^(RuiJie)$, title:^(RuiJie)$ # for ttyclock windowrulev2 = float, class:^(clock)$, title:^(clock)$ windowrulev2 = size 33% 27%, class:^(clock)$, title:^(clock)$ windowrulev2 = center, class:^(clock)$, title:^(clock)$ # for browser windowrule = tile, ^(Microsoft-edge) windowrule = tile, ^(Brave-browser)$ windowrule = tile, ^(Chromium)$ windowrule = tile, ^(vivaldi-stable)$ windowrule = workspace 6, ^(vivaldi-stable)$ # for clash-verge windowrulev2 = float, class:^(clash-verge)$, title:^(.*)$ windowrulev2 = size 850 700, class:^(clash-verge)$, title:^(.*)$ windowrulev2 = workspace 10, class:^(clash-verge)$, title:^(.*)$ # for Zotero windowrulev2 = float, class:^(Zotero)$, title:^(.*)$ windowrulev2 = workspace 7, class:Zotero, title:^(.*)$ # for Thunar windowrulev2 = float, class:^(Thunar|thunar), title:(.*) # for VirtualBox windowrulev2 = float, title:(VirtualBox Manager)$ windowrulev2 = float, title:^(VirtualBox) windowrulev2 = workspace 5, title:(VirtualBox Manager)$ windowrulev2 = workspace 5, class:(VirtualBox Machine), title:(.*) windowrulev2 = workspace 5, class:(VirtualBoxVM), title:(.*) # for Arcolinux-welcome-app windowrulev2 = float, class:^(arcolinux-welcome-app), title:(.*) windowrulev2 = workspace 10, class:^(arcolinux-welcome-app), title:(.*) # for Alacritty windowrulev2 = opacity 0.95 0.95, class:^(Alacritty)$, title:(.*) #for Sofirem windowrulev2 = float, class:^(Sofirem), title:(.*) windowrulev2 = workspace 10, class:^(Sofirem), title:(.*) # for Archlinux-tweak-tool windowrulev2 = float, class:^(Archlinux-tweak-tool), title:(.*) windowrulev2 = workspace 10, class:^(Archlinux-tweak-tool), title:(.*) # for Pamac Manager windowrulev2 = float, class:(pamac.manager)$ windowrulev2 = workspace 10, class:^(pamac.manager) # for Flameshot windowrulev2 = float, class:^(flameshot)$, title:^(Configuration)$ windowrulev2 = fullscreen, class:^(flameshot)$, title:^(flameshot)$ windowrulev2 = move 0 0, title:^(flameshot) # for qt windowrulev2 = float, class:^(qt5ct|qt6ct) windowrulev2 = size 750 600, class:^(qt5ct|qt6ct) # for nwg-look windowrulev2 = float, class:^(nwg-look)$ # for image-viewer windowrulev2 = float, class:^(.*)(nomacs), title:^(.*)$ # windowrulev2 = size 800 800, class:^(.*)(nomacs)$, title:^(.*)$ windowrulev2 = float, class:^(.*)(imv)$, title:^(.*)$ # for xdg-desktop-portal-gtk windowrulev2 = float, class:^(.*)$, title:^(Save file|Save File|Open Folder)$ windowrulev2 = size 800 600, class:^(.*)$, title:^(Save file|Save File|Open Folder)$ windowrulev2 = float, class:^(xdg-desktop-portal-gtk)$ windowrulev2 = size 800 600, class:^(xdg-desktop-portal-gtk)$ # for conky windowrulev2 = float, class:^(conky|Conky)$, title:^(.*)$ # for yad windowrulev2 = float, class:^(yad|Yad)$, title:^(.*)$ # for Network Manager windowrule = float, ^(nm-connection-editor)$ # for pavucontrol windowrule = float,^(pavucontrol)$ windowrulev2 = float,class:(.*org.pulseaudio.pavucontrol.*) windowrulev2 = size 700 600,class:(.*org.pulseaudio.pavucontrol.*) windowrulev2 = center,class:(.*org.pulseaudio.pavucontrol.*) # for Archive Manager windowrulev2 = float, class:^(file-roller|org.gnome.FileRoller)$, title:^(.*)$ windowrulev2 = size 700 600, class:^(file-roller|org.gnome.FileRoller)$, title:^(.*)$ # for pot-translation windowrulev2 = float, class:^(pot)$, title:^(.*)$ windowrulev2 = float, class:(pot), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating windowrulev2 = move cursor 0 0, class:(pot), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position. # for piclist windowrulev2 = float, class:^(piclist)$, title:^(.*)$ windowrulev2 = workspace 10, class:^(piclist)$, title:^(.*)$ windowrulev2 = size 800 500, class:^(piclist)$, title:^(.*)$ windowrulev2 = opacity 0.9 0.9, class:^(piclist)$, title:^(.*)$ windowrulev2 = move cursor 0 0, class:^(piclist)$, title:^(.*)$ # for telegram windowrulev2 = float, class:^(org.telegram.desktop)$, title:^(.*)$ windowrulev2 = workspace 5, class:^(org.telegram.desktop)$, title:^(.*)$ # for QQ windowrulev2 = float, class:^(QQ)$, title:^(.*)$ windowrulev2 = workspace 10, class:^(QQ)$, title:^(.*)$ # for Localsend windowrulev2 = float, class:^(localsend_app)$, title:^(.*)$ # for Todesk # windowrulev2 = float, class:^(ToDesk)$, title:^(.*)$ # for Teamviewer # windowrulev2 = float, class:^(TeamViewer)$, title:^(.*)$ # for org.inkscape.Inkscape windowrulev2 = float, class:^(org.inkscape.Inkscape)$ # for X-anylabeling windowrulev2 = float, class:^(python3)$, title:^(X-AnyLabeling)$ # windowrulev2 = size 1200 1000, class:^(python3)$, title:^(X-AnyLabeling)$ # for Waydroid windowrulev2 = float, class:^(waydroid|Waydroid)$ # for VLC windowrulev2 = float, class:^(vlc|Vlc)$ # for Goldendict-ng windowrulev2 = float, class:^(GoldenDict-ng)$ # for vscode windowrulev2 = workspace 3, class:^(code-oss|code-url-handler)$ # for obsidian windowrulev2 = workspace 2, class:^(obsidian)$ # for blender windowrulev2 = float, class:^(blender)$ # workspace Rules workspace = 1, monitor:HDMI-A-1, default:true workspace = 2, monitor:HDMI-A-1 workspace = 3, monitor:HDMI-A-1 workspace = 4, monitor:HDMI-A-1 workspace = 5, monitor:HDMI-A-1 workspace = 6, monitor:HDMI-A-1 workspace = 7, monitor:HDMI-A-1 workspace = 8, monitor:eDP-1, default:true workspace = 9, monitor:eDP-1 workspace = 10, monitor:eDP-1 Config File: /home/guan9/.config/hypr/conf/animation.conf: Read Succeeded source = $HyprConfDir/animations/default.conf Config File: /home/guan9/.config/hypr/conf/animations/default.conf: Read Succeeded # ----------------------------------------------------- # Animations # name "Default" # ----------------------------------------------------- animations { enabled = true bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } ======Config-End======== ```

Description

I am using Hyprland as my Linux desktop environment.I have two tiled window (called A and B) in a workspace When I open a new float window (for example, a save file dialog window C) from window A, everything works fine. However, after I have done my work and close window B(the close action trigger by keyboard like click ENTER or ESC), the focus unexpectedly shifts to another window (let's call it window B), rather than returning to the original window A.

I would like to find a way to configure it so that after closing the save file dialog, the focus automatically returns to window A instead of moving to window B.

How to reproduce

Open two tiled window in a workspace, then open a new popup window then exit by keyboard.

Crash reports, logs, images, videos

No response

Guan9Wu commented 2 months ago

This is not a bug but a help sticker, I don't know how to modify the tag, please administrator to modify it, thank you

vaxerski commented 2 months ago

can be tagged as an enhancement

Guan9Wu commented 1 month ago

Set mouse_refocus=false can solve this problem. @vaxerski Thanks for your attention. I will close the issue.