Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend SDL2 platorm support (resizing + textinput) #368

Closed
cnuke opened this issue May 7, 2024 · 4 comments
Closed

Extend SDL2 platorm support (resizing + textinput) #368

cnuke opened this issue May 7, 2024 · 4 comments

Comments

@cnuke
Copy link
Member

cnuke commented May 7, 2024

No description provided.

@cnuke cnuke added the feature label May 7, 2024
cnuke added a commit to cnuke/genode-world that referenced this issue May 7, 2024
This commit introduces preliminary support for using the SDL2's
textinput API.

So far it only has been tested with dhewm3's console where it
performs adequately.

Issue genodelabs#368.
@cnuke
Copy link
Member Author

cnuke commented May 7, 2024

Commit 745d4ae addresses the window resizing and also adds support for specifying the initial window size while 1757cda allows for handling 'SDL_TEXTINPUT` events (as is used for example by dhewm3's console).

I deliberately classify the commits as preliminary as they are probably not finished (working in all cases) but are working well enough and enhance the user experience (and should not break anything while doing so).

@cnuke cnuke added the fixed label May 7, 2024
jschlatow pushed a commit to jschlatow/genode-world that referenced this issue May 16, 2024
This commit introduces preliminary support for resizing a window.
How and if it works depends to some degree on the program using
the SDL2 library itself. It works well for the currently tested
ports like chocolate-doom and yquake2 (software renderer).
On the other hand program using an OpenGL context via SDL2 still
have issues resizing the window (EGL errors).

As an additional feature the commit adds support for setting the
initial window geometry via the '<initial>' node, e.g.:

! <initial width="800" height="600"/>

This prevents overly large windows because the actual screen size
is propagated by nitpicker.

Fixes genodelabs#368.
jschlatow pushed a commit to jschlatow/genode-world that referenced this issue May 16, 2024
This commit introduces preliminary support for using the SDL2's
textinput API.

So far it only has been tested with dhewm3's console where it
performs adequately.

Issue genodelabs#368.
jschlatow added a commit to jschlatow/genode-world that referenced this issue May 16, 2024
Make SDL2's textinput API more robust. We always send keyboard events if
textinput has not been enabled by the application. Moreover, we only
send key presses as text if the codepoint is valid and if it's not a known
non-printable. Keyboard events are omitted if key presses are sent as
text.

This has been tested with sdl_vnc.

genodelabs#368
@jschlatow
Copy link
Member

@cnuke I tested your commits with the updated libvnc (requires SDL2) and sdl_vnc. I made a few modifications to make it more robust and to suppress unknown keysym warnings that popped up at the VNC server. May you have a look whether 97fc0db breaks anything for dhewm3?

@cnuke
Copy link
Member Author

cnuke commented May 16, 2024

@jschlatow thanks for the fixup commit that looks like a nice improvement indeed and works fine with dhewm3 👍.

chelmuth pushed a commit that referenced this issue May 16, 2024
Make SDL2's textinput API more robust. We always send keyboard events if
textinput has not been enabled by the application. Moreover, we only
send key presses as text if the codepoint is valid and if it's not a known
non-printable. Keyboard events are omitted if key presses are sent as
text.

This has been tested with sdl_vnc.

#368
@chelmuth
Copy link
Member

Merged the fixup to staging.

chelmuth pushed a commit that referenced this issue May 29, 2024
This commit introduces preliminary support for using the SDL2's
textinput API.

So far it only has been tested with dhewm3's console where it
performs adequately.

Issue #368.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants