Skip to content

Commit

Permalink
1. Продолжение экспериментов:
Browse files Browse the repository at this point in the history
   - вложенные вызовы FCTL_<G|S>ETUSERSCREEN можно.
   - поддержка FCTL_SETUSERSCREEN без предварительного FCTL_GETUSERSCREEN (раньше работало).
  • Loading branch information
alabuzhev committed Jun 29, 2016
1 parent 1191f1d commit c73bc13
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
6 changes: 6 additions & 0 deletions far/changelog
@@ -1,3 +1,9 @@
drkns 29.06.2016 21:51:02 +0200 - build 4730

1. Продолжение экспериментов:
- вложенные вызовы FCTL_<G|S>ETUSERSCREEN можно.
- поддержка FCTL_SETUSERSCREEN без предварительного FCTL_GETUSERSCREEN (раньше работало).

drkns 29.06.2016 09:41:59 +0200 - build 4729

1. 'Защита' от вложенных вызовов FCTL_<G|S>ETUSERSCREEN.
Expand Down
39 changes: 33 additions & 6 deletions far/cmdline.cpp
Expand Up @@ -1442,21 +1442,48 @@ void CommandLine::LockUpdatePanel(bool Mode)

void CommandLine::EnterPluginExecutionContext()
{
if (m_PluginExecutionContext)
return;
if (!m_PluginExecutionContextInvocations)
{
m_PluginExecutionContext = GetExecutionContext();
m_PluginExecutionContext->Activate();
}
else
{
m_PluginExecutionContext->DoEpilogue();
}

m_PluginExecutionContext = GetExecutionContext();
m_PluginExecutionContext->Activate();
m_PluginExecutionContext->DoPrologue();
m_PluginExecutionContext->Consolise();

++m_PluginExecutionContextInvocations;
}

void CommandLine::LeavePluginExecutionContext()
{
if (!m_PluginExecutionContext)
if (m_PluginExecutionContextInvocations)
--m_PluginExecutionContextInvocations;

if (m_PluginExecutionContext)
{
m_PluginExecutionContext->DoEpilogue();
}
else
{
// FCTL_SETUSERSCREEN without corresponding FCTL_GETUSERSCREEN
// Old (1.x) behaviour emulation:
if (Global->Opt->ShowKeyBar)
{
Console().Write(L"\n");
}
Console().Commit();
Global->ScrBuf->FillBuf();
ScrollScreen(1);
Global->CtrlObject->Desktop->TakeSnapshot();
}

if (m_PluginExecutionContextInvocations)
return;

m_PluginExecutionContext->DoEpilogue();
m_PluginExecutionContext.reset();
}

Expand Down
1 change: 1 addition & 0 deletions far/cmdline.hpp
Expand Up @@ -115,6 +115,7 @@ class CommandLine:public SimpleScreenObject
std::stack<string> ppstack;
std::weak_ptr<i_execution_context> m_ExecutionContext;
std::shared_ptr<i_execution_context> m_PluginExecutionContext;
unsigned m_PluginExecutionContextInvocations{};
};

#endif // CMDLINE_HPP_7E68C776_4AA9_4A24_BE9F_7F7FA6D50F30
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4729)m4_dnl
m4_define(BUILD,4730)m4_dnl

0 comments on commit c73bc13

Please sign in to comment.