mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Error if a window isn't open when love.system.set/getClipboardText are called (resolves issue #1290).
--HG-- branch : minor
This commit is contained in:
@@ -44,13 +44,15 @@ int w_getProcessorCount(lua_State *L)
|
||||
int w_setClipboardText(lua_State *L)
|
||||
{
|
||||
const char *text = luaL_checkstring(L, 1);
|
||||
instance()->setClipboardText(text);
|
||||
luax_catchexcept(L, [&]() { instance()->setClipboardText(text); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_getClipboardText(lua_State *L)
|
||||
{
|
||||
luax_pushstring(L, instance()->getClipboardText());
|
||||
std::string text;
|
||||
luax_catchexcept(L, [&]() { text = instance()->getClipboardText(); });
|
||||
luax_pushstring(L, text);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user