diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index cb795e5f..7d7e0538 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -45,6 +45,15 @@ namespace nana namespace API { +#ifdef NANA_X11 + //Some platform specific functions for X11 + namespace x11 + { + /// Returns the connection to the X server + const void* get_display(); + } +#endif + namespace detail { ::nana::widget_geometrics* make_scheme(::nana::detail::scheme_factory_interface&&); @@ -110,6 +119,7 @@ namespace API void draw_shortkey_underline(paint::graphics&, const std::string& text, wchar_t shortkey, std::size_t shortkey_position, const point& text_pos, const color&); }//end namespace dev + /// Returns the widget pointer of the specified window. /* * @param window_handle A handle to a window owning the widget. diff --git a/source/gui/detail/bedrock_posix.cpp b/source/gui/detail/bedrock_posix.cpp index f72525fd..571b91bc 100644 --- a/source/gui/detail/bedrock_posix.cpp +++ b/source/gui/detail/bedrock_posix.cpp @@ -911,11 +911,18 @@ namespace detail case Expose: if(msgwnd->visible && (msgwnd->root_graph->empty() == false)) { - nana::detail::platform_scope_guard psg; - //Don't copy root_graph to the window directly, otherwise the edge nimbus effect will be missed. - ::nana::rectangle update_area(xevent.xexpose.x, xevent.xexpose.y, xevent.xexpose.width, xevent.xexpose.height); - if (!update_area.empty()) - msgwnd->drawer.map(reinterpret_cast(msgwnd), true, &update_area); + nana::detail::platform_scope_guard lock; + if(msgwnd->is_draw_through()) + { + msgwnd->other.attribute.root->draw_through(); + } + else + { + //Don't copy root_graph to the window directly, otherwise the edge nimbus effect will be missed. + ::nana::rectangle update_area(xevent.xexpose.x, xevent.xexpose.y, xevent.xexpose.width, xevent.xexpose.height); + if (!update_area.empty()) + msgwnd->drawer.map(reinterpret_cast(msgwnd), true, &update_area); + } } break; case KeyPress: diff --git a/source/gui/programming_interface.cpp b/source/gui/programming_interface.cpp index 7ed9883f..da45698b 100644 --- a/source/gui/programming_interface.cpp +++ b/source/gui/programming_interface.cpp @@ -21,6 +21,9 @@ #include #include "../../source/detail/platform_abstraction.hpp" +#ifdef NANA_X11 +# include "../../source/detail/posix/platform_spec.hpp" +#endif namespace nana { @@ -52,6 +55,19 @@ namespace nana } namespace API { +#ifdef NANA_X11 + //Some platform specific functions for X11 + namespace x11 + { + /// Returns the connection to the X server + const void* get_display() + { + auto & spec = nana::detail::platform_spec::instance(); + return spec.open_display(); + } + } +#endif + using basic_window = ::nana::detail::basic_window; using interface_type = ::nana::detail::native_interface; @@ -392,7 +408,6 @@ namespace API } }//end namespace dev - widget* get_widget(window wd) { internal_scope_guard lock;