mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Add love.window.focus (resolves #1911).
Calling the function brings the window into the foreground and makes it the focused window for keyboard input.
This commit is contained in:
@@ -1182,6 +1182,15 @@ void Window::restore()
|
||||
}
|
||||
}
|
||||
|
||||
void Window::focus()
|
||||
{
|
||||
if (window != nullptr)
|
||||
{
|
||||
SDL_RaiseWindow(window);
|
||||
updateSettings(settings, true);
|
||||
}
|
||||
}
|
||||
|
||||
bool Window::isMaximized() const
|
||||
{
|
||||
return window != nullptr && (SDL_GetWindowFlags(window) & SDL_WINDOW_MAXIMIZED);
|
||||
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
void minimize() override;
|
||||
void maximize() override;
|
||||
void restore() override;
|
||||
void focus() override;
|
||||
|
||||
bool isMaximized() const override;
|
||||
bool isMinimized() const override;
|
||||
|
||||
Reference in New Issue
Block a user