Bug #295
Setting a client's gravity in a tag's @on_match@ is broken
0%
Description
Basically, if you try to set a client's gravity in the on_match
of a tag, it will work if the tag is in the first view, but doesn't work in the other views. To see what I mean... try this config:
Now, what this does is, puts all the terminals on the foo
tag and Firefox on the bar
tag (adjust it as needed). And then, when the clients match, it will manually assign them gravities by using on_match
.
This works correctly on the foo
view (all the terminals are on the left side), but does not work for the bar
view (Firefox is not on the right side as expected).
In addition, it spews out these error messages on the console:
<WARNING> StandardError: No geometry given from /mnt/pauan/.config/subtle/subtle.rb:49:in `gravity' from /mnt/pauan/.config/subtle/subtle.rb:49:in `block (2 levels) in <main>' from -e:in `call' <WARNING> StandardError: No geometry given from /mnt/pauan/.config/subtle/subtle.rb:40:in `gravity' from /mnt/pauan/.config/subtle/subtle.rb:40:in `block (2 levels) in <main>'
So, the two bugs are:
- Complaining about a lack of geometry when setting the gravity of the client
- Setting the gravity of a client only works on the first view (possibly related to the above bug?)
History
#1 Updated by Christoph Kappel over 12 years ago
#2 Updated by Sae Hirak over 12 years ago
Ah! I see! Thank you, I should be able to fix that, then...
#3 Updated by Sae Hirak over 12 years ago
Okay, I updated the config and tried both {:foo => :foo}
and {"foo" => :foo}
. Neither worked, and I'm still getting the No geometry given
error, except this time the error is from accessing c.gravity
rather than from setting it.
#4 Updated by Sae Hirak over 12 years ago
Okay... I just tried something. I inserted the actual View object rather than a symbol or string:
c.views.each { |v| c.gravity = { v => :foo } }
Now it works. So it seems that you have to use the actual View object itself, you can't use a symbol or string.
#5 Updated by Sae Hirak over 12 years ago
Okay... so it seems that when a tag's on_match
is called when a client is created, the client has not yet been assigned to a view yet. Is there a reason for this?
It seems to me it would be much preferable to run the tag's on_match
at about the same time as the :client_create
event. That is, after everything (gravities, view, etc.) has been set up.
#6 Updated by Christoph Kappel over 12 years ago
- Category set to Bugfix
- Status changed from Unconfirmed to Confirmed
- Assignee set to Non member users
- Target version set to Xi
I see the problem now, subtle cannot use the means of subtlext to create e.g. the client object, because it cannot be accurate at that point. Therefore subtle manually creates the objects. r3210 includes proper tagging information now, geometry and gravity are still missing, because I cannot add it that easily.
The reason for that is the roundtrip that is required to pass information to the X-server and to fetch the information in a single-thread process. I use some tricks to make it still possible, but it isn't perfect as you can see.
#7 Updated by Christoph Kappel over 12 years ago
- Target version changed from Xi to Omicron
#8 Updated by Christoph Kappel almost 7 years ago
- Target version deleted (
Omicron)