From bc5391a34c8a6809e2ad79a0610caf7e77b69cbc Mon Sep 17 00:00:00 2001 From: Martin Myrseth Date: Sun, 9 Jun 2024 23:18:30 +0200 Subject: [PATCH] fix: Use -normal-window for Rofi on Wayland Rofi does not have native Wayland support and there are some issues with capturing input when running default through XWayland. Using `-normal-window` seems to improve the situation slightly, but might be problematic under tiling compositor. See: https://github.com/davatorium/rofi/issues/446 --- src/Nixon/Backend/Rofi.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Nixon/Backend/Rofi.hs b/src/Nixon/Backend/Rofi.hs index 0d6dfb2..804197a 100644 --- a/src/Nixon/Backend/Rofi.hs +++ b/src/Nixon/Backend/Rofi.hs @@ -29,6 +29,7 @@ import Nixon.Project (Project (projectDir, projectName)) import Nixon.Select (Candidate, Selection (..), SelectionType (..)) import qualified Nixon.Select as Select import Nixon.Utils (implode_home, shell_to_list, toLines, (< RofiOpts -> Shell Candidate -> m (Selection Text) rofi opts candidates = do + -- Add -normal-window flag when running on wayland + -- See: https://github.com/davatorium/rofi/issues/446 + isWayland <- (== "wayland") <$> liftIO (getEnv "XDG_SESSION_TYPE") let args = "-dmenu" : build_args @@ -134,6 +138,7 @@ rofi opts candidates = do flag "-i" =<< _ignore_case opts, flag "-markup-rows" (_markup opts), flag "-multi-select" (_multi opts), + flag "-normal-window" isWayland, arg "-mesg" =<< _msg opts, arg "-p" =<< _prompt opts, arg "-filter" =<< _query opts