Window placement hack...



	Well, I love sawfish because of the scripting capability, but have
never really delved into it, so I could use a few pointers.
	The problem:  I am now using dual monitors using xrandr, but the window
placement really sux.  I read mail on one monitor, but when I open a
message, the window is placed on the other monitor.  When I hit reply,
the reply window is opened back on the first monitor.  When I send the
email and am prompted for my GPG key, the dialog opens up back on the
second monitor.  Basically, everything I do is a tennis match.
	What I want to do is learn how to hook into the window placement
algorithm.  Ideally, I want to write a script that forces all new
windows into the first screen.  I know the geometry of that screen from
the xrandr output, so this should not be too hard.
	There may be an easier way, but I want to get hooked into that part of
the code for a second reason: stickyness.  I have four sawfish desktops,
each of which is a 3x3 workspace.  With two monitors, this is still
technically "4x3x3", with each screen just double wide.  However, I want
to treat it as "4x3x3+1".  I.e., I want anything I move to the second
monitor to automatically become sticky, and anything I move to the first
monitor to become unsticky.
	Even this is dual agenda, as once I understand window placement hooks,
I want to work on my ultimate goal: have each subsection (read: monitor)
of a virtual desktop to pretend to be different workspaces.  I.e., right
now, I have ALT-F1 through ALT-F4 are bound to switch desktops, and
ALT-SHIFT-arrow moves between viewports on a desktop.  What I want to
have happen is for these actions to only affect one monitor at a time.
I.e., ALT-F2 would mean:

Determine which region (as defined by xrandr) the mouse is in.
If that region is workspace 2
  do nothing.
Else
  Hide every window in the current viewport of the current desktop that
is in the same region as the mouse.
  Unhide every window that is marked as belonging to workspace 2 and
which is in the same region as the mouse.

	The "region" of a window is, for lack of a better standard, defined to
be the location of the upper left corner.

	This means that I can cycle each monitor separately from the other, and
also move windows between them.  The closest sawfish gets to this
currently is using the multiple screens (i.e., :0.0 and :0.1), but that
requires that applications be multi-screen aware in order to move
between desktops.  It seems to me that the window manager could actually
accomplish this with a little more work.
	Basically, sawfish would need to have its notion of "current workspace"
be an array instead of a scalar.  Its tracking of which workspace a
window belongs to would not have to change, as it would just use the
window location (upper left corner of the window) to determine which
slot in the workspace list is applicable.
	Make sense?

-  
Jack McKinney
GPG 1024D/99C6A174
jackmc lorentz com YM:lfaatsnat2006 AIM:jackmclorentz
Whoever put the '.' next to the '/' on a keyboard obviously never used
the -R option to /bin/chown

Attachment: signature.asc
Description: This is a digitally signed message part



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