Display a screenshot after 1.5 second when hovering the tasklist

This commit is contained in:
Emmanuel Lepage Vallee 2014-10-05 18:04:03 -04:00
parent 114cbd23be
commit 26814e77ee
1 changed files with 16 additions and 1 deletions

View File

@ -14,8 +14,9 @@ local beautiful = require( "beautiful" )
local client = require( "awful.client" )
local wibox = require( "wibox" )
local surface = require( "gears.surface")
local client_menu = require("radical.impl.tasklist.client_menu")
local client_menu = require( "radical.impl.tasklist.client_menu")
local theme = require( "radical.theme")
local rad_client = require( "radical.impl.common.client")
local sticky,urgent,instances,module = {extensions=require("radical.impl.tasklist.extensions")},{},{},{}
local _cache = setmetatable({}, { __mode = 'k' })
@ -55,6 +56,16 @@ module.buttons = {
end
}
local function display_screenshot(c,geo,visible)
if not visible and prev_menu then
prev_menu.visible = false
return
end
if not c then return end
return rad_client.screenshot(c,geo)
end
local function sticky_callback(c)
local val = c.sticky
sticky[c] = val and true or nil
@ -261,6 +272,10 @@ local function new(screen)
end
end)
menu:connect_signal("long::hover",function(m,i,mod,geo)
display_screenshot(i.client,geo,true)
end)
return menu,menu._internal.layout
end