xmonad / xmonad-contrib

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

Weird behavior with promptBorderWidth (0.13) #145

Closed jpotier closed 7 years ago

jpotier commented 7 years ago

Problem Description

After migrating to 0.13 (xmonad and xmonad-contrib) Setting a promptBorderWidth > 0 hides the menu entirely, I expected it wouldn't.

https://framapic.org/EGlTwyfGctvS/Ipgksa46uXb7.png (set to 20) https://framapic.org/6fj1CsRIMdTL/neItXFVC8pTY.png (set to 0)

Configuration File

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

--------------------------------------------------------------------------------
import System.Exit
import XMonad
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
import XMonad.Prompt
import XMonad.Prompt.ConfirmPrompt
import XMonad.Prompt.Shell
import XMonad.Util.EZConfig

--------------------------------------------------------------------------------
main = do
  spawn "xmobar" -- Start a task bar such as xmobar.

  -- Start xmonad using the main desktop configuration with a few
  -- simple overrides:
  xmonad $ desktopConfig
    { modMask    = mod4Mask -- Use the "Win" key for the mod key
    , logHook    = dynamicLogString def >>= xmonadPropLog
    }

    `additionalKeysP` -- Add some extra key bindings:
      [ ("M-S-q", confirmPrompt myXPConfig "exit" (io exitSuccess))
      , ("M-p",   shellPrompt myXPConfig)
      ]

--------------------------------------------------------------------------------
-- | Customize the way 'XMonad.Prompt' looks and behaves.  It's a
-- great replacement for dzen.
myXPConfig = def
  { position = Top
  , promptBorderWidth = 20
  , font = "xft:lucy tewi:style=Regular:antialias=false:autohint=false"
  , height = 24
  , defaultText = ""
  }

Checklist

geekosaur commented 7 years ago

Can you try it with a smaller border? Remember that the borders and the font need to fit within the height you specify; otherwise you are asking it to squeeze too much into too small of a window, and of course something will end up disappearing because it can't all fit at the same time.

f1u77y commented 7 years ago

The fact that window size includes border size is not obvious for most users. I think that should be mentioned in docs.

On 02/12/2017 10:36 AM, geekosaur wrote:

Can you try it with a smaller border? Remember that the borders and the font need to fit within the height you specify; otherwise you are asking it to squeeze too much into too small of a window, and of course something will end up disappearing because it can't all fit at the same time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xmonad/xmonad-contrib/issues/145#issuecomment-279202229, or mute the thread https://github.com/notifications/unsubscribe-auth/AKyf5du4GiSvJWC90S6EtnI2L8qTq8quks5rbraTgaJpZM4L-att.

-- Bogdan Sinitsyn

jpotier commented 7 years ago

@geekosaur, you are right, 20 is too much. A smaller value works. I was surprised, since this happened after migrating to xmonad-contrib 0.13.

geekosaur commented 7 years ago

There have been several changes to Prompt to fix other edge cases involving menus, which probably impacted this behavior. We almost certainly compute the final window size differently now, for example.