2 Dec 2008 07:43
Roll your own Window Manager (was: Re: Re: grab focus)
Omer Zak <w1@...>
2008-12-02 06:43:39 GMT
2008-12-02 06:43:39 GMT
I googled for the above and came up with: http://en.wikipedia.org/wiki/Xmonad - a tiling window manager for X-Window, written in Haskell. Makes it possible to manage windows without using a mouse. http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/01 http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/17 Those articles describe the design of the above (written in Haskell, of all languages!). Version 0.1 is 490 lines of code, so does it (with Haskell libraries) have sufficiently small memory footprint for use in Erez D's system? --- Omer On Tue, 2008-12-02 at 07:43 +0200, Shachar Shemesh wrote: > Omer Zak wrote: > > > > OK, I'll bite even though I know of no such utility. > > I assume that you are using X-Window server, but without any window > > manager. > > 1. Find or develop an utility for simulating mouse events and delivering > > them to X-Window. Then use mouse events to change focus. > > 2. Find or write a very simple window manager, which knows to switch > > focus by commands via a FIFO, to which your command line utility writes. > > 3. Is it possible to write a simple application which calls XSendEvent() > > with suitable events? > > > > > 1 and 3 will simply not work. Without a window manager there are just > two options. The X default is that the focus follows the mouse. Changing > this default will lead to the focus hanging on a certain window until > changed via the API. There is no mouse or keyboard sequence to tell X to > switch focus to another window. This is 100% the window manager's task. > > As for 2, it will work, but it is probably a gross overkill. > > How do you intend to identify the window that is to receive focus? Do > you have its Window ID? Do you want to do it by screen coordinates? > > If the former, RTFM the XSetInputFocus command. Aside from the overheads > (opening the X session), this is a one function command, and should be > fairly straight forward. Be warned, however, that it may very well not > work if a window manager happens to be running, as a window manager has > total veto power over any command affecting, well, windows (size, > display/hide, move etc.), so if you are trying to test it with KDE or > Gnome running, and it does nothing, don't despair. Try it again with no > window manager. > > Shachar -- -- "Kosher" Cellphones (cellphones with blocked SMS, video and Internet) are menace to the deaf. They must be outlawed! (See also: http://www.zak.co.il/tddpirate/2006/04/21/the-grave-danger-to-the-deaf-from-kosher-cellphones/) My own blog is at http://www.zak.co.il/tddpirate/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html ================================================================= To unsubscribe, send mail to linux-il-request@... with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail linux-il-request@...