Remove newlines from log messages

This commit is contained in:
nightmareci
2025-01-22 12:59:57 -08:00
committed by Sam Lantinga
parent 17625e20df
commit 718034f5fa
123 changed files with 1143 additions and 1118 deletions

View File

@@ -719,7 +719,7 @@ static void dumpconfig(SDL_VideoDevice *_this, EGLConfig config)
for (attr = 0; attr < sizeof(all_attributes) / sizeof(Attribute); attr++) {
EGLint value;
_this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, config, all_attributes[attr].attribute, &value);
SDL_Log("\t%-32s: %10d (0x%08x)\n", all_attributes[attr].name, value, value);
SDL_Log("\t%-32s: %10d (0x%08x)", all_attributes[attr].name, value, value);
}
}

View File

@@ -540,7 +540,7 @@ void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event)
#ifdef DEBUG_SCANCODES
if (code == SDL_SCANCODE_UNKNOWN) {
SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL forums/mailing list <https://discourse.libsdl.org/> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.\n", scancode);
SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL forums/mailing list <https://discourse.libsdl.org/> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.", scancode);
}
#endif
if (SDL_TextInputActive(SDL_GetKeyboardFocus())) {

View File

@@ -59,9 +59,9 @@ static void *KMSDRM_GetSym(const char *fnname, int *pHasModule, bool required)
#if DEBUG_DYNAMIC_KMSDRM
if (fn)
SDL_Log("KMSDRM: Found '%s' in %s (%p)\n", fnname, kmsdrmlibs[i].libname, fn);
SDL_Log("KMSDRM: Found '%s' in %s (%p)", fnname, kmsdrmlibs[i].libname, fn);
else
SDL_Log("KMSDRM: Symbol '%s' NOT FOUND!\n", fnname);
SDL_Log("KMSDRM: Symbol '%s' NOT FOUND!", fnname);
#endif
if (!fn && required) {

View File

@@ -661,7 +661,7 @@ static bool OPENVR_SetupFrame(SDL_VideoDevice *_this, SDL_Window *window)
{
int error = ov_glGetError();
if (error)
SDL_Log("Found GL Error before beginning frame: %d / (Framebuffer:%d)\n", error, ov_glCheckNamedFramebufferStatus(videodata->fbo, GL_FRAMEBUFFER));
SDL_Log("Found GL Error before beginning frame: %d / (Framebuffer:%d)", error, ov_glCheckNamedFramebufferStatus(videodata->fbo, GL_FRAMEBUFFER));
}
#endif
@@ -698,7 +698,7 @@ static bool OPENVR_ReleaseFrame(SDL_VideoDevice *_this)
{
int error = ov_glGetError();
if (error) {
SDL_Log("Found GL Error before release frame: %d / (Framebuffer:%d)\n", error, ov_glCheckNamedFramebufferStatus(videodata->fbo, GL_FRAMEBUFFER));
SDL_Log("Found GL Error before release frame: %d / (Framebuffer:%d)", error, ov_glCheckNamedFramebufferStatus(videodata->fbo, GL_FRAMEBUFFER));
}
}
#endif
@@ -895,7 +895,7 @@ static SDL_GLContext OPENVR_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window
const char *ccc = (const char *)ov_glGetStringi(GL_EXTENSIONS, i);
if (SDL_strcmp(ccc, "GL_KHR_debug") == 0) {
#ifdef DEBUG_OPENVR
SDL_Log("Found renderdoc debug extension.\n");
SDL_Log("Found renderdoc debug extension.");
#endif
videodata->renderdoc_debugmarker_frame_end = true;
}
@@ -968,7 +968,7 @@ static bool SDL_EGL_InitInternal(SDL_VideoData * vd)
vd->eglDpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#ifdef DEBUG_OPENVR
SDL_Log("EGL Display: %p\n", vd->eglDpy);
SDL_Log("EGL Display: %p", vd->eglDpy);
#endif
if (vd->eglDpy == 0) {
@@ -1040,7 +1040,7 @@ static SDL_GLContext OVR_EGL_CreateContext(SDL_VideoDevice *_this, SDL_Window *
const char * ccc = (const char*)ov_glGetStringi(GL_EXTENSIONS, i);
if (SDL_strcmp(ccc, "GL_KHR_debug") == 0) {
#ifdef DEBUG_OPENVR
SDL_Log("Found renderdoc debug extension.\n");
SDL_Log("Found renderdoc debug extension.");
#endif
videodata->renderdoc_debugmarker_frame_end = true;
}

View File

@@ -66,9 +66,9 @@ static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, bool required)
#if DEBUG_DYNAMIC_WAYLAND
if (fn) {
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, dynlib->libname, fn);
SDL_Log("WAYLAND: Found '%s' in %s (%p)", fnname, dynlib->libname, fn);
} else {
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!", fnname);
}
#endif

View File

@@ -1195,7 +1195,7 @@ static void libdecor_error(struct libdecor *context,
enum libdecor_error error,
const char *message)
{
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "libdecor error (%d): %s\n", error, message);
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "libdecor error (%d): %s", error, message);
}
static struct libdecor_interface libdecor_interface = {

View File

@@ -157,17 +157,17 @@ static Uint64 WIN_GetEventTimestamp(void)
timestamp += timestamp_offset;
if (!timestamp_offset) {
// Initializing timestamp offset
//SDL_Log("Initializing timestamp offset\n");
//SDL_Log("Initializing timestamp offset");
timestamp_offset = (now - timestamp);
timestamp = now;
} else if ((Sint64)(now - timestamp - TIMESTAMP_WRAP_OFFSET) >= 0) {
// The windows message tick wrapped
//SDL_Log("Adjusting timestamp offset for wrapping tick\n");
//SDL_Log("Adjusting timestamp offset for wrapping tick");
timestamp_offset += TIMESTAMP_WRAP_OFFSET;
timestamp += TIMESTAMP_WRAP_OFFSET;
} else if (timestamp > now) {
// We got a newer timestamp, but it can't be newer than now, so adjust our offset
//SDL_Log("Adjusting timestamp offset, %.2f ms newer\n", (double)(timestamp - now) / SDL_NS_PER_MS);
//SDL_Log("Adjusting timestamp offset, %.2f ms newer", (double)(timestamp - now) / SDL_NS_PER_MS);
timestamp_offset -= (timestamp - now);
timestamp = now;
}
@@ -2239,7 +2239,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
int w, h;
#ifdef HIGHDPI_DEBUG
SDL_Log("WM_DPICHANGED: to %d\tsuggested rect: (%d, %d), (%dx%d)\n", newDPI,
SDL_Log("WM_DPICHANGED: to %d\tsuggested rect: (%d, %d), (%dx%d)", newDPI,
suggestedRect->left, suggestedRect->top, suggestedRect->right - suggestedRect->left, suggestedRect->bottom - suggestedRect->top);
#endif
@@ -2270,7 +2270,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
}
#ifdef HIGHDPI_DEBUG
SDL_Log("WM_DPICHANGED: current SDL window size: (%dx%d)\tcalling SetWindowPos: (%d, %d), (%dx%d)\n",
SDL_Log("WM_DPICHANGED: current SDL window size: (%dx%d)\tcalling SetWindowPos: (%d, %d), (%dx%d)",
data->window->w, data->window->h,
suggestedRect->left, suggestedRect->top, w, h);
#endif

View File

@@ -391,7 +391,7 @@ static void DumpKeys(const char *prefix, GameInputKeyState *keys, uint32_t count
for (uint32_t i = 0; i < count; ++i) {
char str[5];
*SDL_UCS4ToUTF8(keys[i].codePoint, str) = '\0';
SDL_Log(" Key 0x%.2x (%s)\n", keys[i].scanCode, str);
SDL_Log(" Key 0x%.2x (%s)", keys[i].scanCode, str);
}
}
#endif // DEBUG_KEYS
@@ -413,7 +413,7 @@ static void GAMEINPUT_HandleKeyboardDelta(WIN_GameInputData *data, SDL_Window *w
uint32_t num_last = IGameInputReading_GetKeyState(last_reading, max_keys, last);
uint32_t num_keys = IGameInputReading_GetKeyState(reading, max_keys, keys);
#ifdef DEBUG_KEYS
SDL_Log("Timestamp: %llu\n", timestamp);
SDL_Log("Timestamp: %llu", timestamp);
DumpKeys("Last keys:", last, num_last);
DumpKeys("New keys:", keys, num_keys);
#endif

View File

@@ -561,7 +561,7 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI
float content_scale = WIN_GetContentScale(_this, hMonitor);
#ifdef DEBUG_MODES
SDL_Log("Display: %s\n", WIN_StringToUTF8W(info->szDevice));
SDL_Log("Display: %s", WIN_StringToUTF8W(info->szDevice));
#endif
dxgi_output = WIN_GetDXGIOutput(_this, info->szDevice);

View File

@@ -482,11 +482,11 @@ static bool WIN_VideoInit(SDL_VideoDevice *_this)
if (SUCCEEDED(hr)) {
data->oleinitialized = true;
} else {
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "OleInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality\n", (unsigned int)hr);
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "OleInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality", (unsigned int)hr);
}
#endif // !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
} else {
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "CoInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality\n", (unsigned int)hr);
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "CoInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality", (unsigned int)hr);
}
WIN_InitDPIAwareness(_this);

