darcs patch: simplify StackSet.delete (and 2 more)

Sorry, I forgot to send this earlier. These are the changes needed to
support sticky windows.
David
Sun Jun 24 07:48:54 PDT 2007 David Roundy

droundy:
Sorry, I forgot to send this earlier. These are the changes needed to support sticky windows.
David
Sun Jun 24 07:48:54 PDT 2007 David Roundy
* simplify StackSet.delete Sun Jun 24 07:59:31 PDT 2007 David Roundy
* make delete work when window is in multiple workspaces. Sun Jun 24 08:02:08 PDT 2007 David Roundy
* fix apparent memory leak when floating windows are deleted.
David, can you talk about why/what is needed to support sticky windows, how the current semantics have to change, and any consequences that might result from these changes? Are there some quickcheck properties that can establish the stickyness works? More discussion please! -- Don

On Mon, Jun 25, 2007 at 02:54:05PM +1000, Donald Bruce Stewart wrote:
droundy:
Sorry, I forgot to send this earlier. These are the changes needed to support sticky windows.
David
Sun Jun 24 07:48:54 PDT 2007 David Roundy
* simplify StackSet.delete Sun Jun 24 07:59:31 PDT 2007 David Roundy
* make delete work when window is in multiple workspaces. Sun Jun 24 08:02:08 PDT 2007 David Roundy
* fix apparent memory leak when floating windows are deleted.
In retrospect, I think this last one may be broken. I'm not sure when floating windows have their RationalRectangle deleted, but perhaps delete is not the right time. I'd really rather we didn't store these silly things...
David, can you talk about why/what is needed to support sticky windows, how the current semantics have to change, and any consequences that might result from these changes? Are there some quickcheck properties that can establish the stickyness works?
The current semantics only need to change is: (i) when a window is closed we need to delete it from all workspaces and (ii) when layout out workspaces on the screen, we'd like to ensure that each window is handled just once. This second change is really optional (and debateable). It's not too bad having gaps where sticky windows are located, and has the nice property that changing focus from one screen to another doesn't change one's layout. Neither of these changes affect any of the behavior of core xmonad when copy is not used, because in core xmonad you can never place a window in two workspaces at the same time. I'm not sure what you mean by the stickiness "working". It just means a window exists in multiple workspaces. I guess you might want to check that after deleting a window it isn't present in the stackset, even if it's present in multiple workspaces to start out. The second property involves code in the X monad which isn't currently quickcheckable.
More discussion please!
To actually *use* stickiness (rather than just allowing it), you need two more functions... well only one really, depending how flexible you want to be. You need a function to add a window to a second (or third) workspace, which I call copy, and which behaves almost like shift. Or you could forget flexibility and only allow a window to be made 100% sticky, but that seems less nice. And you'd also like to have a function to remove a window from a given workspace without closing it (unless this is its only incarnation). I called this kill1. Basically, stickiness is almost trivial with the design of xmonad. All you really need is to ensure that delete gets rid of all copies of a window, and that change doesn't affect the non-sticky semantics at all. -- David Roundy Department of Physics Oregon State University

