Re: Window border problems



Wow, I was about to send this mail, but Alexey was faster. :)
------------------------------------------------------------------------
First, I explain the patch. (Please, Alyocheka, if you want your patch
to be adopted, do it yourself first.)

1. The border is "extra" / outer in some sense; if a window has a
frame, then the border surrouds the frame.

2. The add-window-hook is a good place to use them. If you call these
functions from e.g. sawfish-client, then the border appears after
frame redraw / rebuild is done, for example after window move/resize,
or after new choice of frame. This is what is meant by:

> [they] might have to set flag to rebuild window frame.  

Hmm, `placed' property is set to a window after that window is begun
to be managed by Sawfish. (Dunno whether it is the best way to judge.)
So, calling 'rebuild-frames' does only that flag is set.

3.
> id would be nice if border could be set from theme.jl, not from
> hook. 

"id" is a typo for "it"?

User interface is the most difficult part to decide. What many user
want will be fixed to the center. As a starting point, I think it's
sufficient to put your example in the manual:

(add-hook 'add-window-hook
	  (lambda (w)
	    (let ((bw (case (window-type w)
			((unframed shaped shaped-transient) 0)
			((dockapp) 0)
			(t 1))))
	      (set-window-border w (get-color "black"))
	      (set-window-border-width w bw))))

It is not good to make the border width as a global option, just
by the reason your hook indicates; it's likely that a user want
it to vary for window types.

Since the border is independent of the chosen frame, I don't think
it can go into theme definition, either.

> It could also be turned into propeties or frame attributes.

Yep, wm.ext.match-window can be used. (It implements "window
rules".) But if it should rely on a hook, and not to be called from
theme, then putting it into match-window may be meaningless.

4. It is possible that a client specify a border prior to Sawfish.
Previously, the border is overriden by Sawfish, as none. But the patch
respects the clients border. If a user sets a border, then it overrides
the client's border. Regardless of the patch, the original border is
restored after Sawfish terminates.

So the proposed fuction names should be kept, not as
"set-extra-border...". There're already `window-border-width'.

> LOL, XShapeCombineShape(3X) also affect border.

Shape extension enables non-rectangular windows. But such clients
have nothing to do, no? I have only xeyes, but they are not framed.


After understanding those, phew, I've read the Sawfish source, and
your patch looks consistent. (Thus superb.)

You've put "fixme" to lisp functions, but they're ok. You can also
declare them "extren" in sawfish_subrs.h.
------------------------------------------------------------------------
Some parts of my reply is now outdated. I'll have a see.

By the way, I'm just curious, which WM do you use, WindowMaker or
Sawfish? :)

Regards,
Teika (Teika kazura)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]