Skip to content

Commit

Permalink
Update alert.lua: allow window object as parameter
Browse files Browse the repository at this point in the history
allow also a `hs.window` object as an parameter
  • Loading branch information
muescha committed Sep 30, 2023
1 parent 0ccc9d0 commit f3e51a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/alert/alert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ local showAlert = function(message, image, style, screenObj, duration)
-- print(finspect(message:asTable()))
end

local screenFrame = screenObj:fullFrame()
local screenFrame = screenObj.fullFrame and screenObj:fullFrame() or screenObj:frame()

local absoluteTop = screenFrame.y + (screenFrame.h * (1 - 1 / 1.55) + 55) -- mimic module behavior for inverted rect
if thisAlertStyle.atScreenEdge > 0 then
Expand Down Expand Up @@ -225,7 +225,7 @@ end
--- * str - The string or `hs.styledtext` object to display in the alert
--- * image - The image to display in the alert
--- * style - an optional table containing one or more of the keys specified in [hs.alert.defaultStyle](#defaultStyle). If `str` is already an `hs.styledtext` object, this argument is ignored.
--- * screen - an optional `hs.screen` userdata object specifying the screen (monitor) to display the alert on. Defaults to `hs.screen.mainScreen()` which corresponds to the screen with the currently focused window.
--- * screen - an optional `hs.screen` or `hs.window` userdata object specifying the screen (monitor) or window to display the alert on. Defaults to `hs.screen.mainScreen()` which corresponds to the screen with the currently focused window.
--- * seconds - The number of seconds to display the alert. Defaults to 2. If seconds is specified and is not a number, displays the alert indefinitely.
---
--- Returns:
Expand Down

0 comments on commit f3e51a2

Please sign in to comment.