mouse: Avoid an error when the client is killed while moving
to reproduce: 1) spawn an xterm 2) enter 'sleep 10 && killall xterm' 3) start moving the terminal There will be an error (found by a yet to be commited integration test)
This commit is contained in:
parent
76313263b6
commit
693a87ef2e
|
@ -41,6 +41,8 @@ function floating.mouse_resize_handler(c, corner, x, y)
|
|||
end
|
||||
|
||||
capi.mousegrabber.run(function (_mouse)
|
||||
if not c.valid then return false end
|
||||
|
||||
_mouse.x = _mouse.x + coordinates_delta.x
|
||||
_mouse.y = _mouse.y + coordinates_delta.y
|
||||
for _, v in ipairs(_mouse.buttons) do
|
||||
|
|
|
@ -30,6 +30,8 @@ function magnifier.mouse_resize_handler(c, corner, x, y)
|
|||
|
||||
local prev_coords = {}
|
||||
capi.mousegrabber.run(function (_mouse)
|
||||
if not c.valid then return false end
|
||||
|
||||
for _, v in ipairs(_mouse.buttons) do
|
||||
if v then
|
||||
prev_coords = { x =_mouse.x, y = _mouse.y }
|
||||
|
|
|
@ -85,6 +85,8 @@ local function mouse_resize_handler(c, _, _, _, orientation)
|
|||
|
||||
local prev_coords = {}
|
||||
capi.mousegrabber.run(function (_mouse)
|
||||
if not c.valid then return false end
|
||||
|
||||
_mouse.x = _mouse.x + coordinates_delta.x
|
||||
_mouse.y = _mouse.y + coordinates_delta.y
|
||||
for _, v in ipairs(_mouse.buttons) do
|
||||
|
|
|
@ -174,6 +174,8 @@ function mouse.client.move(c, snap, finished_cb)
|
|||
local fixed_y = c.maximized_vertical
|
||||
|
||||
capi.mousegrabber.run(function (_mouse)
|
||||
if not c.valid then return false end
|
||||
|
||||
for _, v in ipairs(_mouse.buttons) do
|
||||
if v then
|
||||
local lay = layout.get(c.screen)
|
||||
|
@ -218,6 +220,8 @@ mouse.client.dragtotag = { }
|
|||
-- @param c The client to move
|
||||
function mouse.client.dragtotag.border(c)
|
||||
capi.mousegrabber.run(function (_mouse)
|
||||
if not c.valid then return false end
|
||||
|
||||
local button_down = false
|
||||
for _, v in ipairs(_mouse.buttons) do
|
||||
if v then button_down = true end
|
||||
|
|
Loading…
Reference in New Issue