fix a caret issue which happens when parent widget is hidden

This commit is contained in:
Jinhao
2015-06-26 23:59:28 +08:00
parent 1dd61ffb24
commit 8be566214c
6 changed files with 38 additions and 10 deletions

View File

@@ -63,15 +63,16 @@ namespace nana
arg.window_handle = reinterpret_cast<window>(wd);
if (emit(event_code::expose, wd, arg, false, get_thread_context()))
{
if (wd->together.caret)
const core_window_t * caret_wd = (wd->together.caret ? wd : wd->child_caret());
if (caret_wd)
{
if (exposed)
{
if (wd->root_widget->other.attribute.root->focus == wd)
wd->together.caret->visible(true);
if (wd->root_widget->other.attribute.root->focus == caret_wd)
caret_wd->together.caret->visible(true);
}
else
wd->together.caret->visible(false);
caret_wd->together.caret->visible(false);
}
if (!exposed)