App-level changes to support correct redrawing while resizing on

Windows.
This commit is contained in:
casey langen 2022-07-25 19:12:17 -07:00
parent f3dbca0ad7
commit 64b77d5f7d
3 changed files with 24 additions and 17 deletions

View File

@ -115,6 +115,7 @@ static bool isLangUtf8() {
#ifdef WIN32
static void pdcWinguiResizeCallback() {
App::Instance().NotifyResized();
App::Instance().Layout();
}
#endif
@ -612,6 +613,23 @@ process:
this->NotifyResized();
}
this->Layout();
}
overlays.Clear();
}
void App::NotifyResized() {
resized = false;
resize_term(0, 0);
Window::InvalidateScreen();
if (this->resizeHandler) {
this->resizeHandler();
}
this->OnResized();
}
void App::Layout() {
this->CheckShowOverlay();
this->EnsureFocusIsValid();
@ -630,19 +648,6 @@ process:
Window::WriteToScreen(this->state.input);
}
overlays.Clear();
}
void App::NotifyResized() {
resized = false;
resize_term(0, 0);
Window::InvalidateScreen();
if (this->resizeHandler) {
this->resizeHandler();
}
this->OnResized();
}
void App::UpdateFocusedWindow(IWindowPtr window) {
if (this->state.focused != window) {
this->state.focused = window;

View File

@ -105,6 +105,7 @@ static inline void DrawCursor(IInput* input) {
const int targetY = 0;
const int targetX = (int) input->Position();
wmove(content, targetY, targetX);
wnoutrefresh(content);
}
return;
}
@ -131,8 +132,8 @@ bool Window::WriteToScreen(IInput* input) {
if (drawPending && !freeze) {
drawPending = false;
update_panels();
doupdate();
DrawCursor(input);
doupdate();
return true;
}
else if (freeze) {

View File

@ -70,6 +70,7 @@ namespace cursespp {
void Minimize();
void Restore();
void NotifyResized();
void Layout();
#ifdef WIN32
static bool Running(const std::string& uniqueId, const std::string& title);