darcs patch: DragPane.hs: fixes usage info (requires ... (and 2 more)

Hi,
I'm back... with some patches: the first and the last one are just
documentation fixes.
For the second one, instead, wait for David's approval since it
changes the code to actually use user's supplied colors.
Andrea
Mon Aug 27 11:28:01 CEST 2007 Andrea Rossato

I'm fine with these changes, but haven't applied them to my repository and have a bit of trouble reading them. Perhaps you could add send --unified to your _darcs/prefs/defaults file? It makes it much easier to review patches. David On Mon, Aug 27, 2007 at 11:43:34AM +0200, Andrea Rossato wrote:
Hi,
I'm back... with some patches: the first and the last one are just documentation fixes.
For the second one, instead, wait for David's approval since it changes the code to actually use user's supplied colors.
Andrea
Mon Aug 27 11:28:01 CEST 2007 Andrea Rossato
* DragPane.hs: fixes usage info (requires exporting handleColor) Mon Aug 27 11:29:02 CEST 2007 Andrea Rossato
* DragPane.hs: uses user supplied colors Mon Aug 27 11:40:06 CEST 2007 Andrea Rossato
* HintedTile.hs: fixes usage info

On Mon, Aug 27, 2007 at 10:45:10AM -0400, David Roundy wrote:
I'm fine with these changes, but haven't applied them to my repository and have a bit of trouble reading them. Perhaps you could add send --unified to your _darcs/prefs/defaults file? It makes it much easier to review patches.
I'm sending the unified patches attached to this message, so you can review them easily. Added the send --unified to default for the future. Thanks. Andrea

On Mon, Aug 27, 2007 at 04:55:29PM +0200, Andrea Rossato wrote:
hunk ./DragPane.hs 51 dragPane :: String -> Double -> Double -> Layout a dragPane ident delta split = Layout { doLayout = dolay, modifyLayout = return . message } where - dolay r s = do handlec <- withDisplay $ \dpy -> io $ initColor dpy handleColor + dolay r s = do handlec <- withDisplay $ \dpy -> io $ initColor dpy ident root <- asks theRoot let (left', right') = splitHorizontallyBy split r leftmost = fromIntegral $ case r of Rectangle x _ _ _ -> x
Ah, there's a bit of a problem here, which is that ident is intended to be a unique identifier for each dragPane, particularly when you've got more than one dragPane in a Combo layout (otherwise signals will get crossed). Ideally this would be done automagically (e.g. a self-modifying layout could generate its own random identity and then use that for sending signals to itself), which eventually (if I get back to hacking on DragPane and/or when I get a screen large enough to hold more than three useful panes [one a small clock pane]) I plan on implementing. We could also implement (which would be nice) and XMonadContrib module that generates unique integers, e.g. uniqueInt :: X Int which would probably need to use the unsafePerformIO/NOINLINE trick, alas. Or it could just gamble using a random number generator (which isn't a bad idea, as long as uniqueness isn't required for safety). -- David Roundy http://www.darcs.net

On Mon, Aug 27, 2007 at 11:10:08AM -0400, David Roundy wrote:
Ah, there's a bit of a problem here, which is that ident is intended to be a unique identifier for each dragPane, particularly when you've got more than one dragPane in a Combo layout (otherwise signals will get crossed).
I noticed that ident as an id, but I came to deduce that since it was a string it was intended to be color configuration option (and I described patch's goal as to "actually use user supplied colors"). I don't recall what was the train of thoughts that lead me there. Sort of funny, though... Andrea

On Mon, Aug 27, 2007 at 05:36:37PM +0200, Andrea Rossato wrote:
On Mon, Aug 27, 2007 at 11:10:08AM -0400, David Roundy wrote:
Ah, there's a bit of a problem here, which is that ident is intended to be a unique identifier for each dragPane, particularly when you've got more than one dragPane in a Combo layout (otherwise signals will get crossed).
I noticed that ident as an id, but I came to deduce that since it was a string it was intended to be color configuration option (and I described patch's goal as to "actually use user supplied colors"). I don't recall what was the train of thoughts that lead me there. Sort of funny, though...
It doesn't seem unreasonable, seeing as you were probably looking for an input of type String... I suppose we could use the same input for ID and for color for now, and then our Configs be forward compatible with a future version of DragPlane that has the hokey user-input ID removed. -- David Roundy http://www.darcs.net

On Mon, Aug 27, 2007 at 11:40:16AM -0400, David Roundy wrote:
I suppose we could use the same input for ID and for color for now, and then our Configs be forward compatible with a future version of DragPlane that has the hokey user-input ID removed.
I've already sent an amended patch with usage instruction that suggest the string being the id, and probably forward compatibility is important too. Moreover I think that the module for generating unique ids may be indeed a useful thing to have around. And I could write something down. On the other side we are at the .3 release and a minor change in a layout in a future release is not dramatic. For this reason I would suggest to keep your original design with corrected usage instruction, and change the layout function as soon as we will have the infrastructure we need. Andrea

We could also implement (which would be nice) and XMonadContrib module that generates unique integers, e.g.
uniqueInt :: X Int
which would probably need to use the unsafePerformIO/NOINLINE trick, alas. Or it could just gamble using a random number generator (which isn't a bad idea, as long as uniqueness isn't required for safety).
There's Data.Unique too. Cheers, Spencer Janssen
participants (3)
-
Andrea Rossato
-
David Roundy
-
Spencer Janssen