aboutsummaryrefslogtreecommitdiff
path: root/platform/x11/os_x11.cpp
diff options
context:
space:
mode:
authorWilson E. Alvarez2017-08-25 11:14:33 -0400
committerWilson E. Alvarez2017-08-26 16:58:47 -0400
commit7a07895920196c00d1ee14187e4ccdb2a6f0d0b9 (patch)
treed8acd6c8d53717c3a4ec205b000ac8f0ff1fc985 /platform/x11/os_x11.cpp
parent53c0010932f9c1becb63c16243f3a00ede359989 (diff)
downloadgodot-7a07895.tar.gz
godot-7a07895.tar.zst
godot-7a07895.zip
Added/Fixed null pointer checks
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r--platform/x11/os_x11.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index dbc391441..7e712ee32 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -116,24 +116,22 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
/** XLIB INITIALIZATION **/
x11_display = XOpenDisplay(NULL);
+ char *modifiers = NULL;
Bool xkb_dar = False;
if (x11_display) {
XAutoRepeatOn(x11_display);
xkb_dar = XkbSetDetectableAutoRepeat(x11_display, True, NULL);
- }
-
- char *modifiers = NULL;
- // Try to support IME if detectable auto-repeat is supported
-
- if (xkb_dar == True) {
+ // Try to support IME if detectable auto-repeat is supported
+ if (xkb_dar == True) {
// Xutf8LookupString will be used later instead of XmbLookupString before
// the multibyte sequences can be converted to unicode string.
#ifdef X_HAVE_UTF8_STRING
- modifiers = XSetLocaleModifiers("");
+ modifiers = XSetLocaleModifiers("");
#endif
+ }
}
if (modifiers == NULL) {
@@ -141,8 +139,6 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
WARN_PRINT("IME is disabled");
}
modifiers = XSetLocaleModifiers("@im=none");
- }
- if (modifiers == NULL) {
WARN_PRINT("Error setting locale modifiers");
}