Merge pull request #743 from psychon/keygrabber-errors
Keygrabber errors
This commit is contained in:
commit
9f5e6c3827
8
event.c
8
event.c
|
@ -122,10 +122,11 @@ event_handle_mousegrabber(int x, int y, uint16_t mask)
|
||||||
{
|
{
|
||||||
warn("Stopping mousegrabber.");
|
warn("Stopping mousegrabber.");
|
||||||
luaA_mousegrabber_stop(L);
|
luaA_mousegrabber_stop(L);
|
||||||
}
|
} else {
|
||||||
else if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
||||||
luaA_mousegrabber_stop(L);
|
luaA_mousegrabber_stop(L);
|
||||||
lua_pop(L, 1); /* pop returned value */
|
lua_pop(L, 1); /* pop returned value */
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -660,12 +661,11 @@ event_handle_key(xcb_key_press_event_t *ev)
|
||||||
{
|
{
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, globalconf.keygrabber);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, globalconf.keygrabber);
|
||||||
|
|
||||||
if(!luaA_dofunction(L, 3, 1))
|
if(!luaA_dofunction(L, 3, 0))
|
||||||
{
|
{
|
||||||
warn("Stopping keygrabber.");
|
warn("Stopping keygrabber.");
|
||||||
luaA_keygrabber_stop(L);
|
luaA_keygrabber_stop(L);
|
||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -16,6 +16,20 @@ runner.add_to_default_rules = function(r)
|
||||||
table.insert(awful.rules.rules, r)
|
table.insert(awful.rules.rules, r)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Was the runner started already?
|
||||||
|
local running = false
|
||||||
|
|
||||||
|
-- This is used if a test causes errors before starting the runner
|
||||||
|
timer.start_new(1, function()
|
||||||
|
if not running then
|
||||||
|
io.stderr:write("Error: run_steps() was never called\n")
|
||||||
|
if not runner.quit_awesome_on_error then
|
||||||
|
io.stderr:write("Keeping awesome open...\n")
|
||||||
|
return -- keep awesome open on error.
|
||||||
|
end
|
||||||
|
awesome.quit()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
runner.run_steps = function(steps)
|
runner.run_steps = function(steps)
|
||||||
-- Setup timer/timeout to limit waiting for signal and quitting awesome.
|
-- Setup timer/timeout to limit waiting for signal and quitting awesome.
|
||||||
|
@ -24,6 +38,8 @@ runner.run_steps = function(steps)
|
||||||
local wait=20
|
local wait=20
|
||||||
local step=1
|
local step=1
|
||||||
local step_count=0
|
local step_count=0
|
||||||
|
assert(not running, "run_steps() was called twice")
|
||||||
|
running = true
|
||||||
t:connect_signal("timeout", function() timer.delayed_call(function()
|
t:connect_signal("timeout", function() timer.delayed_call(function()
|
||||||
io.flush() -- for "tail -f".
|
io.flush() -- for "tail -f".
|
||||||
step_count = step_count + 1
|
step_count = step_count + 1
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
--- Test for awful.widget.watch
|
--- Test for awful.widget.watch
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local watch = require("awful.widget.watch")
|
local watch = require("awful.widget.watch")
|
||||||
|
|
||||||
local callbacks_done = 0
|
local callbacks_done = 0
|
||||||
|
@ -25,6 +26,6 @@ local steps = {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
require("_runner").run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
-- Some benchmarks that aren't really tests, but are included here anyway so
|
-- Some benchmarks that aren't really tests, but are included here anyway so
|
||||||
-- that we notice if they break.
|
-- that we notice if they break.
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local GLib = require("lgi").GLib
|
local GLib = require("lgi").GLib
|
||||||
local create_wibox = require("_wibox_helper").create_wibox
|
local create_wibox = require("_wibox_helper").create_wibox
|
||||||
|
@ -75,6 +76,6 @@ benchmark(relayout_textclock, "relayout textclock")
|
||||||
benchmark(redraw_textclock, "redraw textclock")
|
benchmark(redraw_textclock, "redraw textclock")
|
||||||
benchmark(e2e_tag_switch, "tag switch")
|
benchmark(e2e_tag_switch, "tag switch")
|
||||||
|
|
||||||
require("_runner").run_steps({ function() return true end })
|
runner.run_steps({ function() return true end })
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
--- Tests for focus signals / property.
|
--- Tests for focus signals / property.
|
||||||
-- Test for https://github.com/awesomeWM/awesome/issues/134.
|
-- Test for https://github.com/awesomeWM/awesome/issues/134.
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
|
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
@ -44,6 +45,6 @@ local steps = {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
require("_runner").run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
-- Some memory leak checks involving clients as integration tests.
|
-- Some memory leak checks involving clients as integration tests.
|
||||||
|
local runner = require("_runner")
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
|
@ -78,6 +79,6 @@ local steps = {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
require("_runner").run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
-- Some memory leak checks as integration tests.
|
-- Some memory leak checks as integration tests.
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local cairo = require("lgi").cairo
|
local cairo = require("lgi").cairo
|
||||||
local create_wibox = require("_wibox_helper").create_wibox
|
local create_wibox = require("_wibox_helper").create_wibox
|
||||||
|
@ -77,6 +78,6 @@ collectable(awful.widget.tasklist(1, awful.widget.tasklist.filter.currenttags))
|
||||||
prepare_for_collect = emit_refresh
|
prepare_for_collect = emit_refresh
|
||||||
collectable(create_wibox())
|
collectable(create_wibox())
|
||||||
|
|
||||||
require("_runner").run_steps({ function() return true end })
|
runner.run_steps({ function() return true end })
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
--- Tests for spawn's startup notifications.
|
--- Tests for spawn's startup notifications.
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local spawn = require("awful.spawn")
|
local spawn = require("awful.spawn")
|
||||||
|
|
||||||
local manage_called, c_snid
|
local manage_called, c_snid
|
||||||
|
@ -38,6 +39,6 @@ local steps = {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
require("_runner").run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
--- Tests for spawn
|
--- Tests for spawn
|
||||||
|
|
||||||
|
local runner = require("_runner")
|
||||||
local spawn = require("awful.spawn")
|
local spawn = require("awful.spawn")
|
||||||
|
|
||||||
local spawns_done = 0
|
local spawns_done = 0
|
||||||
|
@ -63,6 +64,6 @@ local steps = {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
require("_runner").run_steps(steps)
|
runner.run_steps(steps)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue