Skip to content

Commit d9b1161

Browse files
committed
WIP (11)
1 parent 355f9d4 commit d9b1161

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/WinWebDiff/WinWebDiff.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
607607
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_INPUT));
608608
UpdateMenuState(m_hWnd);
609609
break;
610+
case IDM_SYNC_GOBACKFORWARD:
611+
m_pWebDiffWindow->SetSyncEventFlag(IWebDiffWindow::EVENT_GOBACKFORWARD,
612+
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_GOBACKFORWARD));
613+
UpdateMenuState(m_hWnd);
614+
break;
610615
case IDM_CLEAR_DISK_CACHE:
611616
m_pWebDiffWindow->ClearBrowsingData(-1, IWebDiffWindow::BrowsingDataType::DISK_CACHE);
612617
break;

src/WinWebDiffLib/WebDiffWindow.hpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,20 +325,26 @@ class CWebDiffWindow : public IWebDiffWindow
325325
}
326326
else if (event == WebDiffEvent::GoBacked)
327327
{
328-
for (int pane = 0; pane < m_nPanes; ++pane)
328+
if (m_bSynchronizeEvents && GetSyncEventFlag(EVENT_GOBACKFORWARD))
329329
{
330-
if (ev.pane == pane)
331-
continue;
332-
m_webWindow[pane].GoBack();
330+
for (int pane = 0; pane < m_nPanes; ++pane)
331+
{
332+
if (ev.pane == pane)
333+
continue;
334+
m_webWindow[pane].GoBack();
335+
}
333336
}
334337
}
335338
else if (event == WebDiffEvent::GoForwarded)
336339
{
337-
for (int pane = 0; pane < m_nPanes; ++pane)
340+
if (m_bSynchronizeEvents && GetSyncEventFlag(EVENT_GOBACKFORWARD))
338341
{
339-
if (ev.pane == pane)
340-
continue;
341-
m_webWindow[pane].GoForward();
342+
for (int pane = 0; pane < m_nPanes; ++pane)
343+
{
344+
if (ev.pane == pane)
345+
continue;
346+
m_webWindow[pane].GoForward();
347+
}
342348
}
343349
}
344350
else if (event == WebDiffEvent::WebMessageReceived || event == WebDiffEvent::FrameWebMessageReceived)

0 commit comments

Comments
 (0)