fix transparent window bugs

This commit is contained in:
Jinhao
2016-10-14 07:19:56 +08:00
parent 7c36c27d46
commit 092ae97c66
10 changed files with 64 additions and 70 deletions

View File

@@ -85,7 +85,7 @@ namespace detail
enum class update_state
{
none, lazy, refresh
none, lazy, refreshed, request_refresh
};
struct edge_nimbus_action

View File

@@ -86,7 +86,7 @@ namespace nana{
}
//Avoiding duplicated rendering. If the window is declared to lazy refresh, it should be rendered.
if ((forced && (action.window == wd)) || (focused == action.window) || !action.rendered || (action.window->other.upd_state == core_window_t::update_state::refresh))
if ((forced && (action.window == wd)) || (focused == action.window) || !action.rendered || (action.window->other.upd_state == core_window_t::update_state::refreshed))
{
rd_set.emplace_back(r, action.window);
action.rendered = true;

View File

@@ -1,6 +1,6 @@
/*
* Window Layout Implementation
* Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -42,10 +42,16 @@ namespace detail
core_window_t * window;
rectangle r;
};
public:
static void paint(core_window_t*, bool is_redraw, bool is_child_refreshed);
static bool maproot(core_window_t*, bool have_refreshed, bool is_child_refreshed);
enum class paint_operation {
none,
have_refreshed,
try_refresh
};
public:
static void paint(core_window_t*, paint_operation, bool request_refresh_children);
static bool maproot(core_window_t*, bool have_refreshed, bool request_refresh_children);
static void paste_children_to_graphics(core_window_t*, nana::paint::graphics& graph);
@@ -68,13 +74,12 @@ namespace detail
//_m_paste_children
//@brief:paste children window to the root graphics directly. just paste the visual rectangle
static void _m_paste_children(core_window_t*, bool is_child_refreshed, bool have_refreshed, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos);
static void _m_paste_children(core_window_t*, bool have_refreshed, bool request_refresh_children, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos);
static void _m_paint_glass_window(core_window_t*, bool is_redraw, bool is_child_refreshed, bool called_by_notify, bool notify_other);
//_m_notify_glasses
//@brief: Notify the glass windows that are overlapped with the specified vis_rect
static void _m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& r_visual);
//Notify the windows which have brground to update their background buffer.
static void _m_notify_glasses(core_window_t* const sigwd);
private:
struct data_section
{

View File

@@ -124,7 +124,7 @@ namespace detail
bool update(core_window_t*, bool redraw, bool force, const rectangle* update_area = nullptr);
void refresh_tree(core_window_t*);
bool do_lazy_refresh(core_window_t*, bool force_copy_to_screen, bool refresh_tree = false);
void do_lazy_refresh(core_window_t*, bool force_copy_to_screen, bool refresh_tree = false);
bool get_graphics(core_window_t*, nana::paint::graphics&);
bool get_visual_rectangle(core_window_t*, nana::rectangle&);