16 Commits

Author SHA1 Message Date
Tony Zorman
52a40f376c Replace tail with drop 1
Where appropriate.
2023-10-15 18:46:28 +02:00
brandon s allbery kf8nh
4a60866ea4
fix double decode in debugWindow
At some point `peekCString` became locale aware. This is a double
bug, since (a) `decodeString` was being applied to the result and
(b) the locale might not be UTF-8, but the string being decoded
always is.

The fix is to use `peekCAString` which bypasses the locale decode,
then continuing to do UTF-8 decode.
2023-06-22 06:25:56 -04:00
brandon s allbery kf8nh
4998e946cc
fix EWMH titles
I have no idea what I was thinking when I wrote that code.
While at it, just reused the code for ICCCM title which already
assumes the client may have broken the rules (I think we have
seen a case of `WM_NAME` being `UTF8_STRING`).
2022-12-12 13:30:42 -05:00
brandon s allbery kf8nh
607fdc2a12
print EWMH type and state in debugWindow 2022-07-28 10:18:11 -04:00
slotThe
b6a8069e44 Prefer safe alternatives to getWindowAttributes
Whenever possible, prefer the safe wrappers withWindowAttributes or
safeGetWindowAttributes to getWindowAttributes.

Places where these are not applicable are limited to layouts, where
there is not good "default value" to give back in case these calls fail.
In these cases, we let the exception handling of the layout mechanism
handle it and fall back to the Full layout.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/146
2021-11-13 21:26:02 +01:00
slotThe
528b9d9fde X.Prelude: Add safeGetWindowAttributes
Move the function from X.U.DebugWindow, where it was defined already.
This is a safe version of getWindowAttributes, returning a Maybe instead
of throwing an exception, in case the window attributes could not be
retrieved.
2021-11-13 20:44:15 +01:00
slotThe
38c11c1e3c Add "Description" field to module headers
Fixes: https://github.com/xmonad/xmonad-contrib/issues/592
2021-09-26 14:15:54 +02:00
slotThe
bd5b969d9b Apply hlint hints
All hints are applied in one single commit, as a commit per hint would
result in 80+ separate commits—tihs is really just too much noise.

Related: https://github.com/xmonad/xmonad-contrib/issues/537
2021-06-06 18:59:05 +02:00
slotThe
2469269119 New module: XMonad.Prelude
This is a convenience module in order to have less import noise.  It
re-exports the following:

  a) Commonly used modules in full (Data.Foldable, Data.Applicative, and
     so on); though only those that play nicely with each other, so that
     XMonad.Prelude can be imported unqualified without any problems.
     This prevents things like `Prelude.(.)` and `Control.Category.(.)`
     fighting with each other.

  b) Helper functions that don't necessarily fit in any other module;
     e.g., the often used abbreviation `fi = fromIntegral`.
2021-05-13 17:44:47 +02:00
slotThe
77b047316c Control.Exception.Extensible -> Control.Exception
According to its documentation[1], this module simply re-exports
Control.Exception on recent GHC versions.  As we only support recent
versions, this import is unnecessary.

[1] http://hackage.haskell.org/package/extensible-exceptions-0.1.1.4/docs/Control-Exception-Extensible.html
2021-01-12 11:13:29 +01:00
Victor Nawothnig
b594d97604 Check for text encoding correctly and avoid crash (#422) 2020-12-11 02:46:40 +01:00
slotThe
53b57eba14 Replace liftM and fmap with <$> 2019-10-08 10:33:56 +02:00
Daniel Wagner
800ae670e2 use a record pattern to be robust against additions to the X11 library 2015-12-15 07:44:36 -08:00
allbery.b
ec0fb3ba8a debug-debug
Various fixes and enhancements to DebugWindow and DebugStack. ManageDebug
requires these fixes, but some of them are significant even if not using
ManageDebug.
2014-08-03 02:05:30 +00:00
Adam Vogt
9caedf2fff Address warnings from Debug modules
The warnings were related to ghc-7.6 removing Prelude.catch
(triggering warnings regarding the import hiding it), as well
as defaulting of some numeric types.
2012-12-15 16:55:25 +00:00
allbery.b
8d1ad8b280 debug-hooks
Hooks to print diagnostic information to stderr (usually .xsession-errors)
to help debug complex issues involving the StackSet and received events.
2012-08-13 22:38:21 +00:00