bar.js: fixed positioning of window
bar.js: do not resize panel when it is a window

It causes problem with minimized/maximized windows.