summaryrefslogtreecommitdiff
path: root/Ports/SDL2
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-06-10 14:53:20 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-10 14:21:20 +0100
commit333429fa47cc98aa7eb0216be176f5abe279fe41 (patch)
tree622a4e5d61cbbee9444757646b0a0bf355c1c067 /Ports/SDL2
parentf467ebc933f28b1bed3cc3a72b4945524308f801 (diff)
downloadserenity-333429fa47cc98aa7eb0216be176f5abe279fe41.zip
Ports/SDL2: Implement a basic keyboard focus
Some SDL applications will not process inputs that they receive without ensuring that they have the keyboard input focus.
Diffstat (limited to 'Ports/SDL2')
-rw-r--r--Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch11
1 files changed, 7 insertions, 4 deletions
diff --git a/Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch b/Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch
index d485cda6f3..7ef842fd94 100644
--- a/Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch
+++ b/Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch
@@ -34,9 +34,9 @@ Co-Authored-By: circl <circl.lastname@gmail.com>
src/video/serenity/SDL_serenitymessagebox.h | 38 +
src/video/serenity/SDL_serenitymouse.cpp | 142 ++++
src/video/serenity/SDL_serenitymouse.h | 39 +
- src/video/serenity/SDL_serenityvideo.cpp | 717 ++++++++++++++++++
+ src/video/serenity/SDL_serenityvideo.cpp | 720 ++++++++++++++++++
src/video/serenity/SDL_serenityvideo.h | 98 +++
- 20 files changed, 1411 insertions(+), 29 deletions(-)
+ 20 files changed, 1414 insertions(+), 29 deletions(-)
create mode 100644 src/audio/serenity/SDL_serenityaudio.cpp
create mode 100644 src/audio/serenity/SDL_serenityaudio.h
create mode 100644 src/video/serenity/SDL_serenityevents.cpp
@@ -879,10 +879,10 @@ index 0000000..039f036
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/serenity/SDL_serenityvideo.cpp b/src/video/serenity/SDL_serenityvideo.cpp
new file mode 100644
-index 0000000..30fcadb
+index 0000000..494766f
--- /dev/null
+++ b/src/video/serenity/SDL_serenityvideo.cpp
-@@ -0,0 +1,717 @@
+@@ -0,0 +1,720 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
@@ -1396,6 +1396,9 @@ index 0000000..30fcadb
+ return GUI::Window::CloseRequestDecision::Close;
+ return GUI::Window::CloseRequestDecision::StayOpen;
+ };
++ w->window()->on_active_input_change = [window](bool is_active_input) {
++ SDL_SetKeyboardFocus(is_active_input ? window : nullptr);
++ };
+ SERENITY_PumpEvents(_this);
+
+ return 0;