mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-30 20:31:59 +00:00
Add portal interface to support SDL_GetSystemTheme in linux
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "../../core/unix/SDL_poll.h"
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../events/SDL_scancode_tables_c.h"
|
||||
#include "../../core/linux/SDL_system_theme.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#include "SDL_waylandvideo.h"
|
||||
@@ -386,6 +387,10 @@ int Wayland_WaitEventTimeout(_THIS, Sint64 timeoutNS)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
SDL_SystemTheme_PumpEvents();
|
||||
#endif
|
||||
|
||||
/* If key repeat is active, we'll need to cap our maximum wait time to handle repeats */
|
||||
if (input && keyboard_repeat_is_set(&input->keyboard_repeat)) {
|
||||
const Uint64 elapsed = SDL_GetTicksNS() - input->keyboard_repeat.sdl_press_time_ns;
|
||||
@@ -455,6 +460,10 @@ void Wayland_PumpEvents(_THIS)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
SDL_SystemTheme_PumpEvents();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
if (d->shell.libdecor) {
|
||||
libdecor_dispatch(d->shell.libdecor, 0);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#if SDL_VIDEO_DRIVER_WAYLAND
|
||||
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../core/linux/SDL_system_theme.h"
|
||||
|
||||
#include "SDL_waylandvideo.h"
|
||||
#include "SDL_waylandevents_c.h"
|
||||
@@ -249,6 +250,11 @@ static SDL_VideoDevice *Wayland_CreateDevice(void)
|
||||
device->FlashWindow = Wayland_FlashWindow;
|
||||
device->HasScreenKeyboardSupport = Wayland_HasScreenKeyboardSupport;
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
if (SDL_SystemTheme_Init())
|
||||
device->system_theme = SDL_SystemTheme_Get();
|
||||
#endif
|
||||
|
||||
device->SetClipboardText = Wayland_SetClipboardText;
|
||||
device->GetClipboardText = Wayland_GetClipboardText;
|
||||
device->HasClipboardText = Wayland_HasClipboardText;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
#include "../../core/linux/SDL_system_theme.h"
|
||||
|
||||
#include <SDL3/SDL_syswm.h>
|
||||
|
||||
@@ -1683,6 +1684,10 @@ int X11_WaitEventTimeout(_THIS, Sint64 timeoutNS)
|
||||
SDL_IME_PumpEvents();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
SDL_SystemTheme_PumpEvents();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1725,6 +1730,10 @@ void X11_PumpEvents(_THIS)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
SDL_SystemTheme_PumpEvents();
|
||||
#endif
|
||||
|
||||
/* FIXME: Only need to do this when there are pending focus changes */
|
||||
X11_HandleFocusChanges(_this);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "../SDL_pixels_c.h"
|
||||
#include "../../core/linux/SDL_system_theme.h"
|
||||
|
||||
#include "SDL_x11video.h"
|
||||
#include "SDL_x11framebuffer.h"
|
||||
@@ -315,6 +316,11 @@ static SDL_VideoDevice *X11_CreateDevice(void)
|
||||
device->Vulkan_CreateSurface = X11_Vulkan_CreateSurface;
|
||||
#endif
|
||||
|
||||
#ifdef SDL_USE_LIBDBUS
|
||||
if (SDL_SystemTheme_Init())
|
||||
device->system_theme = SDL_SystemTheme_Get();
|
||||
#endif
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user