MCPcopy Create free account
hub / github.com/SFML/SFML / initialize

Method initialize

src/SFML/Window/Unix/WindowImplX11.cpp:1647–1737  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1645
1646////////////////////////////////////////////////////////////
1647void WindowImplX11::initialize()
1648{
1649 using namespace WindowImplX11Impl;
1650
1651 // Create the input context
1652 m_inputMethod = openXim();
1653
1654 if (m_inputMethod)
1655 {
1656 m_inputContext = XCreateIC(m_inputMethod.get(),
1657 XNClientWindow,
1658 m_window,
1659 XNFocusWindow,
1660 m_window,
1661 XNInputStyle,
1662 XIMPreeditNothing | XIMStatusNothing,
1663 nullptr);
1664 }
1665 else
1666 {
1667 m_inputContext = nullptr;
1668 }
1669
1670 if (!m_inputContext)
1671 err() << "Failed to create input context for window -- TextEntered event won't be able to return unicode"
1672 << std::endl;
1673
1674 if (isFeatureSupported("_NET_WM_WINDOW_TYPE") && isFeatureSupported("_NET_WM_WINDOW_TYPE_NORMAL"))
1675 {
1676 static const auto wmWindowType = getAtom("_NET_WM_WINDOW_TYPE");
1677 static const auto wmWindowTypeNormal = getAtom("_NET_WM_WINDOW_TYPE_NORMAL");
1678
1679 if (wmWindowType && wmWindowTypeNormal)
1680 {
1681 XChangeProperty(m_display.get(),
1682 m_window,
1683 wmWindowType,
1684 XA_ATOM,
1685 32,
1686 PropModeReplace,
1687 reinterpret_cast<const unsigned char*>(&wmWindowTypeNormal),
1688 1);
1689 }
1690 }
1691
1692 // Always try to bypass the compositor if supported
1693 if (isFeatureSupported("_NET_WM_BYPASS_COMPOSITOR"))
1694 {
1695 static const auto netWmBypassCompositor = getAtom("_NET_WM_BYPASS_COMPOSITOR");
1696
1697 if (netWmBypassCompositor)
1698 {
1699 constexpr unsigned long bypassCompositor = 1;
1700
1701 XChangeProperty(m_display.get(),
1702 m_window,
1703 netWmBypassCompositor,
1704 XA_CARDINAL,

Callers

nothing calls this directly

Calls 5

openXimFunction · 0.85
isFeatureSupportedFunction · 0.85
getAtomFunction · 0.85
getMethod · 0.80
initRawMouseFunction · 0.70

Tested by

no test coverage detected