Skip to content

Commit

Permalink
FCTL_<G|S>ETUSERSCREEN nested call protection and few minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Jun 29, 2016
1 parent 47a84a1 commit 1191f1d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
6 changes: 6 additions & 0 deletions far/changelog
@@ -1,3 +1,9 @@
drkns 29.06.2016 09:41:59 +0200 - build 4729

1. 'Защита' от вложенных вызовов FCTL_<G|S>ETUSERSCREEN.

2. Пара мелочей.

drkns 27.06.2016 22:43:25 +0200 - build 4728

1. Продолжение экспериментальных изменений в запускателе.
Expand Down
8 changes: 7 additions & 1 deletion far/cmdline.cpp
Expand Up @@ -972,7 +972,7 @@ class execution_context: noncopyable, public i_execution_context

Global->WindowManager->SubmergeWindow(Global->CtrlObject->Desktop);
Global->WindowManager->ActivateWindow(m_CurrentWindow);
Global->WindowManager->ResizeAllWindows();
Global->WindowManager->PluginCommit();
--Global->SuppressClock;
}

Expand Down Expand Up @@ -1442,6 +1442,9 @@ void CommandLine::LockUpdatePanel(bool Mode)

void CommandLine::EnterPluginExecutionContext()
{
if (m_PluginExecutionContext)
return;

m_PluginExecutionContext = GetExecutionContext();
m_PluginExecutionContext->Activate();
m_PluginExecutionContext->DoPrologue();
Expand All @@ -1450,6 +1453,9 @@ void CommandLine::EnterPluginExecutionContext()

void CommandLine::LeavePluginExecutionContext()
{
if (!m_PluginExecutionContext)
return;

m_PluginExecutionContext->DoEpilogue();
m_PluginExecutionContext.reset();
}
Expand Down
6 changes: 3 additions & 3 deletions far/common/preprocessor.hpp
Expand Up @@ -96,12 +96,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Type(const Type&) = delete; \
Type& operator=(const Type&) = delete; \

#define COPY_AND_SWAP(...) \
auto& operator=(__VA_ARGS__ rhs) { std::remove_reference_t<decltype(*this)> Tmp(rhs); using std::swap; swap(*this, Tmp); return *this; }
#define COPY_AND_MOVE(...) \
auto& operator=(__VA_ARGS__ rhs) { std::remove_reference_t<decltype(*this)> Tmp(rhs); *this = std::move(Tmp); return *this; }

#define TRIVIALLY_COPYABLE(Type) \
Type(const Type&) = default; \
COPY_AND_SWAP(const Type&)
COPY_AND_MOVE(const Type&)

#define TRIVIALLY_MOVABLE(Type) \
Type(Type&&) = default; \
Expand Down
3 changes: 1 addition & 2 deletions far/delete.cpp
Expand Up @@ -404,8 +404,7 @@ ShellDelete::ShellDelete(panel_ptr SrcPanel, bool Wipe):
bool bHilite = Global->Opt->DelOpt.HighlightSelected;
int mshow = std::min(std::max((int)Global->Opt->DelOpt.ShowSelected, 1), ScrY/2);

std::vector<string> items;
items.emplace_back(strDeleteFilesMsg);
std::vector<string> items{ strDeleteFilesMsg };

if (SelCount == 1)
{
Expand Down
10 changes: 5 additions & 5 deletions far/tvar.hpp
Expand Up @@ -65,11 +65,11 @@ class TVar
explicit TVar(const wchar_t*);
explicit TVar(double);

COPY_AND_SWAP(long long);
COPY_AND_SWAP(const string&);
COPY_AND_SWAP(const wchar_t*);
COPY_AND_SWAP(int);
COPY_AND_SWAP(double);
COPY_AND_MOVE(long long);
COPY_AND_MOVE(const string&);
COPY_AND_MOVE(const wchar_t*);
COPY_AND_MOVE(int);
COPY_AND_MOVE(double);


TVar& operator+=(const TVar& b) { return *this = *this + b; }
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4728)m4_dnl
m4_define(BUILD,4729)m4_dnl

0 comments on commit 1191f1d

Please sign in to comment.