summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_x11.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index 9ed9bc3448c..7f1520b95c6 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2019 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -208,7 +208,7 @@ namespace entry
static void initTranslateKey(uint16_t _xk, Key::Enum _key)
{
_xk += 256;
- BX_CHECK(_xk < BX_COUNTOF(s_translateKey), "Out of bounds %d.", _xk);
+ BX_ASSERT(_xk < BX_COUNTOF(s_translateKey), "Out of bounds %d.", _xk);
s_translateKey[_xk&0x1ff] = (uint8_t)_key;
}
@@ -354,8 +354,9 @@ namespace entry
m_root = RootWindow(m_display, screen);
bx::memSet(&m_windowAttrs, 0, sizeof(m_windowAttrs) );
- m_windowAttrs.background_pixmap = 0;
+ m_windowAttrs.background_pixel = 0;
m_windowAttrs.border_pixel = 0;
+ m_windowAttrs.bit_gravity = StaticGravity;
m_windowAttrs.event_mask = 0
| ButtonPressMask
| ButtonReleaseMask
@@ -374,15 +375,10 @@ namespace entry
, m_depth
, InputOutput
, m_visual
- , CWBorderPixel|CWEventMask
+ , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
, &m_windowAttrs
);
- // Clear window to black.
- XSetWindowAttributes attr;
- bx::memSet(&attr, 0, sizeof(attr) );
- XChangeWindowAttributes(m_display, m_window[0], CWBackPixel, &attr);
-
const char* wmDeleteWindowName = "WM_DELETE_WINDOW";
Atom wmDeleteWindow;
XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow);
@@ -599,16 +595,11 @@ namespace entry
, m_depth
, InputOutput
, m_visual
- , CWBorderPixel|CWEventMask
+ , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
, &m_windowAttrs
);
m_window[_handle.idx] = window;
- // Clear window to black.
- XSetWindowAttributes attr;
- bx::memSet(&attr, 0, sizeof(attr) );
- XChangeWindowAttributes(m_display, window, CWBackPixel, &attr);
-
const char* wmDeleteWindowName = "WM_DELETE_WINDOW";
Atom wmDeleteWindow;
XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow);
@@ -755,7 +746,10 @@ namespace entry
{
Display* display = s_ctx.m_display;
Window window = s_ctx.m_window[_handle.idx];
- XStoreName(display, window, _title);
+
+ XTextProperty tp;
+ Xutf8TextListToTextProperty(display, (char**)&_title, 1, XUTF8StringStyle, &tp);
+ XSetWMName(display, window, &tp);
}
void setWindowFlags(WindowHandle _handle, uint32_t _flags, bool _enabled)