[xmonad] Issue 494 in xmonad: need a way to run a layout in pure mode for inactive workspaces, with an approximation of window rectangles etc.

codesite-noreply at google.com codesite-noreply at google.com
Sat Feb 18 04:57:04 CET 2012


Status: New
Owner: ----

New issue 494 by allber... at gmail.com: need a way to run a layout in pure  
mode for inactive workspaces, with an approximation of window rectangles  
etc.
http://code.google.com/p/xmonad/issues/detail?id=494

This is not quite the usual kind of bug report; there are two user-reported  
issues in the IRC log I'm pasting in, which could probably be made into  
separate proper bug reports, but this is more a placeholder for something  
we should consider doing in the future.  It's something of a complex issue,  
which is why I'm just recording the IRC log.

(This also came up in another variation a couple nights ago, in the form  
of "how can I do PrevLayout?":  some of the possible answers turn out to  
hinge on the same issue of wanting to run the layout "quietly" i.e.  
purely.  It also relates to another longstanding issue where we can't  
provide window information for inactive workspaces to EWMH pagers.)

[18 02:29] <vodik> okay, warning: vague question since im exploring an  
issue im having
[18 02:29] <vodik> im trying to make broadcastMessages broadcast to each  
active layout on startup
[18 02:30] <vodik> however it seems that it doesn't send things
[18 02:30] <vodik> so tracing though what broadcastMessage does, it seems  
to, when presented a layouts like this:
[18 02:31] <pzuraq> I'm using XFCE, and have 3 of the workspace switcher  
plugins (one for each of my monitors) but they all point toward the  
currently selected screen
[18 02:31] <vodik> onWorkspace "foo" layout1 $ layout2
[18 02:31] <pzuraq> if I'm focussed to screen 1, all of them say 1
[18 02:31] <vodik> i thinks that the current layout on foo is layout2, not  
layout1
[18 02:31] <pzuraq> I want them to focus to the current screen
[18 02:31] <vodik> unless i travel to that tag first
[18 02:32] <geekosaur> pzuraq, workspace switchers will do that, they can't  
be done "cirrectly" because that requires running the layout, and unless  
the layout is 100% pure (and currently there is no way to check this) that  
requires switching to the workspace
[18 02:32] <geekosaur> I have some notes about caching information but  
can't do anything about it for a while
[18 02:33] <vodik> so how does switching tags resolve layouts?
[18 02:33] <vodik> is there any way to force this?
[18 02:33] <geekosaur> vodik, I think that's a variation on that question  
the other night about backing up through the layouts; until the workspace  
is made current, the layout is not yet "run" and has not selected anything  
yet
[18 02:34] <vodik> yeah, i was there, guess its the same problem this
[18 02:34] <vodik> *then
[18 02:34] <geekosaur> (also see my response to pzuraq, it's actually the  
same problem in different guise!)
[18 02:34] <pzuraq> damn
[18 02:34] <pzuraq> so there's no way around it then
[18 02:34] <geekosaur> not resently
[18 02:34] <geekosaur> *presently
[18 02:35] <pzuraq> damn. That sucks =/
[18 02:35] <pzuraq> I guess I'll have to make it :P
[18 02:37] <vodik> geekosaur: well then, at least i have a decent workaround
[18 02:38] <geekosaur> in theory, if every layout provided a pure  
approximation, we could run the layout in pure mode whenever necessary  
(solving both your and vodik's problems in one fell swoop), but some  
layouts leave the pure version stubbed and only implement the impure  
version, and presently xmonad always invokes the impure version (which by  
default invokes the pure one)
[18 02:39] <geekosaur> (aaaand my network fell over twie while I was typing  
that in, sorry)
[18 02:39] <geekosaur> twice
[18 02:39] * mrdk has quit (Ping timeout: 276 seconds)
[18 02:40] <geekosaur> my notes are about caching the result of running the  
layout, which has the shortcoming that there will be no information for a  
workspace until the first time it's visited (i.e. it turns your problem  
into vodik's)
[18 02:40] <vodik> why not just visit every workspace then
[18 02:41] <geekosaur> but it's easier in that it doesn't require that we  
go over all layouts and make sure there's a pure version of the layout  
function that produces a decent approximation
[18 02:41] <geekosaur> vodik, that's going to produce a LOT of "screen  
flicker" on xmonad startup
[18 02:42] <geekosaur> well, mostly on restart with populated workspaces,  
but still.
[18 02:42] <vodik> oh i guess. i was thinking maybe some sort of quick  
visit behind the scene
[18 02:42] <geekosaur> if it could be done behind the scenes, it would  
necessarily be pure
[18 02:42] <vodik> technically couldn't you serialze that cache too?
[18 02:43] <vodik> riiight
[18 02:43] <vodik> so why not just declare all layouts must have pure  
approximations? :)
[18 02:45] <geekosaur> the whole problem is that you need toallow impure  
layouts to manipulate X11, so the workspace has to actually be made current  
and visible :/ [and net fell over again...]
[18 02:45] <geekosaur> that means auditing all existing layouts too.  and  
it's not always clear how to do a pure approximation
[18 02:45] <vodik> i guess the second part is the clincher
[18 02:46] <geekosaur> I can tell you right now anything using Decoration  
will be a right ***** to do a pure simulation of
[18 02:46] <geekosaur> (meaning, everyone's favorite Tabbed layout)
[18 02:48] <geekosaur> anyway, it's something to think about for the  
future, but it will be a rather large undertaking
[18 02:49] <geekosaur> hrm, actually, lemme copy this discussion and file a  
bug, so at least we have a record of it
[18 02:50] <pzuraq> yeah
[18 02:50] <pzuraq> a while ago there
[18 02:50] <pzuraq> Still have a lot to learn
[18 02:51] <vodik> pzuraq: me too, still not sure what goes on under the  
hood :P
[18 02:53] <geekosaur> pzuraq, the tl;dr is "xmonad can only really know  
what's going on on a workspace by actually making it current and letting it  
draw all the windows"
[18 02:54] * nathan28 has quit (Quit: leaving)
[18 02:55] <pzuraq> geekosaur: Hmm, so that means its going to take a lot  
of fiddlin to get that functionality...
[18 02:55] <pzuraq> fun fun :D
[18 02:55] <pzuraq> just, not right now I guess
[18 02:56] <pzuraq> I need to get other things done first
[18 02:56] <geekosaur> so anything that needs to know the state of a  
non-current workspace (where windows are in your case, what the actual  
initial layout is in vodik's --- keep in mind a layout is a *program*, it  
has to be run at least once on a workspace even to determine what the  
actual initial layout on that workspace is) won't quite work right as  
xmonad currently is
[18 02:56] * wyfrn has quit (Read error: Operation timed out)
[18 02:57] <geekosaur> and fixing this will require some work :/
[18 02:57] <geekosaur> (another notwork drop...)
[18 02:57] <pzuraq> is there some way to associate it with the individual  
xinerama screens?
[18 02:58] <pzuraq> x-sessions
[18 02:58] <pzuraq> whatever they are
[18 02:58] <geekosaur> and in theory the workspace name should be "easy" to  
get, but since it goes through the StackSet to find it currently and the  
StackSet is lazily created on first visit to the workspace (mainly because  
it needs to know the layout, which can only be determined by running it,  
meaning we have to actually visit the workspace...)
[18 02:59] <geekosaur> annoying
[18 02:59] <pzuraq> D:
[18 02:59] <pzuraq> Ihate
[18 02:59] <geekosaur> associate what?
[18 02:59] <pzuraq> when things are not well thought out
[18 02:59] <pzuraq> which workspace is on which screen
[18 03:00] <pzuraq> I'm guessing not
[18 03:00] <geekosaur> again, that requires a fully populated stackset,  
which requires visitng the workspace
[18 03:01] <geekosaur> which is why I'm making a bug for this, it's  
something we really should deal with but it'll be a lot of work
[18 03:01] <geekosaur> maybe someone can come up with a good way to fake  
the simple stuff in the meantime




More information about the xmonad mailing list