How to make a dock window for xmonad using gtk2hs?

Hi, I am using gtk2hs to make some sidebar thing for xmonad. Well, after I tried a few ways, I still cannot make it dock like xmobar. It just covered other windows at the edge of the screen. Could someone give me a sample or something I could learn from? Thanks. -- 竹密岂妨流水过 山高哪阻野云飞

On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote:
I am using gtk2hs to make some sidebar thing for xmonad. Well, after I tried a few ways, I still cannot make it dock like xmobar. It just covered other windows at the edge of the screen. Could someone give me a sample or something I could learn from? Thanks.
You need to go to freedesktop.org and read up on the Extended Window Manager Hints. In this particular case the extension you need is the _NET_WM_STRUT property. (xmobar is open source, you could look through its source) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Since I am using gtk, I set Gdk::Window::TYPE_HINT_DOCK as its
document says. But it does not work.
And as I looked into xmobar's source, there seems no special code for
xmonad. And my xmonad.hs is very simple, too.
So I wonder how to make it work....
On Thu, Mar 5, 2009 at 11:59 AM, Brandon S. Allbery KF8NH
On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote:
I am using gtk2hs to make some sidebar thing for xmonad. Well, after I tried a few ways, I still cannot make it dock like xmobar. It just covered other windows at the edge of the screen. Could someone give me a sample or something I could learn from? Thanks.
You need to go to freedesktop.org and read up on the Extended Window Manager Hints. In this particular case the extension you need is the _NET_WM_STRUT property.
(xmobar is open source, you could look through its source)
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
-- 竹密岂妨流水过 山高哪阻野云飞

I am confused. Code like this works in other WM, except xmonad.
#include
Since I am using gtk, I set Gdk::Window::TYPE_HINT_DOCK as its document says. But it does not work. And as I looked into xmobar's source, there seems no special code for xmonad. And my xmonad.hs is very simple, too. So I wonder how to make it work....
On Thu, Mar 5, 2009 at 11:59 AM, Brandon S. Allbery KF8NH
wrote: On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote:
I am using gtk2hs to make some sidebar thing for xmonad. Well, after I tried a few ways, I still cannot make it dock like xmobar. It just covered other windows at the edge of the screen. Could someone give me a sample or something I could learn from? Thanks.
You need to go to freedesktop.org and read up on the Extended Window Manager Hints. In this particular case the extension you need is the _NET_WM_STRUT property.
(xmobar is open source, you could look through its source)
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
-- 竹密岂妨流水过 山高哪阻野云飞
-- 竹密岂妨流水过 山高哪阻野云飞

On Thursday 05 March 2009 09:45:51 Magicloud Magiclouds wrote:
I am confused. Code like this works in other WM, except xmonad.
You code does not set _NET_WM_STRUT property. And because of that xmonad doesn't treat it specifically. You can inspect you window properties using `xprop' utility.

Here is my window, seems right... but cannot get a gap....
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
window id # of group leader: 0x1800001
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 25165829
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1800004
WM_CLIENT_LEADER(WINDOW): window id # 0x1800001
_NET_WM_PID(CARDINAL) = 16671
WM_LOCALE_NAME(STRING) = "zh_CN.UTF-8"
WM_CLIENT_MACHINE(STRING) = "shidaw.desktop.amazon.com"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 162 by 54
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS,
_NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "sideBar.rb", "SideBar.rb"
WM_ICON_NAME(STRING) = "sideBar.rb"
_NET_WM_ICON_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61,
0x72, 0x2e, 0x72, 0x62
WM_NAME(STRING) = "sideBar.rb"
_NET_WM_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61, 0x72,
0x2e, 0x72, 0x62
On Thu, Mar 5, 2009 at 7:42 PM, Khudyakov Alexey
On Thursday 05 March 2009 09:45:51 Magicloud Magiclouds wrote:
I am confused. Code like this works in other WM, except xmonad.
You code does not set _NET_WM_STRUT property. And because of that xmonad doesn't treat it specifically. You can inspect you window properties using `xprop' utility.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- 竹密岂妨流水过 山高哪阻野云飞

On 2009 Mar 8, at 23:45, Magicloud Magiclouds wrote:
Here is my window, seems right... but cannot get a gap....
Once again: where's the _NET_WM_STRUT? I've looked through your properties, but none of them is _NET_WM_STRUT. Non-tiling window managers may dock the window in a default fashion because of _NET_WM_WINDOW_TYPE, but xmonad needs to know how much space to reserve for it.
WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. window id # of group leader: 0x1800001 _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 25165829 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1800004 WM_CLIENT_LEADER(WINDOW): window id # 0x1800001 _NET_WM_PID(CARDINAL) = 16671 WM_LOCALE_NAME(STRING) = "zh_CN.UTF-8" WM_CLIENT_MACHINE(STRING) = "shidaw.desktop.amazon.com" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified minimum size: 162 by 54 window gravity: NorthWest WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = "sideBar.rb", "SideBar.rb" WM_ICON_NAME(STRING) = "sideBar.rb" _NET_WM_ICON_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61, 0x72, 0x2e, 0x72, 0x62 WM_NAME(STRING) = "sideBar.rb" _NET_WM_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61, 0x72, 0x2e, 0x72, 0x62
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Wed, Mar 04, 2009 at 10:59:53PM -0500, Brandon S. Allbery KF8NH wrote:
On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote:
Could someone give me a sample or something I could learn from? Thanks.
(xmobar is open source, you could look through its source)
xmobar is not open source. xmobar is FREE software! here's the relevant bits (from Xmobar.hs) setProperties :: Rectangle -> Config -> Display -> Window -> [Rectangle] -> IO () setProperties r c d w srs = do a1 <- internAtom d "_NET_WM_STRUT_PARTIAL" False c1 <- internAtom d "CARDINAL" False a2 <- internAtom d "_NET_WM_WINDOW_TYPE" False c2 <- internAtom d "ATOM" False v <- internAtom d "_NET_WM_WINDOW_TYPE_DOCK" False changeProperty32 d w a1 c1 propModeReplace $ map fi $ getStrutValues r (position c) (getRootWindowHeight srs) changeProperty32 d w a2 c2 propModeReplace [fromIntegral v] hope this helps. Best, Andrea

On 2009 Mar 5, at 8:21, Andrea Rossato wrote:
On Wed, Mar 04, 2009 at 10:59:53PM -0500, Brandon S. Allbery KF8NH wrote:
On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote:
Could someone give me a sample or something I could learn from? Thanks.
(xmobar is open source, you could look through its source)
xmobar is not open source. xmobar is FREE software!
I don't do fundamentalist religion... -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Thu, Mar 05, 2009 at 12:50:20PM -0500, Brandon S. Allbery KF8NH wrote:
On 2009 Mar 5, at 8:21, Andrea Rossato wrote:
xmobar is not open source. xmobar is FREE software!
I don't do fundamentalist religion...
qualifying as fundamentalism the avoidance of cheap marketing strategies is just a ... cheap marketing strategy. cheers, andrea
participants (4)
-
Andrea Rossato
-
Brandon S. Allbery KF8NH
-
Khudyakov Alexey
-
Magicloud Magiclouds