diff options
| author | Unknown <nyamatongwe@gmail.com> | 2013-03-13 09:32:45 +1100 | 
|---|---|---|
| committer | Unknown <nyamatongwe@gmail.com> | 2013-03-13 09:32:45 +1100 | 
| commit | 69d7b3f7588a282eac6e8d917e499396b1414f93 (patch) | |
| tree | 5f17f4c9b58fb050a3c679f32772f79ccbf0b767 /src | |
| parent | 3c07d1254ae04ee172997c1698d511d7af38002e (diff) | |
| download | scintilla-mirror-69d7b3f7588a282eac6e8d917e499396b1414f93.tar.gz | |
Handle test and reset of needUpdateUI in NotifyUpdateUI so less chance of desync.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 25 | ||||
| -rw-r--r-- | src/Editor.h | 2 | 
2 files changed, 13 insertions, 14 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 8ad36ef33..5ce531787 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3467,10 +3467,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {  	int yposScreen = screenLinePaintFirst * vs.lineHeight;  	bool paintAbandonedByStyling = paintState == paintAbandoned; -	if (needUpdateUI) { -		NotifyUpdateUI(); -		needUpdateUI = 0; - +	if (NotifyUpdateUI()) {  		RefreshStyleData();  		RefreshPixMaps(surfaceWindow);  	} @@ -4427,11 +4424,16 @@ void Editor::NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool  	NotifyParent(scn);  } -void Editor::NotifyUpdateUI() { -	SCNotification scn = {0}; -	scn.nmhdr.code = SCN_UPDATEUI; -	scn.updated = needUpdateUI; -	NotifyParent(scn); +bool Editor::NotifyUpdateUI() { +	if (needUpdateUI) { +		SCNotification scn = {0}; +		scn.nmhdr.code = SCN_UPDATEUI; +		scn.updated = needUpdateUI; +		NotifyParent(scn); +		needUpdateUI = 0; +		return true; +	} +	return false;  }  void Editor::NotifyPainted() { @@ -6719,10 +6721,7 @@ void Editor::IdleStyling() {  	// line of the modification to heal instead of propagating to the rest of the window.  	StyleToPositionInView(pdoc->LineStart(pdoc->LineFromPosition(styleNeeded.upTo) + 2)); -	if (needUpdateUI) { -		NotifyUpdateUI(); -		needUpdateUI = 0; -	} +	NotifyUpdateUI();  	styleNeeded.Reset();  } diff --git a/src/Editor.h b/src/Editor.h index 5a32b5aad..553cbeec0 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -452,7 +452,7 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt);  	void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt);  	void NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt); -	void NotifyUpdateUI(); +	bool NotifyUpdateUI();  	void NotifyPainted();  	void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt);  	bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);  | 
