summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/detect.py34
-rw-r--r--platform/x11/logo.pngbin2061 -> 1679 bytes
-rw-r--r--platform/x11/os_x11.cpp34
-rw-r--r--platform/x11/os_x11.h5
4 files changed, 57 insertions, 16 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index ad2620c9f5..09e16ad078 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -59,8 +59,8 @@ def get_opts():
BoolVariable('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', False),
BoolVariable('pulseaudio', 'Detect & use pulseaudio', True),
BoolVariable('udev', 'Use udev for gamepad connection callbacks', False),
- EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
- BoolVariable('separate_debug_symbols', 'Create a separate file with the debug symbols', False),
+ EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')),
+ BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),
BoolVariable('touch', 'Enable touch events', True),
]
@@ -158,14 +158,6 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
- if not env['builtin_mbedtls']:
- # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
- env.Append(LIBS=['mbedtls', 'mbedcrypto', 'mbedx509'])
-
- if not env['builtin_libwebp']:
- env.ParseConfig('pkg-config libwebp --cflags --libs')
-
-
# freetype depends on libpng and zlib, so bundling one of them while keeping others
# as shared libraries leads to weird issues
if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']:
@@ -205,6 +197,10 @@ def configure(env):
env['builtin_libogg'] = False # Needed to link against system libtheora
env['builtin_libvorbis'] = False # Needed to link against system libtheora
env.ParseConfig('pkg-config theora theoradec --cflags --libs')
+ else:
+ list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
+ if any(platform.machine() in s for s in list_of_x86):
+ env["x86_libtheora_opt_gcc"] = True
if not env['builtin_libvpx']:
env.ParseConfig('pkg-config vpx --cflags --libs')
@@ -220,10 +216,20 @@ def configure(env):
if not env['builtin_libogg']:
env.ParseConfig('pkg-config ogg --cflags --libs')
- if env['builtin_libtheora']:
- list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
- if any(platform.machine() in s for s in list_of_x86):
- env["x86_libtheora_opt_gcc"] = True
+ if not env['builtin_libwebp']:
+ env.ParseConfig('pkg-config libwebp --cflags --libs')
+
+ if not env['builtin_mbedtls']:
+ # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
+ env.Append(LIBS=['mbedtls', 'mbedcrypto', 'mbedx509'])
+
+ if not env['builtin_libwebsockets']:
+ env.ParseConfig('pkg-config libwebsockets --cflags --libs')
+
+ if not env['builtin_miniupnpc']:
+ # No pkgconfig file so far, hardcode default paths.
+ env.Append(CPPPATH=["/usr/include/miniupnpc"])
+ env.Append(LIBS=["miniupnpc"])
# On Linux wchar_t should be 32-bits
# 16-bit library shouldn't be required due to compiler optimisations
diff --git a/platform/x11/logo.png b/platform/x11/logo.png
index 1cc93b46ac..078654b757 100644
--- a/platform/x11/logo.png
+++ b/platform/x11/logo.png
Binary files differ
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 1fa6993306..2bc85f76c9 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -391,6 +391,9 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
wm_delete = XInternAtom(x11_display, "WM_DELETE_WINDOW", true);
XSetWMProtocols(x11_display, x11_window, &wm_delete, 1);
+ im_active = false;
+ im_position = Vector2();
+
if (xim && xim_style) {
xic = XCreateIC(xim, XNInputStyle, xim_style, XNClientWindow, x11_window, XNFocusWindow, x11_window, (char *)NULL);
@@ -400,7 +403,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
xic = NULL;
}
if (xic) {
- XSetICFocus(xic);
+ XUnsetICFocus(xic);
} else {
WARN_PRINT("XCreateIC couldn't create xic");
}
@@ -541,8 +544,25 @@ void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data,
os->xic = NULL;
}
+void OS_X11::set_ime_active(const bool p_active) {
+
+ im_active = p_active;
+
+ if (!xic)
+ return;
+
+ if (p_active) {
+ XSetICFocus(xic);
+ set_ime_position(im_position);
+ } else {
+ XUnsetICFocus(xic);
+ }
+}
+
void OS_X11::set_ime_position(const Point2 &p_pos) {
+ im_position = p_pos;
+
if (!xic)
return;
@@ -1934,6 +1954,7 @@ void OS_X11::process_xevents() {
// to be able to send relative motion events.
Point2i pos(event.xmotion.x, event.xmotion.y);
+#ifdef TOUCH_ENABLED
// Avoidance of spurious mouse motion (see handling of touch)
bool filter = false;
// Adding some tolerance to match better Point2i to Vector2
@@ -1945,6 +1966,7 @@ void OS_X11::process_xevents() {
if (filter) {
break;
}
+#endif
if (mouse_mode == MOUSE_MODE_CAPTURED) {
@@ -2507,17 +2529,23 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
void OS_X11::release_rendering_thread() {
+#if defined(OPENGL_ENABLED)
context_gl->release_current();
+#endif
}
void OS_X11::make_rendering_thread() {
+#if defined(OPENGL_ENABLED)
context_gl->make_current();
+#endif
}
void OS_X11::swap_buffers() {
+#if defined(OPENGL_ENABLED)
context_gl->swap_buffers();
+#endif
}
void OS_X11::alert(const String &p_alert, const String &p_title) {
@@ -2611,8 +2639,10 @@ String OS_X11::get_joy_guid(int p_device) const {
}
void OS_X11::_set_use_vsync(bool p_enable) {
+#if defined(OPENGL_ENABLED)
if (context_gl)
- return context_gl->set_use_vsync(p_enable);
+ context_gl->set_use_vsync(p_enable);
+#endif
}
/*
bool OS_X11::is_vsync_enabled() const {
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 09ed9588c4..8cab23fe63 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -116,6 +116,10 @@ class OS_X11 : public OS_Unix {
static void xim_destroy_callback(::XIM im, ::XPointer client_data,
::XPointer call_data);
+ // IME
+ bool im_active;
+ Vector2 im_position;
+
Point2i last_mouse_pos;
bool last_mouse_pos_valid;
Point2i last_click_pos;
@@ -269,6 +273,7 @@ public:
virtual bool get_window_per_pixel_transparency_enabled() const;
virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
+ virtual void set_ime_active(const bool p_active);
virtual void set_ime_position(const Point2 &p_pos);
virtual String get_unique_id() const;