From renaud at casenave-pere.fr Sat Apr 13 05:22:45 2013 From: renaud at casenave-pere.fr (=?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?=) Date: Sat, 13 Apr 2013 14:22:45 +0900 Subject: [clfswm-devel] Questions / Feature requests regarding the focus policy In-Reply-To: <871uao1zc6.fsf@common-lisp.net> (Philippe Brochard's message of "Fri, 05 Apr 2013 22:45:13 +0200") References: <87wqt21ivn.fsf@casenave-pere.fr> <87boae5dnt.fsf@common-lisp.net> <12f59786260026ff4cc317acdc0c2745@casenave-pere.fr> <87ppyokcrd.fsf@common-lisp.net> <87k3oww4jd.fsf@casenave-pere.fr> <871uao1zc6.fsf@common-lisp.net> Message-ID: <87d2tzdmxm.fsf@zahikel.casenave.fr> Hi, On Sat, Apr 06 2013, Philippe Brochard wrote: > [Sorry for the lag] [Likewise...] > I have updated the code to move mouse pointer only when it's really > needed. Also, the focus change only on mouse move so we can use the > keyboard to circulate over children. It's working quite well, thank you! If I see something wrong, I'll fill a bug report. > I've also committed your three columns layout (in your name). Many > thanks! Oh, thank you, thanks to you I am now officially a free software contributor :) Regarding my request for a non-stealing focus policy, it seems frame-nw-hook doesn't get called when an already existing window requires focus so setting leave-focus-frame-nw-hook didn't help after all. But I found out that commenting (focus-all-children window (find-parent-frame window (find-current-root))) from (define-handler main-mode :configure-request (stack-mode window x y width height border-width value-mask) ...) in clfswm.lisp:83 did the trick. Is it a bad idea? -- Renaud Casenave-P?r? From akshaysrinivasan at gmail.com Sun Apr 21 21:55:17 2013 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 21 Apr 2013 14:55:17 -0700 Subject: Keybindings which affect windows ? Message-ID: <51746046.62a4420a.6e8c.ffffda50@mx.google.com> Hello, Is there anyway I can affect windows with keybindings ? Right now it looks like this sort of capability is only available to mouse-bindings. Would it work if I call something like: (define-main-mouse ("Left" :shift :mod-1) 'move-window-to-left-brother) If the mouse-keybindings are handled by a thread that handles mouse events in X, then this will not work; is there some way out ? (Sorry for not trying the code before posting). Akshay From pbrochard at common-lisp.net Tue Apr 23 20:43:25 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Tue, 23 Apr 2013 22:43:25 +0200 Subject: Keybindings which affect windows ? In-Reply-To: <5176c0da.ca00450a.3ab2.35d3@mx.google.com> (Akshay Srinivasan's message of "Tue, 23 Apr 2013 03:11:50 -0700") References: <51746046.62a4420a.6e8c.ffffda50@mx.google.com> <87ppxmpdxo.fsf@common-lisp.net> <5176c0da.ca00450a.3ab2.35d3@mx.google.com> Message-ID: <8761zdyo42.fsf@common-lisp.net> Akshay Srinivasan writes: > At Mon, 22 Apr 2013 21:23:31 +0200, > Philippe Brochard wrote: >> >> Akshay Srinivasan writes: >> >> > Hello, >> > >> Hi, >> >> > Is there anyway I can affect windows with keybindings ? Right now it looks like >> > this sort of capability is only available to mouse-bindings. >> > >> You're right, this capability is only for mouse actually. >> There is a need for other keybindings (in main and second mode), so I've >> added them in the commit 4cd4754. >> >> Please, test: Control+Shift+Left/Right to move over next/previous >> brother and take the current window in it. >> Control+Shift+Alt+Left/Right/Up/Down: same thing but spatially. > The non-spatial keybinding didn't work, but (more importantly :) the spatial > one did. Thank you! > Are you sure the non-spatial keybinding doesn't work? You have to release all keys before starting it and there must be a focused window. Please, can you investigate? >> This must work in both main and second mode. >> >> >Would it work if I call something like: >> > (define-main-mouse ("Left" :shift :mod-1) 'move-window-to-left-brother) >> > >> > If the mouse-keybindings are handled by a thread that handles mouse events in X, then this >> > will not work; is there some way out ? (Sorry for not trying the code before posting). >> > >> No, this can't work because key binding and mouse binding are stored in >> different hash table. The mechanism for both is not nearly the >> same. (And more there is different hash table for each mode). >> BTW clfswm is not threaded there is only one single loop. > That's interesting, I assumed it was multithreaded. So does it wait for X events > or poll for them ? > It listen for event(1) and proceed(2) them when there is some in the event queue. So clfswm is sequential and need only one thread/loop. But there is some optimizing functions to compress mouse motion events for example. I have had a look at XCB(3) but I haven't gone in this direction for now. Philippe (1) http://common-lisp.net/project/cmucl/doc/clx/12_4_Managing_the_Event_Queue.html (2) http://common-lisp.net/project/cmucl/doc/clx/12_3_Processing_Events.html (3) http://xcb.freedesktop.org/ From pbrochard at common-lisp.net Wed Apr 24 20:59:00 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 24 Apr 2013 22:59:00 +0200 Subject: Keybindings which affect windows ? In-Reply-To: (Akshay Srinivasan's message of "Tue, 23 Apr 2013 16:08:52 -0700") References: <51746046.62a4420a.6e8c.ffffda50@mx.google.com> <87ppxmpdxo.fsf@common-lisp.net> <5176c0da.ca00450a.3ab2.35d3@mx.google.com> <8761zdyo42.fsf@common-lisp.net> Message-ID: <874nev7ii3.fsf@common-lisp.net> Akshay Srinivasan writes: > On 23 April 2013 13:43, Philippe Brochard wrote: > > Akshay Srinivasan writes: > > > At Mon, 22 Apr 2013 21:23:31 +0200, > > Philippe Brochard wrote: > >> > >> Akshay Srinivasan writes: > >> > >> > Hello, > >> > > >> Hi, > >> > >> > ? ?Is there anyway I can affect windows with keybindings ? Right now > it looks like > >> > this sort of capability is only available to mouse-bindings. > >> > > >> You're right, this capability is only for mouse actually. > >> There is a need for other keybindings (in main and second mode), so I've > >> added them in the commit 4cd4754. > >> > >> Please, test: Control+Shift+Left/Right to move over next/previous > >> brother and take the current window in it. > >> Control+Shift+Alt+Left/Right/Up/Down: same thing but spatially. > > The non-spatial keybinding didn't work, but (more importantly :) the > spatial > > one did. Thank you! > > > Are you sure the non-spatial keybinding doesn't work? You have to > release all keys before starting it and there must be a focused window. > Please, can you investigate? > > Ah, okay. It seems to work, but the keybinding seems to be Alt-Shift-Left/ > Right... instead of Ctrl-Shift. > Oops, sorry indeed, it's Alt-Shift-Left/Right. > ? > > > >> This must work in both main and second mode. > >> > >> >Would it work if I call something like: > >> > (define-main-mouse ("Left" :shift :mod-1) > 'move-window-to-left-brother) > >> > > >> > If the mouse-keybindings are handled by a thread that handles mouse > events in X, then this > >> > will not work; is there some way out ? (Sorry for not trying the code > before posting). > >> > > >> No, this can't work because key binding and mouse binding are stored in > >> different hash table. The mechanism for both is not nearly the > >> same. (And more there is different hash table for each mode). > >> BTW clfswm is not threaded there is only one single loop. > > That's interesting, I assumed it was multithreaded. So does it wait for X > events > > or poll for them ? > > > It listen for event(1) and proceed(2) them when there is some in the event > queue. So clfswm is sequential and need only one thread/loop. > But there is some optimizing functions to compress mouse motion events > for example. > > I have had a look at XCB(3) but I haven't gone in this direction for > now. > > Philippe > > (1) http://common-lisp.net/project/cmucl/doc/clx/ > 12_4_Managing_the_Event_Queue.html > (2) http://common-lisp.net/project/cmucl/doc/clx/ > 12_3_Processing_Events.html > (3) http://xcb.freedesktop.org/ From pbrochard at common-lisp.net Sun Apr 21 20:57:55 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 21 Apr 2013 22:57:55 +0200 Subject: [clfswm-devel] Questions / Feature requests regarding the focus policy In-Reply-To: <87d2tzdmxm.fsf@zahikel.casenave.fr> ("Renaud \=\?iso-8859-1\?Q\?Casenave-P\=E9r\=E9\=22's\?\= message of "Sat, 13 Apr 2013 14:22:45 +0900") References: <87wqt21ivn.fsf@casenave-pere.fr> <87boae5dnt.fsf@common-lisp.net> <12f59786260026ff4cc317acdc0c2745@casenave-pere.fr> <87ppyokcrd.fsf@common-lisp.net> <87k3oww4jd.fsf@casenave-pere.fr> <871uao1zc6.fsf@common-lisp.net> <87d2tzdmxm.fsf@zahikel.casenave.fr> Message-ID: <874nez8uuk.fsf@common-lisp.net> Renaud Casenave-P?r? a ?crit : > Hi, > > On Sat, Apr 06 2013, Philippe Brochard wrote: > >> [Sorry for the lag] > > [Likewise...] > [And again...] >> I have updated the code to move mouse pointer only when it's really >> needed. Also, the focus change only on mouse move so we can use the >> keyboard to circulate over children. > > It's working quite well, thank you! > If I see something wrong, I'll fill a bug report. > ok, thanks! >> I've also committed your three columns layout (in your name). Many >> thanks! > > Oh, thank you, thanks to you I am now officially a free software contributor :) > Your welcome! Continue like this :-) > > Regarding my request for a non-stealing focus policy, it seems frame-nw-hook > doesn't get called when an already existing window requires focus so setting > leave-focus-frame-nw-hook didn't help after all. > But I found out that commenting > > (focus-all-children window (find-parent-frame window (find-current-root))) > > from > > (define-handler main-mode :configure-request (stack-mode window x y width height border-width value-mask) > ...) > > in clfswm.lisp:83 > > did the trick. Is it a bad idea? > It's a bad idea because this line is here to maintain the clfswm tree in a consistent order. Maybe we have to add a specific case following the new window hook? But before this, do you have a reproductive case of your expected behaviour (which application steal the focus?) Regards, Philippe From pbrochard at common-lisp.net Wed Apr 24 20:56:15 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 24 Apr 2013 22:56:15 +0200 Subject: [clfswm-devel] Questions / Feature requests regarding the focus policy In-Reply-To: <87haiwg02g.fsf@casenave-pere.fr> ("Renaud \=\?iso-8859-1\?Q\?Cas\?\= \=\?iso-8859-1\?Q\?enave-P\=E9r\=E9\=22's\?\= message of "Wed, 24 Apr 2013 11:00:07 +0900") References: <87wqt21ivn.fsf@casenave-pere.fr> <87boae5dnt.fsf@common-lisp.net> <12f59786260026ff4cc317acdc0c2745@casenave-pere.fr> <87ppyokcrd.fsf@common-lisp.net> <87k3oww4jd.fsf@casenave-pere.fr> <871uao1zc6.fsf@common-lisp.net> <87d2tzdmxm.fsf@zahikel.casenave.fr> <874nez8uuk.fsf@common-lisp.net> <87haiwg02g.fsf@casenave-pere.fr> Message-ID: <878v477imo.fsf@common-lisp.net> Renaud Casenave-P?r? a ?crit : > On Mon, Apr 22 2013, Philippe Brochard wrote: > >> It's a bad idea because this line is here to maintain the clfswm tree in >> a consistent order. > > That's too bad... Well there are some problems with this approach, but it kind > of works :) > > >> Maybe we have to add a specific case following the new window hook? >> But before this, do you have a reproductive case of your expected >> behaviour (which application steal the focus?) > > You can reproduce it like this (I use conkeror as my default browser): > > If you have emacs and a browser (one which uses tabs over several windows) > opened and in the same frame (I'm not sure if you can reproduce this if they are > in different frames) and use browse-url from emacs, the browser intercepts the > call, opens a new tab and steals the focus. > That's funny we have had the inverse request with the same example some times ago because clfswm did not change focus on configure request :-) So, to please both request, I have added a configuration variable (*steal-focus*) which allow to control if clfswm has to steal or not the focus on configure request. You'll have to set it to nil in your configuration file or change it from the configuration menu. > Thanks! > Please, test! Philippe From pbrochard at common-lisp.net Mon Apr 22 19:23:31 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Mon, 22 Apr 2013 21:23:31 +0200 Subject: Keybindings which affect windows ? In-Reply-To: <51746046.62a4420a.6e8c.ffffda50@mx.google.com> (Akshay Srinivasan's message of "Sun, 21 Apr 2013 14:55:17 -0700") References: <51746046.62a4420a.6e8c.ffffda50@mx.google.com> Message-ID: <87ppxmpdxo.fsf@common-lisp.net> Akshay Srinivasan writes: > Hello, > Hi, > Is there anyway I can affect windows with keybindings ? Right now it looks like > this sort of capability is only available to mouse-bindings. > You're right, this capability is only for mouse actually. There is a need for other keybindings (in main and second mode), so I've added them in the commit 4cd4754. Please, test: Control+Shift+Left/Right to move over next/previous brother and take the current window in it. Control+Shift+Alt+Left/Right/Up/Down: same thing but spatially. This must work in both main and second mode. >Would it work if I call something like: > (define-main-mouse ("Left" :shift :mod-1) 'move-window-to-left-brother) > > If the mouse-keybindings are handled by a thread that handles mouse events in X, then this > will not work; is there some way out ? (Sorry for not trying the code before posting). > No, this can't work because key binding and mouse binding are stored in different hash table. The mechanism for both is not nearly the same. (And more there is different hash table for each mode). BTW clfswm is not threaded there is only one single loop. Thanks for the request, > Akshay > Philippe