mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +00:00
App-level changes to support correct redrawing while resizing on
Windows.
This commit is contained in:
parent
f3dbca0ad7
commit
64b77d5f7d
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user