From d03762c322541f03982b8d05eb718f4ecad14a33 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 10 Oct 2015 20:30:08 +0200 Subject: [PATCH] systray: Make sure the widget is only placed in a wibox Signed-off-by: Uli Schlachter --- lib/wibox/widget/systray.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/wibox/widget/systray.lua b/lib/wibox/widget/systray.lua index 011edd103..7fae865d1 100644 --- a/lib/wibox/widget/systray.lua +++ b/lib/wibox/widget/systray.lua @@ -24,6 +24,10 @@ function systray:draw(context, cr, width, height) local bg = beautiful.bg_systray or beautiful.bg_normal or "#000000" local spacing = beautiful.systray_icon_spacing or 0 + if context and not context.wibox then + error("The systray widget can only be placed inside a wibox.") + end + -- Figure out if the cairo context is rotated local dir_x, dir_y = cr:user_to_device_distance(1, 0) local is_rotated = abs(dir_x) < abs(dir_y)