Closed Bug 1258152 Opened 8 years ago Closed 7 years ago

Thunderbird main window pops up while typing email causing compose window to lose focus, when MS-Windows-10 is running slideshow and 3-pane window was minimized/maximized once [win10]

Categories

(Thunderbird :: Message Compose Window, defect)

38 Branch
Unspecified
Windows 10
defect
Not set
normal

Tracking

(thunderbird_esr45+ affected)

RESOLVED DUPLICATE of bug 1234317
Tracking Status
thunderbird_esr45 + affected

People

(Reporter: akomachi, Unassigned)

References

()

Details

User Story

A possible workaround of this bug while you are composing mail.
  Minimize at least Messenger window(s) of Thunderbird,
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160210153822

Steps to reproduce:

I had the email program open so I could respond to an email with a new email window open...typing along and ....


Actual results:

the open program window popped up in front of my typing. I thought maybe I had hit something that caused this by accident so I brought the email I was working on to the front again and once again the program popped up in front of my typing. In one very small paragraph it happened five times. Finally I minimized the program and it stopped doing it but it makes it difficult to refer to an email that was sent to you while you are replying.


Expected results:

What I wanted or expected to happen was it not pop up at all while I was attempting to write an email. I know I'm not the only one experiencing this I have at least two other friends going through this also but I doubt that they will write and complain about it. Thank you so much for your concern and help.
OS: Unspecified → Windows 10
Just observed ....the open Thunderbird program pops up when the slideshow background picture changes on my desk top Win10. it has been set this way since I've installed Win10 a couple of weeks ago but this has just started happening in the past few days.
See Also: → 942610
Summary: email program pops up while typing email → email program pops up while typing email causing compose window to lose focus [win10]
Component: Untriaged → Message Compose Window
Depends on: 1234317
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to June from comment #1)
> Just observed ....the open Thunderbird program pops up when the slideshow
> background picture changes on my desk top Win10. it has been set this way
> since I've installed Win10 a couple of weeks ago but this has just started
> happening in the past few days.

This is my experience also. I had a similar slideshow on Windows 7 without issue. However after upgrading to Windows 10 the slideshow grabs focus for an instant and when it returns focus it's to the main Thunderbird window rather than the email I'm typing.
Summary: email program pops up while typing email causing compose window to lose focus [win10] → email program pops up while typing email causing compose window to lose focus with Windows slideshow [win10]
Wayne's summary above is what's been happening to me on win10 at irregular intervals.  I'm using exquilla to read/send my corporate exchange email, will try testing without it and see if the problem still occurs.  I've been updating 942610, but if this is the win10 specific bug, I'll update here.
Doing a bit of troubleshooting to try an narrow this down:
Turned of exquilla - i.e. removed exquilla account and disabled the extension - did not remove it.  Changed my exchange access to Imap.

I just experienced 2 focus shifts.  The first while writing an email on my corporate account, the second while writing this one.  The second may have happened NOT on a key press, but not sure.

The first appeared to happen as I was typing a capital letter.  I wonder if my fingers are slipping and I'm hitting control or the windows key with my character?  A quick test seems to show that a short stroke on the windows key moved focus to the main Thunderbird window, but it's not readily reproducible.

I looked at the windows keyboard shortcut list: https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts
but none of these appear directly applicable.

Net result - it's probably NOT exquilla.  I'll have to do keystroke capture (any tool ideas?)to make much progress.
I've started working backwards to see if I can find a release where the focus change issue doesn't happen on windows 10.  First stop was 38.3 - and I got a focus jump on the first email I wrote!  I'm beginning to suspect that it may have more to do with the way Thunderbird is built - against (I think), win 7 rather than win 10.  I really don't remember this happening on win 7.
Latest update, what I know so far:

1. exquilla isn't a factor - happens without it.
2. I've gone back to 38.4 and 31.4, and have had at least one focus steal event on each.
3. It's not easily reproducible - when I think I have a key stroke combination that triggered it, and try again, it doesn't happen.
4. I thought I found a possible win 10 issue:

http://answers.microsoft.com/en-us/windows/forum/windows_vista-performance/my-cursor-jumps-while-typing/9de98945-525a-45fe-a74c-741fb42d2069
but I've done what's suggested there (change mouse setting to not Hide pointer while typing) and it seems to have no effect.

Next stop - 24.8.1

