Bug #242
Recent clients order
0%
Description
Hi,
I've found inconsistent results of Subtlext::Client.recent method.
If I switch between clients within a one view, returned Array of recent clients keeps an order where last client is pushed into the head (ie. at 0 index) and remaining are shifted to the right (ie. their index is increased by 1).
However if I switch between clients on different views (within a one screen), order 'sometimes' gets lost:- Two xterms on 1st view running irb sessions
left one>Subtlext::Client.current.win 41943074
right one>Subtlext::Client.current.win 18874402
- Firefox on 2nd view, win == 16777340
- Left xterm (result of cycling between xterms within one view)
irb(main):047:0> Subtlext::Client.recent.collect {|c| c.win}
=> [41943074, 18874402, 41943074, 18874402, 41943074] - After switching to 2nd view with Firefox and back
irb(main):048:0> Subtlext::Client.recent.collect {|c| c.win}
=> [*41943074*, *16777340*, 41943074, 18874402, 41943074]Good, order was kept.
- Right xterm (result of cycling between xterms within one view)
irb(main):046:0> Subtlext::Client.recent.collect {|c| c.win}
=> [18874402, 41943074, 18874402, 41943074, 18874402] - After switching to 2nd view with Firefox and back
irb(main):047:0> Subtlext::Client.recent.collect {|c| c.win}
=> [18874402, 41943074, 18874402, *16777340*, 18874402]Bad, order is lost, unexpected behaviour.
Is this a bug or am I missing something there ?
History
#1 Updated by Christoph Kappel over 13 years ago
Next time please use instance or window names, just the window ids make it tough to read and to understand.
Actually I have no idea, I just tested this in the current devel and I don't see any inconsistency there.
#2 Updated by david unric over 13 years ago
- I'm in view named "terms", launch two xterms, set left gravity for the first, right for the second.
- Set focus on right xterm and run an irb session from within:
irb(main):008:0> Subtlext::Client.recent.collect {|c| c.instance}
=> ["xterm", "xterm", "xterm", "xterm", "xterm"] - Now I switch to view named "www" and back to "terms" (by ViewSwitch action) and check how result of .recent has changed
irb(main):009:0> Subtlext::Client.recent.collect {|c| c.instance}
=> ["xterm", "xterm", "xterm", "Navigator", "xterm"]
Wrong order, the returned array should look like:
=> ["xterm", "Navigator", "xterm", "xterm", "xterm"]
The issue manifest only if the focus is on right xterm before switching forth & back to other view.
#3 Updated by Christoph Kappel over 13 years ago
I cannot reproduce that. What version of subtle?
#4 Updated by david unric over 13 years ago
dunric@darkstar:~$ subtle -v
subtle 0.10.2988 - Copyright (c) 2005-2011 Christoph Kappel
Released under the GNU General Public License
Compiled for X11R0 and Ruby 1.9.1
#5 Updated by david unric over 13 years ago
- File 10.png 10.png added
- File 07.png 07.png added
- File 26.png 26.png added
- File 39.png 39.png added
- File 58.png 58.png added
- File 04.png 04.png added
Some screenshots to get issue description even more obvious ...
EDIT: what a coincidence, even attached screenshots placed carefully by each step lost their order
07.png -> 26.png -> 39.png (starting with focus on right xterm)
58.png -> 04.png -> 10.png (starting with focus on left xterm)
#6 Updated by david unric over 13 years ago
I've discovered the issue is caused by multiple re-focusing of a client.
- Let's have two windows in one view. Left covers 66% of a view, right covers remaining 34%.
- Focus right window with a keyboard or a mouse. If focused with a keyboard, mouse cursor reappears in the centre of the focused window.
- Now switch to other view (by keyboard) with only one window covering whole area. Mouse cursor is placed in the centre.
- Now switch back to the original view (by keyboard). The right (smaller) window gets focus, but then unintentionaly gets focus the left (larger) window and then again back the right. Thus list of recent focused windows is updated 3 times.
You can check it out by implementing client_focus hook with debugging output:
on :client_focus do |c| $stderr.puts "=> GOT FOCUS: #{c.instance}" $stderr.puts "=> RECENT: #{Subtlext::Client.recent.collect {|c| c.instance}}" end
and monitoring .xsession-errors log with tailf
or other way.
I'm suspecting it has something to do with improperly placed mouse cursor causing loss of originaly focused window.
#7 Updated by Christoph Kappel over 13 years ago
As I told you, I cannot reproduce this. There is no improperly placed pointer.
Can you post your config? Did you verify, that this happens with the stock config? Running any layout sublets or sublets that modify the focus history?
#8 Updated by david unric over 13 years ago
Did tried with stock config (see an attachment), no sublets. Still repeatedly reproducible on my computer :(
Installed X server version:
dunric@darkstar:~$ X -version
X.Org X Server 1.9.5
Release Date: 2011-03-17
X Protocol Version 11, Revision 0
#9 Updated by Christoph Kappel over 13 years ago
- Category set to Bugfix
- Status changed from Unconfirmed to Confirmed
- Assignee set to Non member users
- Target version set to Nu
Ok, I can confirm that now. Tested it just with urxvt's and no problems there. So that just happens with windows that use this odd focus model, going to look into it.
#10 Updated by Christoph Kappel over 13 years ago
- Target version changed from Nu to 28
#11 Updated by Christoph Kappel over 13 years ago
- Target version changed from 28 to Xi
#12 Updated by Christoph Kappel about 13 years ago
- Target version deleted (
Xi)