Closed Bug 1446151 Opened 7 years ago Closed 7 years ago

Draw In Titlebar not working anymore on Trunk as of 2018-03-15

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 61.0

People

(Reporter: Paenglab, Assigned: jorgk-bmo)

References

Details

(Keywords: regression)

Attachments

(1 file, 6 obsolete files)

No matter how the pref mail.tabs.drawInTitlebar is set, the window titlebar is always shown. Seen on Mac and Windows. It looks like bug 1439875 is the reason for this. maybe we need something like https://hg.mozilla.org/mozilla-central/rev/1ee5a2d21901#l1.1
Blocks: 1439875
Summary: Draw In Titlebar no more works → Draw In Titlebar not working anymore on Trunk as of 2018-03-15
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1445737, which is the same code looking fishy in FF. I'll try to address it pretty much that way.
Keywords: regression
Bug 1439875 has just been backed out: c43177719f36 Gurzau Raul — Backed out 6 changesets (bug 1439875) for massive breakage for nightly users a=backout
Attached patch Bug1446151.patch (obsolete) — Splinter Review
Tested on my Mac again with the build showing the problem. When I maximize the window the tabs are back in the titlebar. This shows, we initialize it at the wrong moment. I made a port of bug 1445737 to be in sync. It doesn't fixes the issue on Mac but still works with the latest builds. I tried to place TabsInTitlebar.onDOMContentLoaded(); on different places but didn't succeed. Maybe somebody can point to where this needs to be placed.
Well, sadly M-C have refactored this area again: https://hg.mozilla.org/mozilla-central/rev/e343c24ea4c0 So the TabsInTitlebar.onDOMContentLoaded() call is no longer there: https://hg.mozilla.org/mozilla-central/rev/e343c24ea4c0#l3.53 Maybe you want to follow that. TabsInTitlebar.init(); is done before they do new LightweightThemeConsumer(): https://searchfox.org/mozilla-central/rev/a0665934fa05158a5a943d4c8b277465910c029c/browser/base/content/browser.js#1208 so my suggestion would be to put the init() call and the whenWindowLayoutReady() into mailGlue: https://dxr.mozilla.org/comm-central/rev/ab720c6d3a9f330ab95707c78337cf9b0449fbc7/mail/components/mailGlue.js#75 I might be wrong :-(
Tried it and got a "TabsInTitlebar is not defined". Then copied the whole TabsInTitlebar function to mailGle.js and got "Window is not defined". Maybe this should someone try that knows what he does. :(
I was going to try it, but the patch here doesn't apply any more. I'm not sure how much of https://hg.mozilla.org/mozilla-central/rev/e343c24ea4c0 we'd need to port. In any case, something like this can be done: +++ b/mail/components/mailGlue.js new LightweightThemeConsumer(aSubject.document); + let win = Services.wm.getMostRecentWindow("mail:3pane"); + dump("=== Tabs in titlebar!!\n"); + win.TabsInTitlebar.init(); } If you have TabsInTitlebar in msgMail3PaneWindow.js, then you can call it like this from mailGlue. You'd have to check with some logging whether that runs earlier than the call in OnLoadMessenger(). Sadly we don't have any expert on this unless you want to ask Florian who did the refactoring in bug 1448303.
Attached patch Bug1446151.patch (obsolete) — Splinter Review
Refreshed and with dumps. You can see that the mailGlue code runs first, but it still doesn't work. Florian, can you help us out here?
Attachment #8959636 - Attachment is obsolete: true
Flags: needinfo?(florian)
There's been more happening in bug 1449689. We're really late following those changes.
Getting there. The problem is that at startup, 'allow' is set to false. Debugging that now.
Assignee: nobody → jorgk
Attachment #8964978 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Flags: needinfo?(florian)
You wanted someone who knows what they're doing? Here you go. This is refactored according to bug 1445737, bug 1448303 and bug 1449689 from browser-tabsintitlebar.js. As far as I can see, everything is working on Windows. I don't quite understand what that sizemode stuff is about. M-C have a handleEvent() function which doesn't appear to be called in the file. I rolled the code into the resize observer. Of course, `break` becomes `return`.
Attachment #8965118 - Attachment is obsolete: true
Attachment #8965129 - Flags: review?(richard.marti)
Minor tweak: returned the variable name for the pref to the original.
Attachment #8965129 - Attachment is obsolete: true
Attachment #8965129 - Flags: review?(richard.marti)
Attachment #8965139 - Flags: review?(richard.marti)
Now using handleEvent() to be even more in sync with M-C.
Attachment #8965139 - Attachment is obsolete: true
Attachment #8965139 - Flags: review?(richard.marti)
Attachment #8965230 - Flags: review?(richard.marti)
Comment on attachment 8965230 [details] [diff] [review] 1446151-drawtabs-refactor.patch (v3) Review of attachment 8965230 [details] [diff] [review]: ----------------------------------------------------------------- Many thanks for fixing this. I checked the FX file and our file with WinMerge and the differences are looking reasonable with our different implementations and features.
Attachment #8965230 - Flags: review?(richard.marti) → review+
Very good idea to use WinMerge to compare the two files. I found more things that should have been more similar, so that's fixed here now.
Attachment #8965230 - Attachment is obsolete: true
Attachment #8965436 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 61.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: