Compare commits

...

4 Commits

Author SHA1 Message Date
Arquimedes 9d30c7e1a1
Merge 7c97ba3200 into ec9a9fee58 2024-09-19 11:14:00 +03:00
T3hD0gg ec9a9fee58 Add Thrustmaster TMX VID & PID to wheel device list.
(cherry picked from commit 594edb6bd2)
2024-09-18 22:22:01 -07:00
Cameron Gutman e239295491 wayland: Fix memory leaks 2024-09-18 20:44:26 -04:00
Arquimedes 7c97ba3200
Update SDLActivity.java
Fix Full immersive mode in Android 9 and higher.

LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
will make sure to use all the screen when  the fullscreen flag is enabled.

The other option is 
LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS will work in some cases but in devices that have a camera in the middle this flag will not work.
2024-09-15 03:49:45 -03:00
3 changed files with 24 additions and 2 deletions

View File

@ -790,6 +790,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
SDLActivity.mFullscreenModeActive = false;
}
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
}
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");

View File

@ -370,6 +370,7 @@ static Uint32 initial_wheel_devices[] = {
MAKE_VIDPID(0x044f, 0xb65e), /* Thrustmaster T500RS */
MAKE_VIDPID(0x044f, 0xb664), /* Thrustmaster TX (initial mode) */
MAKE_VIDPID(0x044f, 0xb669), /* Thrustmaster TX (active mode) */
MAKE_VIDPID(0x044f, 0xb67f), /* Thrustmaster TMX */
MAKE_VIDPID(0x044f, 0xb691), /* Thrustmaster TS-XW (initial mode) */
MAKE_VIDPID(0x044f, 0xb692), /* Thrustmaster TS-XW (active mode) */
MAKE_VIDPID(0x0483, 0x0522), /* Simagic Wheelbase (including M10, Alpha Mini, Alpha, Alpha U) */

View File

@ -260,12 +260,25 @@ static SDL_bool keyboard_repeat_key_is_set(SDL_WaylandKeyboardRepeat *repeat_inf
return repeat_info->is_initialized && repeat_info->is_key_down && key == repeat_info->key;
}
static void sync_done_handler(void *data, struct wl_callback *callback, uint32_t callback_data)
{
/* Nothing to do, just destroy the callback */
wl_callback_destroy(callback);
}
static struct wl_callback_listener sync_listener = {
sync_done_handler
};
void Wayland_SendWakeupEvent(_THIS, SDL_Window *window)
{
SDL_VideoData *d = _this->driverdata;
/* TODO: Maybe use a pipe to avoid the compositor roundtrip? */
wl_display_sync(d->display);
/* Queue a sync event to unblock the event queue fd if it's empty and being waited on.
* TODO: Maybe use a pipe to avoid the compositor roundtrip?
*/
struct wl_callback *cb = wl_display_sync(d->display);
wl_callback_add_listener(cb, &sync_listener, NULL);
WAYLAND_wl_display_flush(d->display);
}
@ -2537,6 +2550,9 @@ void Wayland_display_destroy_input(SDL_VideoData *d)
if (input->primary_selection_device->selection_offer) {
Wayland_primary_selection_offer_destroy(input->primary_selection_device->selection_offer);
}
if (input->primary_selection_device->primary_selection_device) {
zwp_primary_selection_device_v1_destroy(input->primary_selection_device->primary_selection_device);
}
SDL_free(input->primary_selection_device);
}