Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaving a fullscreen window applys borders on a noBorders layout if using more than one monitor #654

Open
3 tasks done
notpentadactyl opened this issue Nov 24, 2021 · 2 comments

Comments

@notpentadactyl
Copy link

Problem Description

Watching a video e.g. on YouTube and switching out of fullscreen draws borders on a layout that is using noBorders until focus/refocusing e.g moving the mouse to a different monitor or shift tabbing on the layout.

This only seems to happen when using more than one monitor.
Maybe an interaction between noBorders and smartBorders?

Steps to Reproduce

Dual monitor (with issue): https://streamable.com/3z4d6i

Single monitor (no issue): https://streamable.com/jr5s4w

Configuration File

Please include the smallest full configuration file that reproduces
the problem you are experiencing:

import XMonad
import System.Exit
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import Control.Monad
import Data.Monoid
import System.IO
import XMonad.Util.Run
import XMonad.Layout.NoBorders
import XMonad.Layout.Fullscreen hiding (fullscreenEventHook)
import XMonad.Layout.Grid
import XMonad.Layout.ResizableTile
import XMonad.Layout.Reflect
import XMonad.Layout.PerWorkspace (onWorkspace)
import XMonad.Layout.TrackFloating
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, refocusLastWhen, isFloat)
import XMonad.Actions.GridSelect
import XMonad.Actions.CycleRecentWS
import XMonad.Actions.CycleWS
import XMonad.Actions.Navigation2D
import XMonad.Actions.WindowGo
import XMonad.Actions.UpdatePointer
import qualified Data.Map as M
import qualified XMonad.StackSet as W

background, currentline, foreground, comment, cyan, green, orange, pink, purple, red, yellow :: [Char]
background = "#282a36"
currentline = "#44475a"
foreground = "#f8f8f2"
comment = "#6272a4"
cyan = "#8be9fd"
green = "#50fa7b"
orange = "#ffb86c"
pink = "#ff79c6"
purple = "#bd93f9"
red = "#ff5555"
yellow = "#f1fa8c"

myManageHook :: ManageHook
myManageHook = composeAll . concat $
    [ [ className =? c --> doCenterFloat | c <- floats ]
    , [ resource =? r --> doIgnore | r <- ignore ]
    , [ resource =? "stalonetray" --> doIgnore ]
    , [ resource =? "trayer" --> doIgnore ]
    , [ isFullscreen --> doFullFloat ]
    , [ isDialog --> doCenterFloat ]
    ] where floats =  [ -- "foo"
                      --, "bar"
                      ]
            ignore = []

myLayoutHook = onWorkspace "4" wwwL $ onWorkspace "2" wwwL $ onWorkspace "6" discordL standardLayouts
   where
    standardLayouts = Grid ||| tiled |||  reflectTiled ||| Mirror tiled ||| full
    tiled = ResizableTall 1 (2/100) (1/2) []
    reflectTiled = reflectHoriz tiled
    full = noBorders (fullscreenFull Full)
    wwwL = full ||| tiled ||| reflectHoriz tiled ||| Grid
    discordL = Mirror (ResizableTall 1 (2/100) (3.23/5) []) ||| full ||| Grid

main :: IO()
main = xmonad
    . ewmhFullscreen
    . ewmh
    . withEasySB (statusBarProp "xmobar ~/.config/xmobar/xmobarrc" (pure myXmobarPP)) defToggleStrutsKey
    $ myConfig

myXmobarPP :: PP
myXmobarPP = def
        { ppCurrent = xmobarColor green currentline . wrap " " " "
        , ppTitleSanitize   = xmobarStrip
        , ppVisible = xmobarColor purple  ""
        , ppHidden = xmobarColor orange ""
        , ppHiddenNoWindows = xmobarColor yellow ""
        , ppTitle  = xmobarColor cyan "" . shorten 100
        , ppUrgent = xmobarColor red "" . xmobarStrip
        , ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
        , ppSep = "<fc=#f8f8f2> \xe621 </fc>"
        , ppExtras = [logTitles formatFocused formatUnfocused]
        }
    where
        formatFocused   = wrap (xmobarLowWhite    "[") (xmobarLowWhite    "]") . xmobarGreen . ppWindow . shorten 30
        formatUnfocused = wrap (xmobarLowWhite "[") (xmobarLowWhite "]") . xmobarPink  . ppWindow . shorten 30
        ppWindow :: String -> String
        ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w)

        xmobarPurple, xmobarLowWhite, xmobarPink, xmobarWhite, xmobarGreen :: String -> String
        xmobarPink = xmobarColor pink ""
        xmobarPurple = xmobarColor purple ""
        xmobarGreen = xmobarColor green ""
        xmobarWhite = xmobarColor foreground ""
        xmobarLowWhite = xmobarColor currentline ""

myEventHook :: Event -> X All
myEventHook = refocusLastEventHook
    where
        refocusLastEventHook = refocusLastWhen isFloat

myConfig = withUrgencyHook NoUrgencyHook def
            { workspaces = ["1", "2", "3", "4", "5", "6", "7"]
            , normalBorderColor = comment
            , focusedBorderColor = green
            , borderWidth = 2
            , modMask = mod4Mask
            , terminal = "alacritty"
            , layoutHook = smartBorders . refocusLastLayoutHook . trackFloating . avoidStruts $ myLayoutHook
            , manageHook = myManageHook <+> manageHook def
            , handleEventHook = myEventHook
            } `additionalKeysP` myKeys
myKeys :: [([Char], X ())]
myKeys =
        [ ("M-x l", spawn "xset dpms force standby && slock")
        , ("M-p", spawn "rofi -show")
        , ("M-S-p", spawn "passmenu")
        , ("M-S-s", spawn "sshot.sh")
        , ("M-<Esc>", focusUrgent)
        , ("M1-<Tab>", cycleRecentWS [xK_Alt_L] xK_Tab xK_grave)
    ]

Checklist

  • I've read CONTRIBUTING.md

  • I tested my configuration

    • With xmonad version dbe9c4f799fd826c199169d012c2d2687b210a7f
    • With xmonad-contrib version 2a02fb3
@geekosaur
Copy link
Contributor

IIRC we ended up unable to make smartBorders and friends work sensibly with more than one monitor, so I'm not sure this is fixable. :(

@liskin
Copy link
Member

liskin commented Nov 24, 2021

IIRC we ended up unable to make smartBorders and friends work sensibly with more than one monitor, so I'm not sure this is fixable. :(

We did manage to fix a bug or two in there, this might be fixable too. (No promises I'm getting to it any time soon though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants