1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-12-23 11:32:32 +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 -- {{{ Signals
-- signal function to execute when a new client appears. -- signal function to execute when a new client appears.
local sloppyfocus_last = {c=nil}
client.connect_signal("manage", function (c, startup) client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus -- Enable sloppy focus
local sloppyfocus_last = {x=nil, y=nil, c=nil}
client.connect_signal("mouse::enter", function(c) client.connect_signal("mouse::enter", function(c)
local mcoords = mouse.coords()
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier 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. -- Skip focusing the client if the mouse wasn't moved.
if (mcoords.x ~= sloppyfocus_last.x or mcoords.y ~= sloppyfocus_last.y) if c ~= sloppyfocus_last.c then
and c ~= sloppyfocus_last.c then
client.focus = c client.focus = c
sloppyfocus_last.c = c sloppyfocus_last.c = c
end end
end end
sloppyfocus_last.x = mcoords.x
sloppyfocus_last.y = mcoords.y
end) end)
local titlebars_enabled = false local titlebars_enabled = false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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