Bug #295

Setting a client's gravity in a tag's @on_match@ is broken

Added by Sae Hirak 10 months ago. Updated 9 months ago.

Status: Confirmed Start date: 2012-05-28
Priority: Normal Due date:
Assignee: Christoph Kappel % Done:

0%

Category: Bugfix
Target version: Omicron
Votes: 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:

http://pastebin.com/MzEfQPEP

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:

  1. Complaining about a lack of geometry when setting the gravity of the client
  2. Setting the gravity of a client only works on the first view (possibly related to the above bug?)

Associated revisions

Revision 3210
Added by Christoph Kappel 10 months ago

Updated #295: Added @tags to Subtlext::Client and Subtlext::View

Revision 3211
Added by Christoph Kappel 10 months ago

Updated #295: Moved tag fetching from subtlext.c to class file

Revision 3212
Added by Christoph Kappel 10 months ago

Updated #295: Updated tag handling of Subtlext::Client and Subtlext::Tag

Revision 3214
Added by Christoph Kappel 10 months ago

Updated #295: Added gravity and geometry values to Subtlext::Client instances in tag procs

Revision 3215
Added by Christoph Kappel 10 months ago

Updated #295: Fixed missing Subtle::Gravity

History

Without having a glance at your config, you cannot set a gravity with #gravity for any view that is not the current view when you don't use the hash notation. Read here

Ah! I see! Thank you, I should be able to fix that, then...

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.

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.

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.

  • Category set to Bugfix
  • Status changed from Unconfirmed to Confirmed
  • Assignee set to Christoph Kappel
  • 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.

  • Target version changed from Xi to Omicron

Also available in: Atom PDF