remove mouse warping
authorPierre Habouzit <madcoder@debian.org>
Wed, 6 Oct 2010 18:52:48 +0000 (20:52 +0200)
committerPierre Habouzit <madcoder@debian.org>
Wed, 6 Oct 2010 18:52:48 +0000 (20:52 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
config/awesome/rc.lua

index 1aede82..28ee976 100644 (file)
@@ -4,17 +4,17 @@
 require("awful")
 require("awful.autofocus")
 require("awful.rules")
-require("vicious")
 require("beautiful")
+require("vicious")
 
 terminal = "urxvtcd"
 lock     = 'xscreensaver-command -lock'
 beautiful.init(awful.util.getdir("config").."/theme")
 
 -- {{{ Modkeys
-modkey = "Mod4"
-shift = "Shift"
-alt = "Mod1"
+modkey  = "Mod4"
+shift   = "Shift"
+alt     = "Mod1"
 control = "Control"
 
 k_n   = {}
@@ -389,8 +389,16 @@ globalkeys = awful.util.table.join(
     awful.key(k_ms, "k", function () awful.client.swap.byidx(-1) end),
 
     -- Mod+{E/D}: Switch to next/previous screen
-    awful.key(k_m, "Tab",  function () awful.screen.focus_relative(1) end),
-    awful.key(k_ms, "Tab", function () awful.screen.focus_relative(-1) end),
+    awful.key(k_m, "Tab",  function ()
+        awful.screen.focus_relative(1)
+        coords = mouse.coords();
+        mouse.coords({ x = coords.x + 5, y = coords.y + 5}, true)
+    end),
+    awful.key(k_ms, "Tab", function ()
+        awful.screen.focus_relative(-1)
+        coords = mouse.coords()
+        mouse.coords({ x = coords.x + 5, y = coords.y + 5}, true)
+    end),
 
     -- Mod+Enter: Launch a new terminal
     awful.key(k_m,  "e",      function() awful.util.spawn("chromium-browser") end),
@@ -502,19 +510,10 @@ awful.rules.rules = {
 -- }}}
 -- {{{ Signals
 
-function warp_mouse(c)
-    local o = mouse.object_under_pointer()
-    if not o or (o ~= c and type(o) == "client") then
-        local g = c:geometry()
-        mouse.coords({ x = g.x + 5, y = g.y + 5 }, true)
-    end
-end
-
 client.add_signal("focus", function (c)
     if not awful.client.ismarked(c) then
         c.border_color = beautiful.border_focus
     end
-    warp_mouse(c)
 end)
 
 client.add_signal("unfocus", function (c)
@@ -527,14 +526,6 @@ client.add_signal("manage", function (c, startup)
     c:add_signal("mouse::enter", function(c) client.focus = c end)
 end)
 
-for s = 1, screen.count() do
-    screen[s]:add_signal("arrange", function ()
-        if client.focus and client.focus.screen == s then
-            warp_mouse(client.focus)
-        end
-    end)
-end
-
 -- }}}
 
 awful.util.spawn("xkbcomp -w 0 -R/usr/share/X11/xkb /home/madcoder/.Xkeyboard :0")