# HG changeset patch # User Claus Gittinger # Date 1402748877 -7200 # Node ID f314814a3105ea11413e6142d4064ebc68fa8c32 # Parent c27be735c63a21b4f383e681042a5c3b9142cc26 do not show help for inactive (background) views. diff -r c27be735c63a -r f314814a3105 ActiveHelp.st --- a/ActiveHelp.st Sat Jun 14 11:14:50 2014 +0200 +++ b/ActiveHelp.st Sat Jun 14 14:27:57 2014 +0200 @@ -260,7 +260,17 @@ isActive "return true, if activeHelp is turned on" - ^ TheOneAndOnlyHelpListener notNil + TheOneAndOnlyHelpListener notNil ifTrue:[ + ((WindowSensor eventListeners ? #()) includesIdentical:TheOneAndOnlyHelpListener) ifTrue:[ + ^ true + ]. + TheOneAndOnlyHelpListener := nil. + ]. + ^ false. + + " + FlyByHelp isActive + " "Modified: 27.4.1996 / 15:07:57 / cg" ! @@ -561,7 +571,7 @@ ^ self ]. (self interestedIn:aView) ifFalse:[ - Debugging ifTrue:['not interested' infoPrintCR]. + Debugging ifTrue:['not interested 0' infoPrintCR]. ^ self ]. @@ -606,14 +616,33 @@ "return true, if I am interested in aView (either listeningForAll, or in my list of apps)" - |app aViewsTopView| + |app aViewsTopView device deviceFocusView| + + aView isNil ifTrue:[ + Debugging ifTrue:['nil view' infoPrintCR]. + ^ false + ]. + +"/ applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[ +"/ Debugging ifTrue:['no apps' infoPrintCR]. +"/ ^ false +"/ ]. - aView isNil ifTrue:[^ false]. + aViewsTopView := aView topView. + + "/ if none of the view's components has focus... + (device := aViewsTopView graphicsDevice) notNil ifTrue:[ + (deviceFocusView := device focusView) notNil ifTrue:[ + deviceFocusView topView ~~ aViewsTopView ifTrue:[ + "/ 'for inactive ' infoPrint. aView infoPrintCR. + Debugging ifTrue:['inactive topView' infoPrintCR]. + ^ false + ]. + ]. + ]. listeningForAll == true ifTrue:[^ true]. - applicationsOrTopViewsWithHelp isEmptyOrNil ifTrue:[^ false]. - aViewsTopView := aView topView. (applicationsOrTopViewsWithHelp includesIdentical:aViewsTopView) ifTrue:[^ true]. app := aViewsTopView application. app notNil ifTrue:[ @@ -777,7 +806,7 @@ !ActiveHelp class methodsFor:'documentation'! version_CVS - ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.78 2014-05-16 07:49:59 cg Exp $' + ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.79 2014-06-14 12:27:57 cg Exp $' ! !