View File

@@ -430,7 +430,7 @@ void X11_ReconcileKeyboardState(SDL_VideoDevice *_this)
static void X11_DispatchFocusIn(SDL_VideoDevice *_this, SDL_WindowData *data)
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: Dispatching FocusIn\n", data->xwindow);
SDL_Log("window 0x%lx: Dispatching FocusIn", data->xwindow);
#endif
SDL_SetKeyboardFocus(data->window);
X11_ReconcileKeyboardState(_this);
@@ -447,7 +447,7 @@ static void X11_DispatchFocusIn(SDL_VideoDevice *_this, SDL_WindowData *data)
static void X11_DispatchFocusOut(SDL_VideoDevice *_this, SDL_WindowData *data)
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: Dispatching FocusOut\n", data->xwindow);
SDL_Log("window 0x%lx: Dispatching FocusOut", data->xwindow);
#endif
/* If another window has already processed a focus in, then don't try to
* remove focus here. Doing so will incorrectly remove focus from that
@@ -606,7 +606,7 @@ static void X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest)
XA_CARDINAL, 32, PropModeReplace,
(const unsigned char *)&latest, 1);
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: updating _NET_WM_USER_TIME to %lu\n", data->xwindow, latest);
SDL_Log("window 0x%lx: updating _NET_WM_USER_TIME to %lu", data->xwindow, latest);
#endif
data->user_time = latest;
}
@@ -636,7 +636,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
#ifdef DEBUG_XEVENTS
char *atom_name;
atom_name = X11_XGetAtomName(display, req->target);
SDL_Log("window CLIPBOARD: SelectionRequest (requestor = 0x%lx, target = 0x%lx, mime_type = %s)\n",
SDL_Log("window CLIPBOARD: SelectionRequest (requestor = 0x%lx, target = 0x%lx, mime_type = %s)",
req->requestor, req->target, atom_name);
if (atom_name) {
X11_XFree(atom_name);
@@ -709,7 +709,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
const char *propName = xsel->property ? X11_XGetAtomName(display, xsel->property) : "None";
const char *targetName = xsel->target ? X11_XGetAtomName(display, xsel->target) : "None";
SDL_Log("window CLIPBOARD: SelectionNotify (requestor = 0x%lx, target = %s, property = %s)\n",
SDL_Log("window CLIPBOARD: SelectionNotify (requestor = 0x%lx, target = %s, property = %s)",
xsel->requestor, targetName, propName);
#endif
if (xsel->target == videodata->atoms.TARGETS && xsel->property == videodata->atoms.SDL_FORMATS) {
@@ -761,7 +761,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
SDLX11_ClipboardData *clipboard = NULL;
#ifdef DEBUG_XEVENTS
SDL_Log("window CLIPBOARD: SelectionClear (requestor = 0x%lx, target = 0x%lx)\n",
SDL_Log("window CLIPBOARD: SelectionClear (requestor = 0x%lx, target = 0x%lx)",
xevent->xselection.requestor, xevent->xselection.target);
#endif
@@ -892,14 +892,14 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
Uint64 timestamp = X11_GetEventTimestamp(xevent->xkey.time);
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx %s (X11 keycode = 0x%X)\n", xevent->xany.window, (xevent->type == KeyPress ? "KeyPress" : "KeyRelease"), xevent->xkey.keycode);
SDL_Log("window 0x%lx %s (X11 keycode = 0x%X)", xevent->xany.window, (xevent->type == KeyPress ? "KeyPress" : "KeyRelease"), xevent->xkey.keycode);
#endif
#ifdef DEBUG_SCANCODES
if (scancode == SDL_SCANCODE_UNKNOWN && keycode) {
int min_keycode, max_keycode;
X11_XDisplayKeycodes(display, &min_keycode, &max_keycode);
keysym = X11_KeyCodeToSym(_this, keycode, xevent->xkey.state >> 13);
SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list <https://discourse.libsdl.org/> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n",
SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list <https://discourse.libsdl.org/> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).",
keycode, keycode - min_keycode, keysym,
X11_XKeysymToString(keysym));
}
@@ -912,7 +912,7 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
// filter events catches XIM events and sends them to the correct handler
if (X11_XFilterEvent(xevent, None)) {
#ifdef DEBUG_XEVENTS
SDL_Log("Filtered event type = %d display = %p window = 0x%lx\n",
SDL_Log("Filtered event type = %d display = %p window = 0x%lx",
xevent->type, xevent->xany.display, xevent->xany.window);
#endif
handled_by_ime = true;
@@ -967,7 +967,7 @@ void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, S
Uint64 timestamp = X11_GetEventTimestamp(time);
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: ButtonPress (X11 button = %d)\n", windowdata->xwindow, button);
SDL_Log("window 0x%lx: ButtonPress (X11 button = %d)", windowdata->xwindow, button);
#endif
SDL_Mouse *mouse = SDL_GetMouse();
@@ -1015,7 +1015,7 @@ void X11_HandleButtonRelease(SDL_VideoDevice *_this, SDL_WindowData *windowdata,
Uint64 timestamp = X11_GetEventTimestamp(time);
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: ButtonRelease (X11 button = %d)\n", windowdata->xwindow, button);
SDL_Log("window 0x%lx: ButtonRelease (X11 button = %d)", windowdata->xwindow, button);
#endif
if (!X11_IsWheelEvent(display, button, &xticks, &yticks)) {
if (button > 7) {
@@ -1048,7 +1048,7 @@ void X11_GetBorderValues(SDL_WindowData *data)
X11_XFree(property);
#ifdef DEBUG_XEVENTS
SDL_Log("New _NET_FRAME_EXTENTS: left=%d right=%d, top=%d, bottom=%d\n", data->border_left, data->border_right, data->border_top, data->border_bottom);
SDL_Log("New _NET_FRAME_EXTENTS: left=%d right=%d, top=%d, bottom=%d", data->border_left, data->border_right, data->border_top, data->border_bottom);
#endif
}
} else {
@@ -1072,7 +1072,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
if (xevent->type != KeyPress && xevent->type != KeyRelease) {
if (X11_XFilterEvent(xevent, None)) {
#ifdef DEBUG_XEVENTS
SDL_Log("Filtered event type = %d display = %p window = 0x%lx\n",
SDL_Log("Filtered event type = %d display = %p window = 0x%lx",
xevent->type, xevent->xany.display, xevent->xany.window);
#endif
return;
@@ -1100,7 +1100,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
#endif
#ifdef DEBUG_XEVENTS
SDL_Log("X11 event type = %d display = %p window = 0x%lx\n",
SDL_Log("X11 event type = %d display = %p window = 0x%lx",
xevent->type, xevent->xany.display, xevent->xany.window);
#endif
@@ -1110,7 +1110,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
XFixesSelectionNotifyEvent *ev = (XFixesSelectionNotifyEvent *)xevent;
#ifdef DEBUG_XEVENTS
SDL_Log("window CLIPBOARD: XFixesSelectionNotify (selection = %s)\n",
SDL_Log("window CLIPBOARD: XFixesSelectionNotify (selection = %s)",
X11_XGetAtomName(display, ev->selection));
#endif
@@ -1154,7 +1154,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
// The window for KeymapNotify, etc events is 0
if (xevent->type == KeymapNotify) {
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: KeymapNotify!\n", xevent->xany.window);
SDL_Log("window 0x%lx: KeymapNotify!", xevent->xany.window);
#endif
if (SDL_GetKeyboardFocus() != NULL) {
#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM
@@ -1176,7 +1176,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
const int request = xevent->xmapping.request;
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: MappingNotify!\n", xevent->xany.window);
SDL_Log("window 0x%lx: MappingNotify!", xevent->xany.window);
#endif
if ((request == MappingKeyboard) || (request == MappingModifier)) {
X11_XRefreshKeyboardMapping(&xevent->xmapping);
@@ -1221,15 +1221,15 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
{
SDL_Mouse *mouse = SDL_GetMouse();
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: EnterNotify! (%d,%d,%d)\n", xevent->xany.window,
SDL_Log("window 0x%lx: EnterNotify! (%d,%d,%d)", xevent->xany.window,
xevent->xcrossing.x,
xevent->xcrossing.y,
xevent->xcrossing.mode);
if (xevent->xcrossing.mode == NotifyGrab) {
SDL_Log("Mode: NotifyGrab\n");
SDL_Log("Mode: NotifyGrab");
}
if (xevent->xcrossing.mode == NotifyUngrab) {
SDL_Log("Mode: NotifyUngrab\n");
SDL_Log("Mode: NotifyUngrab");
}
#endif
SDL_SetMouseFocus(data->window);
@@ -1260,15 +1260,15 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
case LeaveNotify:
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: LeaveNotify! (%d,%d,%d)\n", xevent->xany.window,
SDL_Log("window 0x%lx: LeaveNotify! (%d,%d,%d)", xevent->xany.window,
xevent->xcrossing.x,
xevent->xcrossing.y,
xevent->xcrossing.mode);
if (xevent->xcrossing.mode == NotifyGrab) {
SDL_Log("Mode: NotifyGrab\n");
SDL_Log("Mode: NotifyGrab");
}
if (xevent->xcrossing.mode == NotifyUngrab) {
SDL_Log("Mode: NotifyUngrab\n");
SDL_Log("Mode: NotifyUngrab");
}
#endif
if (!SDL_GetMouse()->relative_mode) {
@@ -1295,19 +1295,19 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) {
// Someone is handling a global hotkey, ignore it
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusIn (NotifyGrab/NotifyUngrab, ignoring)", xevent->xany.window);
#endif
break;
}
if (xevent->xfocus.detail == NotifyInferior || xevent->xfocus.detail == NotifyPointer) {
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusIn (NotifyInferior/NotifyPointer, ignoring)\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusIn (NotifyInferior/NotifyPointer, ignoring)", xevent->xany.window);
#endif
break;
}
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusIn!\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusIn!", xevent->xany.window);
#endif
if (!videodata->last_mode_change_deadline) /* no recent mode changes */ {
data->pending_focus = PENDING_FOCUS_NONE;
@@ -1326,7 +1326,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) {
// Someone is handling a global hotkey, ignore it
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusOut (NotifyGrab/NotifyUngrab, ignoring)", xevent->xany.window);
#endif
break;
}
@@ -1335,12 +1335,12 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
care about the position of the pointer when the keyboard
focus changed. */
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusOut (NotifyInferior/NotifyPointer, ignoring)\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusOut (NotifyInferior/NotifyPointer, ignoring)", xevent->xany.window);
#endif
break;
}
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: FocusOut!\n", xevent->xany.window);
SDL_Log("window 0x%lx: FocusOut!", xevent->xany.window);
#endif
if (!videodata->last_mode_change_deadline) /* no recent mode changes */ {
data->pending_focus = PENDING_FOCUS_NONE;
@@ -1366,7 +1366,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
XEvent ev;
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: UnmapNotify!\n", xevent->xany.window);
SDL_Log("window 0x%lx: UnmapNotify!", xevent->xany.window);
#endif
if (X11_XCheckIfEvent(display, &ev, &isReparentNotify, (XPointer)&xevent->xunmap)) {
@@ -1387,7 +1387,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
case MapNotify:
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: MapNotify!\n", xevent->xany.window);
SDL_Log("window 0x%lx: MapNotify!", xevent->xany.window);
#endif
X11_DispatchMapNotify(data);
@@ -1403,7 +1403,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
case ConfigureNotify:
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", xevent->xany.window,
SDL_Log("window 0x%lx: ConfigureNotify! (position: %d,%d, size: %dx%d)", xevent->xany.window,
xevent->xconfigure.x, xevent->xconfigure.y,
xevent->xconfigure.width, xevent->xconfigure.height);
#endif
@@ -1470,9 +1470,9 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
data->xdnd_source = xevent->xclient.data.l[0];
xdnd_version = (xevent->xclient.data.l[1] >> 24);
#ifdef DEBUG_XEVENTS
SDL_Log("XID of source window : 0x%lx\n", data->xdnd_source);
SDL_Log("Protocol version to use : %d\n", xdnd_version);
SDL_Log("More then 3 data types : %d\n", (int)use_list);
SDL_Log("XID of source window : 0x%lx", data->xdnd_source);
SDL_Log("Protocol version to use : %d", xdnd_version);
SDL_Log("More then 3 data types : %d", (int)use_list);
#endif
if (use_list) {
@@ -1488,7 +1488,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
}
} else if (xevent->xclient.message_type == videodata->atoms.XdndLeave) {
#ifdef DEBUG_XEVENTS
SDL_Log("XID of source window : 0x%lx\n", xevent->xclient.data.l[0]);
SDL_Log("XID of source window : 0x%lx", xevent->xclient.data.l[0]);
#endif
SDL_SendDropComplete(data->window);
} else if (xevent->xclient.message_type == videodata->atoms.XdndPosition) {
@@ -1498,7 +1498,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
if (xdnd_version >= 2) {
act = xevent->xclient.data.l[4];
}
SDL_Log("Action requested by user is : %s\n", X11_XGetAtomName(display, act));
SDL_Log("Action requested by user is : %s", X11_XGetAtomName(display, act));
#endif
{
// Drag and Drop position
@@ -1555,7 +1555,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
Window root = DefaultRootWindow(display);
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: _NET_WM_PING\n", xevent->xany.window);
SDL_Log("window 0x%lx: _NET_WM_PING", xevent->xany.window);
#endif
xevent->xclient.window = root;
X11_XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, xevent);
@@ -1567,7 +1567,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
(xevent->xclient.data.l[0] == videodata->atoms.WM_DELETE_WINDOW)) {
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: WM_DELETE_WINDOW\n", xevent->xany.window);
SDL_Log("window 0x%lx: WM_DELETE_WINDOW", xevent->xany.window);
#endif
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
break;
@@ -1589,7 +1589,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
case Expose:
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: Expose (count = %d)\n", xevent->xany.window, xevent->xexpose.count);
SDL_Log("window 0x%lx: Expose (count = %d)", xevent->xany.window, xevent->xexpose.count);
#endif
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_EXPOSED, 0, 0);
} break;
@@ -1622,7 +1622,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
SDL_Mouse *mouse = SDL_GetMouse();
if (!mouse->relative_mode) {
#ifdef DEBUG_MOTION
SDL_Log("window 0x%lx: X11 motion: %d,%d\n", xevent->xany.window, xevent->xmotion.x, xevent->xmotion.y);
SDL_Log("window 0x%lx: X11 motion: %d,%d", xevent->xany.window, xevent->xmotion.x, xevent->xmotion.y);
#endif
X11_ProcessHitTest(_this, data, (float)xevent->xmotion.x, (float)xevent->xmotion.y, false);
@@ -1661,7 +1661,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
char *name = X11_XGetAtomName(display, xevent->xproperty.atom);
if (name) {
SDL_Log("window 0x%lx: PropertyNotify: %s %s time=%lu\n", xevent->xany.window, name, (xevent->xproperty.state == PropertyDelete) ? "deleted" : "changed", xevent->xproperty.time);
SDL_Log("window 0x%lx: PropertyNotify: %s %s time=%lu", xevent->xany.window, name, (xevent->xproperty.state == PropertyDelete) ? "deleted" : "changed", xevent->xproperty.time);
X11_XFree(name);
}
@@ -1674,7 +1674,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
for (i = 0; i < items_read; i++) {
SDL_Log(" %d", values[i]);
}
SDL_Log(" }\n");
SDL_Log(" }");
} else if (real_type == XA_CARDINAL) {
if (real_format == 32) {
Uint32 *values = (Uint32 *)propdata;
@@ -1683,7 +1683,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
for (i = 0; i < items_read; i++) {
SDL_Log(" %d", values[i]);
}
SDL_Log(" }\n");
SDL_Log(" }");
} else if (real_format == 16) {
Uint16 *values = (Uint16 *)propdata;
@@ -1691,7 +1691,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
for (i = 0; i < items_read; i++) {
SDL_Log(" %d", values[i]);
}
SDL_Log(" }\n");
SDL_Log(" }");
} else if (real_format == 8) {
Uint8 *values = (Uint8 *)propdata;
@@ -1699,11 +1699,11 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
for (i = 0; i < items_read; i++) {
SDL_Log(" %d", values[i]);
}
SDL_Log(" }\n");
SDL_Log(" }");
}
} else if (real_type == XA_STRING ||
real_type == videodata->atoms.UTF8_STRING) {
SDL_Log("{ \"%s\" }\n", propdata);
SDL_Log("{ \"%s\" }", propdata);
} else if (real_type == XA_ATOM) {
Atom *atoms = (Atom *)propdata;
@@ -1715,10 +1715,10 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
X11_XFree(atomname);
}
}
SDL_Log(" }\n");
SDL_Log(" }");
} else {
char *atomname = X11_XGetAtomName(display, real_type);
SDL_Log("Unknown type: 0x%lx (%s)\n", real_type, atomname ? atomname : "UNKNOWN");
SDL_Log("Unknown type: 0x%lx (%s)", real_type, atomname ? atomname : "UNKNOWN");
if (atomname) {
X11_XFree(atomname);
}
@@ -1918,7 +1918,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
{
Atom target = xevent->xselection.target;
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: SelectionNotify (requestor = 0x%lx, target = 0x%lx)\n", xevent->xany.window,
SDL_Log("window 0x%lx: SelectionNotify (requestor = 0x%lx, target = 0x%lx)", xevent->xany.window,
xevent->xselection.requestor, xevent->xselection.target);
#endif
if (target == data->xdnd_req) {
@@ -1969,7 +1969,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
default:
{
#ifdef DEBUG_XEVENTS
SDL_Log("window 0x%lx: Unhandled event %d\n", xevent->xany.window, xevent->type);
SDL_Log("window 0x%lx: Unhandled event %d", xevent->xany.window, xevent->type);
#endif
} break;
}

View File

@@ -239,7 +239,7 @@ bool X11_InitKeyboard(SDL_VideoDevice *_this)
const SDL_Scancode *table = SDL_GetScancodeTable(scancode_set[best_index], &table_size);
#ifdef DEBUG_KEYBOARD
SDL_Log("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d\n", best_index, min_keycode, max_keycode, table_size);
SDL_Log("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d", best_index, min_keycode, max_keycode, table_size);
#endif
// This should never happen, but just in case...
if (table_size > (SDL_arraysize(data->key_layout) - min_keycode)) {
@@ -267,14 +267,14 @@ bool X11_InitKeyboard(SDL_VideoDevice *_this)
if ((SDL_GetKeymapKeycode(NULL, scancode, SDL_KMOD_NONE) & (SDLK_SCANCODE_MASK | SDLK_EXTENDED_MASK)) && X11_ScancodeIsRemappable(scancode)) {
// Not a character key and the scancode is safe to remap
#ifdef DEBUG_KEYBOARD
SDL_Log("Changing scancode, was %d (%s), now %d (%s)\n", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode));
SDL_Log("Changing scancode, was %d (%s), now %d (%s)", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode));
#endif
data->key_layout[i] = scancode;
}
}
} else {
#ifdef DEBUG_SCANCODES
SDL_Log("Keyboard layout unknown, please report the following to the SDL forums/mailing list (https://discourse.libsdl.org/):\n");
SDL_Log("Keyboard layout unknown, please report the following to the SDL forums/mailing list (https://discourse.libsdl.org/):");
#endif
// Determine key_layout - only works on US QWERTY layout
@@ -288,9 +288,9 @@ bool X11_InitKeyboard(SDL_VideoDevice *_this)
(unsigned int)sym, sym == NoSymbol ? "NoSymbol" : X11_XKeysymToString(sym));
}
if (scancode == SDL_SCANCODE_UNKNOWN) {
SDL_Log("scancode not found\n");
SDL_Log("scancode not found");
} else {
SDL_Log("scancode = %d (%s)\n", scancode, SDL_GetScancodeName(scancode));
SDL_Log("scancode = %d (%s)", scancode, SDL_GetScancodeName(scancode));
}
#endif
data->key_layout[i] = scancode;
@@ -592,12 +592,12 @@ static void preedit_draw_callback(XIC xic, XPointer client_data, XIMPreeditDrawC
#ifdef DEBUG_XIM
if (call_data->chg_length > 0) {
SDL_Log("Draw callback deleted %d characters at %d\n", call_data->chg_length, call_data->chg_first);
SDL_Log("Draw callback deleted %d characters at %d", call_data->chg_length, call_data->chg_first);
}
if (text) {
SDL_Log("Draw callback inserted %s at %d, caret: %d\n", text->string.multi_byte, call_data->chg_first, call_data->caret);
SDL_Log("Draw callback inserted %s at %d, caret: %d", text->string.multi_byte, call_data->chg_first, call_data->caret);
}
SDL_Log("Pre-edit text: %s\n", data->preedit_text);
SDL_Log("Pre-edit text: %s", data->preedit_text);
#endif
X11_SendEditingEvent(data);

View File

@@ -584,7 +584,7 @@ bool X11_Xinput2SelectMouseAndKeyboard(SDL_VideoDevice *_this, SDL_Window *windo
XISetMask(mask, XI_PropertyEvent); // E.g., when swapping tablet pens
if (X11_XISelectEvents(data->display, windowdata->xwindow, &eventmask, 1) != Success) {
SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Could not enable XInput2 event handling\n");
SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Could not enable XInput2 event handling");
windowdata->xinput2_keyboard_enabled = false;
windowdata->xinput2_mouse_enabled = false;
}