Discussion:
disabling mouse focus
M. Rawash
2010-03-19 12:33:41 UTC
Permalink
hi, is there a simple way to disable 'mousefocus' on certain clients
(a on-screen keyboard, for example)?
Tuomo Valkonen
2010-03-22 13:12:22 UTC
Permalink
Post by M. Rawash
hi, is there a simple way to disable 'mousefocus' on certain clients
(a on-screen keyboard, for example)?
There's the 'passive' winprop. There should be examples in the
list archives, maybe even something in the scripts repository.
--
Tuomo
M. Rawash
2010-03-22 23:36:33 UTC
Permalink
Post by Tuomo Valkonen
Post by M. Rawash
hi, is there a simple way to disable 'mousefocus' on certain clients
(a on-screen keyboard, for example)?
There's the 'passive' winprop. There should be examples in the
list archives, maybe even something in the scripts repository.
--
Tuomo
thanks, i thought there must be a more obvious way, but this is what i did:

defwinprop{
class = "Something",
float = true,
userpos = true,
switchto = false,
no_focus = true,
}

nmfcwins = {}

function no_mfocus(cwin,t)
local winprop = ioncore.getwinprop(cwin)
if winprop and winprop.no_focus then
nmfcwins[cwin:xid()] = cwin:xid()
ioncore.set{mousefocus="disabled"}
end
end

function ret_mfocus(cxid)
if nmfcwins[cxid]==cxid then
nmfcwins[cxid]=nil
if table.maxn(nmfcwins)==0 then
ioncore.set{mousefocus="sloppy"}
end
end
end

ioncore.get_hook('clientwin_mapped_hook'):add(no_mfocus)
ioncore.get_hook('clientwin_unmapped_hook'):add(ret_mfocus)

this is only good for a few cases (i.e. a on-screen keyboard, that's
activated from the systray), but it does the job for me; i'll
investigate the passive property further, i noticed it before, but
wasn't sure how to use it in this case.

regards,
M Rawash

Loading...