Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Adam =?utf-8?Q?Sj=C3=B8gren?= <asjo-zs1E26SLtgtlY7y4Fx5NiA <at> public.gmane.org>
Subject: Re: Using sakura with xmonad
Newsgroups: gmane.comp.lang.haskell.xmonad
Date: Saturday 21st November 2015 21:16:28 UTC (over 2 years ago)
Brandon writes:

> On Wed, Jun 3, 2015 at 5:06 PM, Adam Sjøgren wrote:

>> The sakura windows automatically get a thin transparent border with
>> XMonad, through which my desktop background image shows.

> https://code.google.com/p/xmonad/issues/detail?id=581

So I tried looking into this, being a newbie at Haskell and X11
programming.

What it looks like to me, from the C-code needed in dwm in the issue
above, is to try and look up the normal border color and the focused
border color in the colormap of the window, instead of using the values
found in the default color map.

Ok, so how to do this? It looks like I can just change the two lines in
the windows function in Operations.hs that set the border:

    whenJust (W.peek old) $ \otherw -> io $ setWindowBorder d otherw nbc

     [...]

    whenJust (W.peek ws) $ \w -> io $ setWindowBorder d w fbc

Now, nbc and fbc are Pixels that are looked up in the default color map
once, so they need to be replaced with Pixels looked up in the color map
of the window (otherw or w).

Good, so looking at the C-code, the color map of the window is found by
asking the window's attributes, and grabbing it from there, and
allocNamedColor then can be called with that color map and the name of
the color, getting back an XColor, from which a pixel can be extracted.

But, hm, when I look at getWindowAttributes:

 * http://hackage.haskell.org/package/X11-1.4.0/docs/Graphics-X11-Xlib-Extras.html#v%3AgetWindowAttributes

it returns IO WindowAttributes, but they do not include a color map
entry:

 * http://hackage.haskell.org/package/X11-1.4.0/docs/Graphics-X11-Xlib-Extras.html#t%3AWindowAttributes

Hm. So, this is where I got to.

Any tips?


  Best regards,

    Adam

-- 
 "I'm a driver, I'm a winner, things are gonna change,        Adam Sjøgren
  I can feel it."                                        [email protected]

_______________________________________________
xmonad mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
 
CD: 4ms