droundy:
On Mon, Jun 25, 2007 at 02:54:05PM +1000, Donald Bruce Stewart wrote:
droundy:
Sorry, I forgot to send this earlier. These are the changes needed to support sticky windows.
David
Sun Jun 24 07:48:54 PDT 2007 David Roundy
* simplify StackSet.delete Sun Jun 24 07:59:31 PDT 2007 David Roundy
* make delete work when window is in multiple workspaces. Sun Jun 24 08:02:08 PDT 2007 David Roundy
* fix apparent memory leak when floating windows are deleted. In retrospect, I think this last one may be broken. I'm not sure when floating windows have their RationalRectangle deleted, but perhaps delete is not the right time. I'd really rather we didn't store these silly things...
David, can you talk about why/what is needed to support sticky windows, how the current semantics have to change, and any consequences that might result from these changes? Are there some quickcheck properties that can establish the stickyness works?
The current semantics only need to change is: (i) when a window is closed we need to delete it from all workspaces and (ii) when layout out workspaces on the screen, we'd like to ensure that each window is handled just once. This second change is really optional (and debateable). It's not too bad having gaps where sticky windows are located, and has the nice property that changing focus from one screen to another doesn't change one's layout.
Neither of these changes affect any of the behavior of core xmonad when copy is not used, because in core xmonad you can never place a window in two workspaces at the same time.
I'm not sure what you mean by the stickiness "working". It just means a window exists in multiple workspaces. I guess you might want to check that after deleting a window it isn't present in the stackset, even if it's present in multiple workspaces to start out. The second property involves code in the X monad which isn't currently quickcheckable.
How does it interact with Xinerama, if we're viewing multiple workspaces simultaneously?
More discussion please!
To actually *use* stickiness (rather than just allowing it), you need two more functions... well only one really, depending how flexible you want to be. You need a function to add a window to a second (or third) workspace, which I call copy, and which behaves almost like shift. Or you could forget flexibility and only allow a window to be made 100% sticky, but that seems less nice. And you'd also like to have a function to remove a window from a given workspace without closing it (unless this is its only incarnation). I called this kill1.
Basically, stickiness is almost trivial with the design of xmonad. All you really need is to ensure that delete gets rid of all copies of a window, and that change doesn't affect the non-sticky semantics at all.
I think, given there's no discussion with the core devs about these changes, you should propose 'sticky windows' or something like that, as a feature request on the bug tracker, so we can consider it. It's hard to appraise, and apply, large patches that land on the mailing list, without first planning the design with the core team -- particularly if they change basic invariants (like no-duplicates in the stackset). So, usual 'please give us a compelling use case' and 'assurances nothing breaks' :-) -- Don

On Tue, Jun 26, 2007 at 01:40:41PM +1000, Donald Bruce Stewart wrote:
droundy:
I'm not sure what you mean by the stickiness "working". It just means a window exists in multiple workspaces. I guess you might want to check that after deleting a window it isn't present in the stackset, even if it's present in multiple workspaces to start out. The second property involves code in the X monad which isn't currently quickcheckable.
How does it interact with Xinerama, if we're viewing multiple workspaces simultaneously?
I feel like how tagging/stickiness interacts with Xinerama is not really a big issue: Multiple monitors take a lot of the stress off of a window manager, since with the extra screen real estate, you get a lot of the features for free that single-screeners have to emulate. So my opinion as an Xinerama user WRT tagging is, so long as it does something somewhat sane and doesn't crash, I don't care. I'm probably not going to use it anyway. I don't think there's any nice, simple way to make tagging work with Xinerama, and I don't think that's a problem because Xinerama essentially already gives you what you're trying to do with tagging. So if stickiness can be implemented in a way that makes sense for the single-screen case, and doesn't totally screw up Xinerama, I think it's probably a good idea. You poor people stuck within the confines of one monitor need all the help you can get. :) Jason Creighton

dons@cse.unsw.edu.au (Donald Bruce Stewart) writes:
How does it interact with Xinerama, if we're viewing multiple workspaces simultaneously?
My suggestion is to order the screens, and if a window is potentially visible on more than one screen, then we display it on the first screen in that order. I think it is better not to always display these windows on the screen that has focus, since often sticky windows are intended to contain information that one refers to from time to time, and that one wishes to have visible at all times, but not necessarily so much in one's face. Then the only "bad" consequence from sticky windows is that displaying workspace A sometimes shows window B and sometimes doesn't, depending on which other workspaces are also visible at that time. Also, it may be that switching workspaces on screen X changes which windows are visible on screen Y. Not that nice, but can't be avoided. Kai
participants (4)
-
David Roundy
-
dons@cse.unsw.edu.au
-
Jason Creighton
-
Kai Grossjohann