xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

X.A.WindowNavigation: fix navigation being "stuck" in certain situations #652

Closed Rogach closed 2 years ago

Rogach commented 2 years ago

Description

Update left and right navigation to behave correctly even if the currently saved position is directly on the edge of the focused window. This makes the L/R behavior consistent with U/D navigation.

How to reproduce the issue:

Minimized configuration to test the issue:

{-# OPTIONS_GHC -fno-warn-type-defaults #-}

import XMonad
import XMonad.Config.Xfce
import XMonad.Hooks.SetWMName
import XMonad.Layout.Grid
import XMonad.Actions.WindowNavigation

main :: IO ()
main = do
  myConfig <- withWindowNavigation (xK_k, xK_h, xK_j, xK_l) $
              xfceConfig
              { terminal = "gnome-terminal"
              , modMask = mod4Mask
              , layoutHook = GridRatio (4/3)
              , startupHook = do
                  startupHook xfceConfig
                  setWMName "LG3D"
              , workspaces = map show [0..15]
              }
  xmonad myConfig

Checklist

slotThe commented 2 years ago

Minimized configuration to test the issue

I can't reproduce this with that config. What I did:

After that M-h correctly navigates left from the currently focused window (which is still in the upper right corner).

Rogach commented 2 years ago

What is your screen resolution? (mine is 2560x1440)

Rogach commented 2 years ago

Also, where is the 5th terminal opening for you? In my case it opens in bottom-center position, something like this:

x----x----x----x
|    |    |    |
|    x----x----x
|    | 5  |    |
x----x----x----x
slotThe commented 2 years ago

What is your screen resolution? (mine is 2560x1440)

I tried it through xephyr, so it was 800x600. Indeed, if I choose 1920x1080 or 2560x1440 I can reproduce the problem

slotThe commented 2 years ago

Your proposed fix seems to work; thanks! (I just pushed a small doc fix)