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

"borderWidth = 0" breaks some Java programs (IntelliJ IDEA, CLion) regardless of wmname or nonreparenting env var #216

Open
2 tasks done
redlet opened this issue Mar 20, 2020 · 2 comments

Comments

@redlet
Copy link

redlet commented Mar 20, 2020

Problem Description

First discovered in 2017, the infamous "gray box" issue occurs ONLY if borderWidth = 0. With the correct environment variable and borderWidth set to a positive integer, everything is fine.
https://stackoverflow.com/questions/41832881/java-gui-xmonad-not-working

Configuration File

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

myTerminal = "alacritty"

myLayout = tiled ||| (Mirror tiled) ||| Full
  where
     tiled   = Tall nmaster delta ratio
     nmaster = 1
     ratio   = toRational (2 / (1 + sqrt 5 :: Double))
     delta   = 3 / 100

myManageHook = composeAll
    [ isFullscreen --> doFullFloat
    , FS.fullscreenManageHook
    ]

quitWithWarning :: X ()
quitWithWarning = do
    let m = "confirm quit"
    s <- dmenu [m]
    when (m == s) (io exitSuccess)

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ desktopConfig
        { terminal = myTerminal
        , borderWidth = 0 -- breaks the solution
        , manageHook = myManageHook <+> manageHook desktopConfig
        , layoutHook = desktopLayoutModifiers $ noBorders $ myLayout
        , handleEventHook = fullscreenEventHook <+> handleEventHook desktopConfig
        , logHook = dynamicLogWithPP xmobarPP
                { ppOutput = hPutStrLn xmproc
                , ppTitle = xmobarColor "green" "" . shorten 50
                }
        , startupHook = setWMName "LG3D" -- solution to a problem here
        } `removeKeys`
        [ (mod1Mask, xK_Return)
	] `additionalKeys`
	[ ((mod1Mask .|. shiftMask, xK_q), quitWithWarning)
	]

Checklist

@slotThe
Copy link
Member

slotThe commented Jan 20, 2022

At this point, does setting _JAVA_AWT_WM_NONREPARENTING=1 (as, e.g., javaHack does it) help?

@Scherso
Copy link

Scherso commented Oct 14, 2022

I had a similar issue with Jetbrains IDE’s, which is caused by its use of javax.swing as its GUI library.
Adding the line Hacks.javaHacks to my main function solved this issue, you can do this like so;

import qualified XMonad.Util.Hacks as Hacks

main = do
    xmonad
    $ Hacks.javaHack
    {- the rest of your function -}

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