Gut feel - something is different between win 7 and 10 that affects this.  Is it possible to build a "true" win 10 build rather than one based on win 7?
The problem just happened in 24.8.1  I don't think there's much point in going back further.  I'm getting more and more convinced that this is a problem of how Thunderbird deals with (in this case) win 10.  I know there have been reports, notably in 942610 that the same thing happens in linux, but it's reasonably clear to me that this wasn't much of an issue in win 7 and it's a big one (at least for me) in win 10.
BTW, just for completeness - I'm running 64bit Windows 10.
BTW, just for completeness - I'm running 64bit Windows 10 Enterprise (now fully complete)
Back to most current - 45.1.1, updated my various drivers/bios to latest and greatest per Lenovo (this is a Lenovo laptop), unfortunately, still failing.  Running out of ideas of things to try and still don't have a specific key sequence that triggers the focus shift to the main Thunderbird window.
1 more tidbit, although it may be a coincidence.  I was watching a video about the "Keep Calm and Carry On" poster (https://www.youtube.com/watch?v=FrHkKXFRbCI) and an email came in - I noted the usual Thunderbird popup, and then the Thunderbird main window popped up over Firefox.  We may be thinking about this issue wrong - it may not be a focus steal as much as the main window popping forward for some reason.
awaiting more info from the win10 user at http://forums.mozillazine.org/viewtopic.php?p=14613665 who is unable to reproduce in Thunderbird safe mode
User here https://support.mozilla.org/en-US/questions/1129602

Confirms that he is unable to reproduce it in windows 10 if he is in safe mode or if the windows is not full screen.
Summary: email program pops up while typing email causing compose window to lose focus with Windows slideshow [win10] → Thunderbird main window pops up while typing email causing compose window to lose focus, when MS-Windows is running slideshow and 3-pane window is not maximized [win10]
It's hard to be sure, but I think I've just seen thunderbird in windows 10 steal focus not just from it's own email compose window, but from other things, e.g. Word.  Reading over the mozillazine references above, to answer the questions - I'm never in full screen mode, and not using hardware acceleration.  I'm going to try turning it on just to see if things get worse or better.  My guess is that there's some event in thunderbird, e.g. a refresh from the mail server, that's attempts to pop the thunderbird window to the top - but it's not every time.
ok, quick experiment showed that turning on hw acceleration made things far worse, i.e. far more frequent - within 5-15 keystrokes in the compose window, the main window popped to the top.
In Windows 10 (latest update), when composing an email, very often the main window takes over and message text gets interpreted as commands. This has been happening for months. Let me know what more you'd like to know about my configuration and how I can obtain that info for you. I am running Thunderbird: 45.2.0.
I am not running slideshow.
Hello.. Also having the same problem, although for me, this only seemed to start on the last beta update.. never happened before, don't use slideshow, and nothing else has changed on my win 10 64 pro system  

But whatever it is, has no visible logic.  I can watch the screen as I type, I'm not hitting weird characters etc, it is simply poof.. focus is back on the main tbird window.  it's not a 'huge' deal, but it's a pain in the butt, its also rare enough i might not have it happen for 1 day, or 10 emails or nothing to make sense of it.  other times, it'll do it 2-3 times in the same email.

not sure i've ever noticed it flip focus when i'm not typing so maybe thats a clue. i've left test emails open, not type anything and nothing happens..

Didn't go back one ver, because people have written it's done it on other versions so it' likely something else . in windows?

one thing i just saw while here, was email picky 4.. clicking it sends you to the main window.. wonder if a new message triggers it and bounces.. will experiment and let everyone know.

Roc
Hello.. Also having the same problem, although for me, this only seemed to start on the last beta update.. never happened before, don't use slideshow, and nothing else has changed on my win 10 64 pro system  

But whatever it is, has no visible logic.  I can watch the screen as I type, I'm not hitting weird characters etc, it is simply poof.. focus is back on the main tbird window.  it's not a 'huge' deal, but it's a pain in the butt, its also rare enough i might not have it happen for 1 day, or 10 emails or nothing to make sense of it.  other times, it'll do it 2-3 times in the same email.

not sure i've ever noticed it flip focus when i'm not typing so maybe thats a clue. i've left test emails open, not type anything and nothing happens..

Didn't go back one ver, because people have written it's done it on other versions so it' likely something else . in windows?

one thing i just saw while here, was email picky 4.. clicking it sends you to the main window.. wonder if a new message triggers it and bounces.. will experiment and let everyone know.

Roc
With the STR here, I enabled a slideshow switch every 2 minutes, and now I have experienced the symptoms of this bug at least three times. Which is good news, as I have never seen it before.

Now I'd like to get some sort of stack trace when this occurs. I think that I can do that be writing a small addon to add a listener to the main window when it regains focus, and see if I can get some information on the steps that are leading to the focus change.

DOM events are not my strong point, so if anyone has a better idea on how to get a trace, please suggest it.
45.3.0, Windows 10

Same problem. I've seen the comments about the slideshow previously, so I've set that to update only once a day to minimize the problem of Thunderbird's main window coming to the front. However, I have found that other things seem to trigger it as well.

I'm using PhraseExpress - http://www.phraseexpress.com/

If I type a misspelling or other phrase while composing email, it seems to want to bring the main window to the foreground. I'm not sure if the auto-correct is bringing it to the foreground, or if it's related to the notification on the task bar that says that the auto-correct is being applied.
Mark,

If you can get reproducible steps to reproduce this issue with phraseexpress, please report that in detail. It is very rare that I see the issue, and a clear STR is critical to fixing this.
I have this same problem, and i have nothing to attribute it to.  No slideshow, nothing.  I can be typing an email and it will simply pop up the main window.  Nothing makes sense.  it only recently started doing this, within the last 2 updates.  (I use beta updates.)P
With my Windows 10 background slideshow set to change every minute, I started seeing this today. Once it started happening, it happened reliably every minute. Upon restart of Thunderbird, it stopped happening.

I have a simple event logger showing the JS stack at the focus shift. The logger reliably fired every minute showing focus switch back to the main window while I was typing in a compose window. The logger showed nothing in the JS stack except for the focus event listener, so the event is coming from the C++ backend.

My current theory is that something in the backend must hold a list of open windows with their displayed z level, but somehow gets lost. Maybe Thunderbird is doing something odd in opening windows to exacerbate that.

I of course have no idea how focus gets propagated back to windows in the backend, but that is what we are going to have to understand. Current theory is that we need two things: 1) a source of focus change events (like the slideshow), and 2) the messed up window list that refocuses an incorrect window. I'll probably have to run with a C++ debugger to try to capture the sequence of events that lead to the focus event firing on a msgWindow unless somebody has some knowledge of the how the backend does that.
Started occurring today late in the day. What is different is that I am not in Compose, but rather have a message opened in a separate window. That seems to imply this is not about compose.
I'll complicate this.. today, i wasn't even in Tbird... and while i was doing stuff in another programs window, thunderbird appeared in front of it. typing, not odd commands, nothing.. whatever this is, it seems to me that it's something triggering a bring to front command within thunderbird and maybe it's something in win10 causing this..

