This commit is contained in:
Emmanuel Lepage Vallee 2013-08-07 00:35:49 -04:00
parent 2357ca5e18
commit 93d03651a9
2 changed files with 12 additions and 1 deletions

View File

@ -263,6 +263,8 @@ local function new(args)
underlay_alpha = args.underlay_alpha or 0.7, underlay_alpha = args.underlay_alpha or 0.7,
filter_prefix = args.filter_prefix or "Filter:", filter_prefix = args.filter_prefix or "Filter:",
max_items = args.max_items or nil, max_items = args.max_items or nil,
x = args.x or 0,
y = args.y or 0,
}, },
get_map = { get_map = {
is_menu = function() return true end, is_menu = function() return true end,

View File

@ -38,6 +38,7 @@ end
local function set_position(self) local function set_position(self)
local ret,parent = {x=self.wibox.x,y=self.wibox.y},self.parent_geometry local ret,parent = {x=self.wibox.x,y=self.wibox.y},self.parent_geometry
local prefx,prefy = self._internal.private_data.x,self._internal.private_data.y
if parent and parent.is_menu then if parent and parent.is_menu then
if parent.direction == "right" then if parent.direction == "right" then
ret={x=parent.x-self.width,y=parent.y+(self.parent_item.y)} ret={x=parent.x-self.width,y=parent.y+(self.parent_item.y)}
@ -54,7 +55,15 @@ local function set_position(self)
else else
ret = {x=drawable_geom.x+parent.x-((self.arrow_type ~= base.arrow_type.NONE) and (self._arrow_x or 20)+11-parent.width/2 or 0),y=(self.direction == "bottom") and drawable_geom.y-self.wibox.height or drawable_geom.y+drawable_geom.height} ret = {x=drawable_geom.x+parent.x-((self.arrow_type ~= base.arrow_type.NONE) and (self._arrow_x or 20)+11-parent.width/2 or 0),y=(self.direction == "bottom") and drawable_geom.y-self.wibox.height or drawable_geom.y+drawable_geom.height}
end end
elseif not self.parent_geometry then --Use mouse position to set position --TODO it is called too often elseif prefx ~= 0 or prefy ~= 0 then
ret = capi.mouse.coords()
if prefx then
ret.x = prefx
end
if prefy then
ret.y = prefy
end
elseif not parent then --Use mouse position to set position --TODO it is called too often
ret = capi.mouse.coords() ret = capi.mouse.coords()
local draw = awful.mouse.wibox_under_pointer and awful.mouse.wibox_under_pointer() or awful.mouse.drawin_under_pointer and awful.mouse.drawin_under_pointer() local draw = awful.mouse.wibox_under_pointer and awful.mouse.wibox_under_pointer() or awful.mouse.drawin_under_pointer and awful.mouse.drawin_under_pointer()
if draw then if draw then