1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 20:41:22 +00:00

#81: only ignore mouse::enter if the client wasn't changed

This commit is contained in:
Luke Bonham 2015-04-11 12:39:41 +02:00
parent f2062d0e78
commit f55b5cd700
8 changed files with 24 additions and 56 deletions

View file

@ -602,22 +602,18 @@ awful.rules.rules = {
-- {{{ Signals
-- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false

View file

@ -673,22 +673,18 @@ awful.rules.rules = {
-- {{{ Signals
-- Signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = true

View file

@ -602,22 +602,18 @@ awful.rules.rules = {
-- {{{ Signals
-- Signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = true

View file

@ -735,22 +735,18 @@ awful.rules.rules = {
-- {{{ Signals
-- Signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false

View file

@ -673,22 +673,18 @@ awful.rules.rules = {
-- {{{ Signals
-- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false

View file

@ -648,22 +648,18 @@ awful.rules.rules = {
-- {{{ Signals
-- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false

View file

@ -600,22 +600,18 @@ awful.rules.rules = {
-- {{{ Signals
-- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false

View file

@ -609,22 +609,18 @@ awful.rules.rules = {
-- {{{ Signals
-- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
and awful.client.focus.filter(c) then
-- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y)
and c ~= sloppyfocus_last.c then
if c ~= sloppyfocus_last.c then
client.focus = c
sloppyfocus_last.c = c
end
end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end)
local titlebars_enabled = false