suspect it'll be a challenge to find!
Not that I really doubted it, but I've seen enough of this now to know that it is a serious issue, and happens frequently enough that there is a chance it could be debugged. I'm trying to run with the debug enabled now on an esr45 release build with appropriate diagnostics added to an extension. A couple of days ago I did manage to capture the problem, and could see the full C++ stack starting from an event received in nsFocusManager.cpp. Unfortunately that code is completely unknown to me, and figuring out what is normal and abnormal behavior there is going to take some effort.

It does not make sense that a focus event is sent to Thunderbird by the OS when the background image is changed, but that seems to be the case. That may be a bug or misfeature in Windows 10. But somehow the focus manager is misinterpreting that event, and focusing the wrong windows. That at least should be under our control and fixable.
 (In reply to Kent James (:rkent) from comment #30)

> It does not make sense that a focus event is sent to Thunderbird by the OS
> when the background image is changed, but that seems to be the case. 

...and it's not just the background change by the OS. It also happens to me very frequently when notifications pop up from the notification area. In particular from my text expansion program (Phrase Express) which is most active when I'm typing an email, unfortunately. I don't think Phrase Express is forcing the focus change. For certain things it simply asks windows to provide a notification and I think in Windows 10, it's triggering an event similarl to what the background change is doing.
I don't use slideshow or Phrase Express but I still have this problem. It has nothing to do with the background image in my case. Something is changing focus to the main window, perhaps something triggered by the compose window like spellcheck.
Another piece of data: I am seeing similar behavior in Firefox. In this case, I grabbed a tab and moved it to a new window, keeping the focus in the new window (using keyboard to scroll a window). When the slideshow switches, the focus is moved back to the original window, and keyboard actions scroll the tab there rather than the tab I am actually looking at. (Or to put it another way, if the child window is covering the original window, after a slideshow switch the original window pops on top, covering the child window).

This is clearly a core problem but not well recognized there. The cleanest path to get this fixed is to figure out how to get Firefox to reliably reproduce the issue, then get the FF folks to try to figure it out.

Scott, Mark: I don't believe that you need slideshow, it is just a convenient way to cause Windows 10 to misbehave every minute for debugging purposes.

At the moment, the issue is occurring reliably in Firefox 49.0.1  At the same time, my Thunderbird 45.3.0 is not showing the issue. I'm going to restart Firefox, and if it follows the TB pattern, the problem will be gone after restart.
Yep, after restart of Firefox problem no longer appears. Just like Thunderbird.
My Firefox again today is in showing this issue, so I'm going to file a bug there.
Blocks: 1306773
See https://bugzilla.mozilla.org/show_bug.cgi?id=1306773#c2 for a suggested workaround which so far is working for me.
(In reply to Kent James (:rkent) from comment #36)
> See https://bugzilla.mozilla.org/show_bug.cgi?id=1306773#c2 for a suggested
> workaround which so far is working for me.

This helps those of us who run slideshow. Doesn't work around focus problems in the compose window.
I think it is fair to say this bug will not progress at all until the Firefox bug 1234317 in the core code is first resolved.  Fixing that Bug may well fix the issue in Thunderbird as well.
@Scott Read, I assume you are referring to Bug 942610
> Bug Summary : 
> (A) Thunderbird main window pops up while typing email causing compose window to lose focus,
> (B) when MS-Windows is running slideshow and 3-pane window is not maximized [win10] 

Questions on (B).
(Q1) Newly installed Win 10? Or Upgrade from Win 7/Win 8.1?
(Q2) If upgrade to Win 10, SlideShow of which photo program?
 - Windows Photo Viewer from Win 7/Win 8.1 which cannot be installed on Windows 10.
 - Photo for Windows 10.
 Please read following document.
 https://support.microsoft.com/en-us/instantanswers/57895b6f-8f0c-b30e-09fc-fd6382333261/photo-viewer-for-windows-10
   Photo viewer for Windows 10
(Q3) Does problem occur with SlideShow of Photo for Windows 10?
Wada, my case is Windows 10 upgraded from some previous version, probably Windows 8.1

The steps to enable for me are: Right click on background of main display, then select Personalize. I end up with a Personalization page, with the Background item selected. Within that, there is an option dropdown "Background" which has options Solid Color, Picture, or Slideshow. There I select Slideshow, add a folder with a variety of pictures, and set "Change picture every" to 1 minute. Shuffle ON, allow on battery Off, choose a fit Stretch.

But I have had no incidences of this since if did the workaround from comment 36.
(In reply to Kent James (:rkent) from comment #40)
> The steps to enable for me are: Right click on background of main display,
> then select Personalize. I end up with a Personalization page, with the
> Background item selected. Within that, there is an option dropdown
> "Background" which has options Solid Color, Picture, or Slideshow. There I
> select Slideshow, add a folder with a variety of pictures, and set "Change
> picture every" to 1 minute. Shuffle ON, allow on battery Off, choose a fit Stretch.

Aha. It's "desktop wallpaper slideshow" for me, and "desktop background slideshow".in Win 10.
http://www.windowscentral.com/enable-windows10-slideshow-and-battery
Thanks for detailed explanation for me.

> But I have had no incidences of this since if did the workaround from comment 36.

Bug 1306773 Comment #2 :
> Temporary fix until it gets fixed is to right-click on desktop > Personalize > Colors
>   > Uncheck "Automatically pick an accent color from my background".

How to reproduce this bug with "desktop background slideshow".on Win 10.
> Personalization of Desktop
> (a) Background(wallpaper in old win) : Slideshow, with short interval
> (b) Check "Automatically pick an accent color from my background".
Workaround when "Background: Slideshow" is enabled.
> (c) Uncheck "Automatically pick an accent color from my background".

> Wada, my case is Windows 10 upgraded from some previous version, probably Windows 8.1

I currently use Win10 pre-installed HP Pavillion(newly/cleanly installed Japanese Windows 10)..
I cannot observe this bug's phenomenon with ;
 Abpve (a) and (b). Used photo in directory is ".jpg" files only.
 Thunderbird recent nightly builds.
  (Newly created profile with 4 imap acounts defined)
  (Only Lightning is pre-installed, but is Disabled)
  (Not default mailer on Win)

Win's Photo/Slideshow relivant software may be utilized for "desktop background slideshow".on Win 10.
Can you check with "official Photo App for Win10" instead of "inherited Photo Viewer from Win8.1 or Win7"?

Following is a forum topic for phenomenon of "Active Window Does Not Come to the Top from Taskbar or When Clicked".
 http://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/active-window-does-not-come-to-the-top-from/6fdba85c-a8d3-4029-969a-58f19646249f?page=1
In this tooic, "ForegroundFlashCount=7 instead of default(3)" case is referred.
 ForegroundFlashCount
 http://technet.microsoft.com/en-us/library/cc957205.aspx
Do you see such funny value in ForegroundFlashCount of windows registry key?
FYI.

Reported similar phenomena in the past.
(A) 2008-10-16 Bug 460238 Ubuntu/8.04 Thunderbird 2.0.0.17
(Case-1) Bug 460238 Comment #0 :
>  Window layers : Composer->Messenger(3pane Tb window)
>  -> Certificate popup notification on POP3 connection by Thunmderbird himself
>  -> After it, Window layers display : Composer->Messenger
>     However, Keyboard events is sent to Messenger == Keyboard Focus is moved to Messenger
(B) 2013-11-24 Bug 942610
(Case-2) Bug 942610 Comment #0 : Linux x86_64 Thunderbird Build ID: 20131030131730
>  Window layers : Composer->Messenger
>  -> While composing a mail, after an undefined amount of time, by unknown reason,
>     Composer window suddeny looses "Cursor blink at input area". 
>     Window layers display : still Composer->Messenger
>     However, Keyboard events is sent to Messenger == Keyboard Focus is moved to Messenger
(Case-3) Bug 942610 Comment #2 : Windows 8.1 Thunderbird 24.3.0 (from Bug 957305)
>  Window layers : Composer->Messenger
>  -> New mail alert for new mail notification by Thunderbird(toaster popup at right bottom of Desktop) 
>  -> After it, Window layers display : Composer->Messenger
>     However, Keyboard events is sent to Messenger == Keyboard Focus is moved to Messenger
(Case-4) Bug 942610 Comment #3 : Debian 7.2 Thunderbird 24.4.0
>  Window layers : Composer->Messenger
>  -> What happened is unknown.
>     However, following is known by "quickly repeated CTRL+N at composer window".
>     CTRL+N was executed at Messenger Window.
>     ==  Keyboard events is sent to Messenger == Keyboard Focus is moved to Messenger
>  -> So, after problem happened, Window layers display was probably Composer->Messenger
(Case-5) Bug 942610 Comment #4 : Windows 7 professional 64-bit Thunderbird 24.4.0
>  Window layers : Composer->Messenger
>  Reported phenomenon is :
>    Keyboard events is sent to Messenger == Keyboard Focus is moved to Messenger
In order to find way to force "popup by Thnderbird while composing", some peoples repeated trial&error.

It looks for me that "biggest difference between Win7/8.1 and Win10" is :
- Win7/Win8.1 : Messenger window(which got Keyboard Focus) is not always displayed as Foreground/Active Window.
- Win10      :  Messenger window(which got Keyboard Focus) is always displayed as Foreground/Active Window.

Case-1 looks for me similar phenomenon to "Background:slideshow on Win 10" case.
Case-2/3/4/5 looks for me similar phenomenon to "Phrase Express on Win 10" case stated in Comment #31.
Difference seems : Messenger Window is always(correctly?) displayed as Foreground/Active Window after getting Keyboard Focus on Win 10.

Please note that Active Window, Foreground Window, Keyboard Focus, Cursor Blink, are independent attribute,
although Keyboard Focus/Cursor Blink is usually set to a Window when the Window is changed to Active Window && Foreground Window.
And, if Messenger Window properly got Keyboard Focus/Active state/Foreground state by(or after) unknown event(s) on Win10, current "Messenger Window is Foreground/Active Window and has Keyboard Focus" is correct display of Thunderbird window by Win10.
Please note that the unknown event may be "mouse click event which is generated using CreateEvent by Thunderbird component or addon", and that it is never Win only phenomenon/it can occur on Linux too.
Please note that "Focus change in Messenger Window" may alter Keyboard Focus/Active Window state/Foreground Window state of Messenger Window.
In such case, what is "CORRECT/VALID/PROPER order of Thunderbird windows display after event(s)"?
"User's intentional click at Messenger Window" should be only way to make Messenger "Foreground/Active Window"?
Problem in such case is : It's far from user's expectation who is composing mail using Composer of Thunderbird.
Following was already confirmed on 2015-08-31 by Bug 942610 Comment #43.
(0) EventListener of focus event at Composer Window is enabled(event data is written to Error Console) 
     EventListener of focus event at Messenger Window is enabled(event data is written to Error Console) 
(1) focus event at Compose Window occurred, and it is logged to Error Console by .EventListener .
(2) "Toaster popup to notify something by Thunderbird" was shown. Unable to hook event easily by EventListener.
(3) focus event at Messenger Window occured, and it is logged to Error Console by .EventListener 
    i.e. focus is removed from Composer Window, and focus is moved to Messenger Window.

And, NSPR log with NSPR_LOG_MODULES=timestamp,WidgetFocus:5,Focus:5 was requested on 2016-10-03 by Bug 942610 Comment #101.
Log data for it was pasted to Bug 942610 Comment #105 on 2016-10-14 and Bug 942610 Comment #106.on 2016-10-14.
No one is successful to decypher the pasted log data yet.

If problem is easily reproduced on Win10 in many user's environment, please grt NSPR log with NSPR_LOG_MODULES=WidgetFocus:5,Focus:5,timestamp first, and please check which element's focus event is trigger of Keyboard Focus switch from Composer Window to Messenger Window.
 
  

Following was already confirmed on 2015-08-31 by Bug 942610 Comment #43.
(1) EventListener of focus event at Composer Window(event data is written to Error Console) 
    focus event at Compose Window occurred.
(2) "Toaster popup to notify something by Thunderbird" is shown. Unable to hook event easily by EventListener.
(3) EventListener of focus event at Messenger Window(event data is written to Error Console) 
    focus event at Messenger Window occured.
(In reply to WADA from comment #41)
> (In reply to Kent James (:rkent) from comment #40)
> Win's Photo/Slideshow relivant software may be utilized for "desktop
> background slideshow".on Win 10.
> Can you check with "official Photo App for Win10" instead of "inherited
> Photo Viewer from Win8.1 or Win7"?
> 

I don't see that choice, how do I make it?

> Following is a forum topic for phenomenon of "Active Window Does Not Come to
> the Top from Taskbar or When Clicked".
>  http://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/
> active-window-does-not-come-to-the-top-from/6fdba85c-a8d3-4029-969a-
> 58f19646249f?page=1
> In this tooic, "ForegroundFlashCount=7 instead of default(3)" case is
> referred.
>  ForegroundFlashCount
>  http://technet.microsoft.com/en-us/library/cc957205.aspx
> Do you see such funny value in ForegroundFlashCount of windows registry key?

ForegroundFlashCount=7 is indeed what I see.
(In reply to Kent James (:rkent) from comment #40)
> The steps to enable for me are:  (snip)

Quick summary of STR and workaound provided by you on Win10.
How to reproduce this bug with "desktop background slideshow".on Win 10.
> Personalization of Desktop
> (a) Background(wallpaper in old win) : Slideshow, with short interval
> (b) Check "Automatically pick an accent color from my background".
Workaround when "Background: Slideshow" is enabled on Win10.
> (c) Uncheck "Automatically pick an accent color from my background".

I read Bug 1234317, and I could observe phenomenon of Bug 1234317 several times with non-latest Firefox release, but I couldn't always observe the phenomenon.
After it, I could observe the phenomenon of Bug 1234317 with Thunderbird 45.4.0 several times, but it was "not always" too in Thunderbird as "not always" in Firefox.
  Open 3 Thunderbird messenger windows : Messenger-1, Messenger-2, Messenger-3.
  After some operations, Thunderbird's window order was : Messenger-3(Foreground/Active) -> Messenger-2 -> Messenger-1 
  When Desktop background image was chsanged by Win10's slideshow, Messenger-1 was changed to Foreground/Active.
  By click of Messenger-3 after it, Messenger-3 was changed to Foreground/Active again.
  However,  when Desktop background image was chsanged by Win10's slideshow again,
  Messenger-1(sometimes, it was Messenger-2) was changed to Foreground/Active.
  This repeated consistently, as far as phenomenon occurred by these operations..

I could see such phenomenon with both Firefox and Thunderbird several timers, but I couldn't consistently observe the phenomenon.
Why "not always"?
I read  Bug 1234317 again, and found a step of "minimize windows once, and show the windows again" in a comment.
So I modified my test procedure.
> (1) Open 3 Thunderbird messenger windows : Messenger-1, Messenger-2, Messenger-3.
>     Thunderbird's window order : Messenger-3(Foreground/Active) -> Messenger-2 -> Messenger-1 
> (2) Minimize the Thunderbird messenger windows.
> (3) From Task Bar(or Task View), re-open Messenger-1, Messenger-2, Messenger-3. in this order.
>     Thunderbird's window order : Messenger-3(Foreground/Active) -> Messenger-2 -> Messenger-1 
Bingo!
Phenomenon after it was:
> (4) Desktop background slideshow changes background image and accent color.
> (4-A) Desktop background slideshow runs -> Messenger-1 is changed to Foreground/Active.
>       Click Messenger-3 -> Messenger-3 is Foreground/Active.
>       Order of Tb's windows : Messenger-3(Foreground/Active) -> Messenger-1 -> Messenger-2.
> (4-B) Desktop background slideshow runs -> Messenger-2 is changed to Foreground/Active.
>       Click Messenger-3 -> Messenger-3 is Foreground/Active.
>       Order of Tb's windows : Messenger-3(Foreground/Active) -> Messenger-2 -> Messenger-1.
> (5) (4-A) + (4-B) repeats.
If window is minimized, the window keeps the "Minimized state".
> (6) If Messenger-1 is minimized, Messenger-1 doesn't join in the game,
>     so Messenger-1 never gets Foreground/Active state nor Keyboard Focus.
Above was consistently observed with both Thunderbird 45.4.0 and latest Thunderbird nightly build.

Due to accent color change(it's used at window title of each window), event is perhaps dispatched at each Thunderbird window.
It looks for me:
> (a) Win10 :
>     order of event dispatch = based on current window order.
>     => Last dispatched Thunderbird window gets Keyboard Focus
>     => The last dispatched Thunderbird window.always gets Foreground/Active state.
> (b) Win7/8.1:
>     order of event dispatch may be : based on order of window creation.
>     => Last dispatched Thunderbird window gets Keyboard Fucus
>     => The last dispatched Thunderbird window.not always gets Foreground/Active state.

A possible workaround while mail composing :
  Minimize Messenger Window if you want to keep Composer Window.open.

By the way, please distinguish (a) "who/how invokes an event at Thunderbird windows" and (b) "Thunderbird behaviour by the event dispatch",
"Desktop background slideshow" case can be worked around by "Disabling accent color with slideshow" in (a) only.
"Disabling add-on" is also a workaround in (a) only, if the add-on is cause of the unwanted event in Thunderbird.
However, "Toaster popup by Thunderbird" case(major phenomenon of Bug 942610) can not be resolved unless problem(s) in (b) is correctly resolved, even if "minimize Messenger" can be a effective workaround of problem..

I believe that proper solution is :
  if order of Tb windows is so important in Tb and/or Tb users,
  Tb should always keep the Tb windows order(z-index?) upon any event in Tb window,
  except when "explicit window order switch request by user" such as "mouse click at a Tb window".
I believe that main culprit is never "who invokes an event at Thunderbird windows".
This is applicable to Firefox too.
(In reply to Kent James (:rkent) from comment #44)
> > Do you see such funny value in ForegroundFlashCount of windows registry key?
> ForegroundFlashCount=7 is indeed what I see.

According to referred document, it's known as a cause of "Active Window Does Not Come to the Top from Taskbar or When Clicked". 
I recommend you to reset to default(=3) in order to avoid unwanted/useless problems, even if it's absolutely irrelevant to this bug's problem.

> > Can you check with "official Photo App for Win10" instead of "inherited Photo Viewer from Win8.1 or Win7"?
> I don't see that choice, how do I make it?

According to referred document, it seems that program name is different in "Open with program" context menu of an image file.
In my newly installed Win10, it's "フォト"(Japanese word for "Photo").
It may be "Photo Viewer" if Photo Viewer from Win8.1 or Win7.
Note: 
This was irrelevant to this bug's problem. I now can consistently observe problem by your STR with Desktop background slideshow.
FYI.

Following STR of this bug was "automatic/repeated accent color change" version of "manual accent color change" in Bug 1234317.
> How to reproduce this bug with "desktop background slideshow".on Win 10.
>   Personalization of Desktop
>     (a) Background(wallpaper in old win) : Slideshow, with short interval
>     (b) Check "Automatically pick an accent color from my background".
> Workaround when "Background: Slideshow" is enabled on Win10.
>     (c) Uncheck "Automatically pick an accent color from my background".

STR of Bug 1234317..
>   Personalization of Desktop
>     (c) Uncheck "Automatically pick an accent color from my background".
>     (d) Background(wallpaper in old win) :  Image or Color (other than Slideshow, Slideshow is not used)..
>     (e) Manually choose accent color at accent color picker.

Slideshow + "Automatically pick an accent color from my background"
 == Manual accent color change with Unchecking "Automatically pick an accent color from my background" 
 == Manual background image change with Checking "Automatically pick an accent color from my background"

Phenomenon of Bug 1234317 by "Manual accent color change" was consistently observed with multiple windows of all of following.
 Firefox 49.0.2, Latest Firefox trunk nightly, Thunderbird 45.4.0, Latest Thunderbird trunk nightly.

If multiple Firefox windows and multiple Thunderbird windows(including Composer windows) existed at same time without Maximized/Minimized state,
following was observed.
(A) If last Foreground/Active window was Firefox window, it looked like;
     (a-1) Firefox windows are re-ordered first,  then Thunderbird windows are re-ordered second.
             windows are re-ordered like FxWin-A -> ... -> FxWin-Z -> TbWin-A -> ...  -> TbWin-Z 
(B) If last Foreground/Active window was Thunderbird window, it looked like;
     (b-1) Thunderbird windows are re-ordered first,  then Firefox windows are re-ordered second.
             windows are re-ordered like TbWin-A -> ... TbWin-Z -> FxWin-A -> ...  -> FxWin-Z 
(C) Window order in Firefox family or Thunderbird family seems:
     Before accent color change, order of windows in a Mozilla family.
       (c-1) TbOrFxWin-A(top in a family) -> TbOrFxWin-B -> ... ->  TbOrFxWin-Y -> TbOrFxWin-Z(bottom in a family)
     After accent color change, order of windows  in a Mozilla family.
       (c-2) TbOrFxWin-Z(new top in family) -> TbOrFxWin-Y -> TbOrFxWin-B -> TbOrFxWin-A(new bottom in a family)
     i.e. It looks that "orddr of windows in a family" is changed to reversed order after accent color change.

It looks for me;
(1) event of "accent color change" is notified to windows based on window order(from top window to bottom window) by Win10.
(2) (2-1) Mozilla family who got the event first(== last Foreground/Active window) tries to become next Foreground/Active window.
     (2-2) And, the Mozilla family who got the event first(==last Foreground/Active window) obtains higher priority than other Mozilla family.
(3) In a Mozzila family, "accent color change" is scheduled in window order.
     and each of the Mozilla family window tries to become top window in the Mozilla family, as done in (2-1).
     => order of windows in the Mozilla family is reversed after "accent color change"
(4) Following possibly occurs by (2-2).
    "accent color change" event is procssed first by windows of the Mozilla family who obtained higher priority than other Mozilla family.
    => Reversed window order in a Mozilla family(==who had last Foreground/Active window) by (2)/(3),
        then Reversed window order in another Mozilla family by  (2)/(3).
I don't use the windows 10 slideshow, I use Display Fusion, but it also has the option to change the "Aero color" based on the current image.  I turned that option off, and the popover problem seems to have gone away, so at least in my case on Thunderbird 45.4, win 10 build 14951.rs_prerelease 161014-1700 (i.e. both most current) the workaround works!  No idea why this color pickup from the background should cause this problem, but it looks like you folks are very much on the right track.  Thanks!
User Story: (updated)
FYI.

There is no need to get NSPR log with NSPR_LOG_MODULES=WidgetFocus:5,Focus:5 any more, if your case is "Thunderbird on Win10" and "accent color change by Desktop back ground slideshow with accent color from background image".
I attached NSPR log for it to Bug 1234317 Comment #21, with using Messenger/ConfigEditor/ActivityManager/Composer window for ease of decoding log data.
1. Messenger chrome://messenger/content/messenger.xul
2. ConfigEditor chrome://global/content/config.xul
3. ActivityManager chrome://messenger/content/activity.xul
4. Composer chrome://messenger/content/messengercompose/messengercompose.xul
Following phenomenon is observed in SeaMonkey 2.40, in addition to Thunderbird and Firefox.
 When accent color is changed by Desktop background slideshow of MS Windows 10,
 if SeaMonkey 2.40 windows are minimized and restored at least once,
 window order of SeaMonkey 2.40 windows are altered by SeaMonkey.

When SeaMonkey, Browser window and Messenger window(3pane window) are usually opened same time. 
So, if Slideshow interval=1 minute is used and above phenomenon happens, following occurs.
- If user is working at Browser, focused/Active/Foreground state is hi-jacked by Messenger within 1 minute. 
- If user is working at Messenger, focused/Active/Foreground state is hi-jacked by Browser within 1 minute. 
Good grief...

Workaround:
- If you want "automatic accent color change by Desktop slideshow", never do "minimize window".
- If you want to use "window minimize", prohibit "automatic accent color change by Desktop slideshow".
  - Uncheck "Automatically pick an accent color from my background".

Anyway, a problem in this bug on Win10 due to "automatic accent color change by Desktop slideshow" is not Thunderbird only issue.
The problem is obviously Core issue.
The problem is essentially absolutely same as problem of Bug 1234317.
Difference is "used STR is different" and observed external phenomenon is slightly different only.
(timing of event happening/processing is different due to difference of used STR, so order of focus switch is different)
i.e. Bug 1234317 is also Core issue instead of Firefox only issue.
(In reply to Matt from comment #38)
> I think it is fair to say this bug will not progress at all until the
> Firefox bug 1234317 in the core code is first resolved.  Fixing that Bug may
> well fix the issue in Thunderbird as well.

That bug appears to be fixed now. 
Is it possible to make a test build of Thunderbird which includes that fix?
Then we could test if it also fixes this bug, and maybe also bug 1121870 and bug 1233575.
Summary: Thunderbird main window pops up while typing email causing compose window to lose focus, when MS-Windows is running slideshow and 3-pane window is not maximized [win10] → Thunderbird main window pops up while typing email causing compose window to lose focus, when MS-Windows-10 is running slideshow and 3-pane window was minimized/maximized once [win10]
No longer blocks: 1306773
As I understand it, this bug was fixed by the landings from bug 1234317, which are included in both TB 45 and TB 52 releases now. I'll dup to that bug. If this is not correct, feel free to reopen.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
No longer blocks: 942610
You need to log in before you can comment on or make changes to this bug.