diff --git a/src/modules/event/sdl/Event.cpp b/src/modules/event/sdl/Event.cpp index 9b4e21842..219d7a3ea 100644 --- a/src/modules/event/sdl/Event.cpp +++ b/src/modules/event/sdl/Event.cpp @@ -182,6 +182,8 @@ Message *Event::convert(SDL_Event &e) msg = new Message("focus", arg1); else if (e.active.state & SDL_APPMOUSEFOCUS) msg = new Message("mousefocus", arg1); + else if (e.active.state & SDL_APPACTIVE) + msg = new Message("visible", arg1); arg1->release(); break; case SDL_QUIT: diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index a59deae72..e2c4647ee 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -188,6 +188,9 @@ function love.createhandlers() mousefocus = function (f) if love.mousefocus then return love.mousefocus(f) end end, + visible = function (v) + if love.visible then return love.visible(v) end + end, quit = function () return end, diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index e221ea70a..7d29f5c4a 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -336,6 +336,12 @@ const unsigned char boot_lua[] = 0x76, 0x65, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x66, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a, + 0x09, 0x09, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x28, 0x76, 0x29, 0x0a, + 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, + 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x28, 0x76, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, + 0x09, 0x09, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x09, 0x09, 0x71, 0x75, 0x69, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a,