xmonad / xmonad-contrib

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

X.U.SpawnOnce: screen flickering after relogin xmonad #636

Closed ixzh closed 3 years ago

ixzh commented 3 years ago

Problem Description

I have a few windows spawned on WS 1 at start up. Using the following binding to exit xmonad and relogin, the screen is flickering and I can vaguely see the windows of last session.

However it seems if I wait for a while before login, things start normally ( no flickering ).

Expectec behavior: no flickering.

Steps to Reproduce

  1. start a new session with reboot
  2. quit xmonad by ctrl shift alt q
  3. relogin immediately
  4. screening flickering with reminiscent windows of last session

is it because GUIs are in the process of quitting even though xmonad quits successfully? anyway to save the waiting time?

Thank you

Configuration File

import XMonad hiding ( (|||) )

import XMonad.Layout.LayoutCombinators hiding ( (|||) )
import XMonad.Layout.Renamed
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ShowWName

-- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig
myShowWNameTheme = def
    { 
    swn_font                = "xft:JetBrainsMono Nerd Font Mono:style=bold:size=36"
    , swn_fade              = 0.5
    , swn_bgcolor           = "#1c1f24"
    , swn_color             = "#ffffff"
    }

myStartupHook = do
    startupHook myBaseConfig
    spawnNOnOnce 7 "1" "alacritty"
    spawnOnOnce "1" "firefox"
    adjustEventInput 

myBaseConfig = desktopConfig

myLayout = 
           showWName' myShowWNameTheme .
           onWorkspaces ["2","3"] myBSP $
           myDefaultLayout
    where
           myDefaultLayout = tmsCombineTwo True 1 (3/100) (1/3) layout1 layout2
           layout1 = tall   
           layout2 = tmsCombineTwo False 3 (3/100) (1/2) layout3 layout4
           layout3 =
               mySpiral 
           layout4 =
               tab
           mySpiral     =   renamed [Replace "spiral"] $ 
                            spiral (6/7)
           tab          =   renamed [Replace "tab"] $ tabbed shrinkText tabConfig

tabConfig = def {
    fontName = "xft:Sarasa UI SC:10"
    , activeColor         = "#46d9ff"
    , inactiveColor       = "#313846"
    , activeBorderColor   = "#46d9ff"
    , inactiveBorderColor = "#282c34"
    , activeTextColor     = "#282c34"
    , inactiveTextColor   = "#d0d0d0"
}

myWorkspaces = ["1","2","3","4","5","6","7","8","9","10"]

myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ [
    ((modMask .|. shiftMask .|. mod1Mask, xK_q),
      io (exitWith ExitSuccess))
  ]

main :: IO ()
main = do
    xmonad $
            myBaseConfig {
                startupHook = myStartupHook 
, layoutHook = myLayout
, workspaces = myWorkspaces
, keys = myKeys
} 

Checklist

liskin commented 3 years ago

Would you be able to record a video (e.g. with your smartphone camera) of this? I'm like 95% sure this is an issue of the kernel, Xorg, or your display manager, but it'd help if we all knew exactly what we're talking about here.

ixzh commented 3 years ago

Hi,

I restarted twice, and in the second time I reprocuded the flickering. Attached is the second time relogin.

While new windows are spawned in sequence, the windows of the last session are in the same place.

liskin commented 3 years ago

Okay there's some really weird shit going on, but definitely not in any way related to xmonad. :-)

ixzh commented 3 years ago

Okay there's some really weird shit going on, but definitely not in any way related to xmonad. :-)

Then the problem should be in my autostart.sh. I looked through it, and made sure each starts only once if process is not already running, especially Picom. Problem seems resolved at the moment. Thank you for the advice!