Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

Subtlext:View.jump on multihead screen

Added by François-Xavier LdM almost 12 years ago

Hello,

I started use subtle a few days ago, and I'm running into a little problem while scripting in Ruby with Subtlext :

I write this code to be able to jump between dynamic visible view. (like :ViewNext/Previous, but without hidden views)
That work very well with one screen, but when I connect the second one and use the grab, my mouse always go to screen 1, and I can't use the jump in screen 2

require "subtle/subtlext" 
grab "W-Right" do
  vArr = Subtlext::View[:all];
  cindx = vArr.index(Subtlext::View.current);
  found = false;

  for i in 1..vArr.size do
    cV = vArr[(i + cindx) % vArr.size];
    if (!cV.clients.empty? && Subtlext::View.visible.index(cV) == nil) then
      cV.jump;
      break;
    end
  end
end

grab "W-Left" do
  vArr = Subtlext::View[:all].reverse;
  cindx = vArr.index(Subtlext::View.current);
  found = false;

  for i in 1..vArr.size do
    cV = vArr[(i + cindx) % vArr.size];
    if (!cV.clients.empty? && Subtlext::View.visible.index(cV) == nil) then
      cV.jump;
      break;
    end
  end

end

Is it possible to use Subtlext:View.jump with multihead screen?

Thank you for your help

--
ixeft


Replies (4)

RE: Subtlext:View.jump on multihead screen - Added by Christoph Kappel almost 12 years ago

Haven't forgotten about this, just wasn't able to figure out yet what is going wrong either with your code or with mine. ;)

RE: Subtlext:View.jump on multihead screen - Added by François-Xavier LdM almost 12 years ago

Hello,

This event hook has the same strange behaviour than my grab

on :client_create do |c|
  v = c.views;
  if !v.empty? then
    v[0].jump;
  end
end

So the problem seems to be in Subtlext :s

RE: Subtlext:View.jump on multihead screen - Added by Christoph Kappel almost 12 years ago

Actually that was no bug, View#jump just had no screen 'awareness' at all, check if r3202 fixes that for you.

RE: Subtlext:View.jump on multihead screen - Added by François-Xavier LdM almost 12 years ago

Problem solved!
Thanks a lot!

Subtle is perfect, now :D

    (1-4/4)