diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/uwp/detect.py | 3 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 21 | ||||
| -rw-r--r-- | platform/x11/os_x11.h | 2 |
3 files changed, 10 insertions, 16 deletions
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index ca469d0056..64dac93f1f 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -115,7 +115,6 @@ def configure(env): angle_build_cmd += "Win32" - env.Append(CPPFLAGS=['/DPNG_ABORT=abort']) env.Append(LINKFLAGS=['/MACHINE:X86']) env.Append(LIBPATH=[vc_base_path + 'lib/store']) env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_Win32/lib']) @@ -141,7 +140,7 @@ def configure(env): winver = "0x0602" # Windows 8 is the minimum target for UWP build env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver]) - env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32']) + env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32', '/DPNG_ABORT=abort']) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/store/references']) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/x86/store/references']) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 790182794e..4aca1468b1 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -508,22 +508,17 @@ void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data, os->xic = NULL; } -void OS_X11::set_ime_position(short x, short y) { +void OS_X11::set_ime_position(const Point2 &p_pos) { - if (!xic) { + if (!xic) return; - } + ::XPoint spot; - spot.x = x; - spot.y = y; - XVaNestedList preedit_attr = XVaCreateNestedList(0, - XNSpotLocation, &spot, - NULL); - XSetICValues(xic, - XNPreeditAttributes, preedit_attr, - NULL); + spot.x = short(p_pos.x); + spot.y = short(p_pos.y); + XVaNestedList preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); + XSetICValues(xic, XNPreeditAttributes, preedit_attr, NULL); XFree(preedit_attr); - return; } void OS_X11::finalize() { @@ -1489,7 +1484,7 @@ void OS_X11::process_xevents() { case ConfigureNotify: if (xic) { // Not portable. - set_ime_position(0, 1); + set_ime_position(Point2(0, 1)); } /* call resizeGLScene only if our window-size changed */ diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 39c512b6bd..12e4bbb086 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -115,7 +115,6 @@ class OS_X11 : public OS_Unix { ::XIMStyle xim_style; static void xim_destroy_callback(::XIM im, ::XPointer client_data, ::XPointer call_data); - void set_ime_position(short x, short y); Point2i last_mouse_pos; bool last_mouse_pos_valid; @@ -253,6 +252,7 @@ public: virtual void set_borderless_window(int p_borderless); virtual bool get_borderless_window(); + virtual void set_ime_position(const Point2 &p_pos); virtual void move_window_to_foreground(); virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); |