Skip to content

Commit

Permalink
Feature: Compose in tab, bug 449299, Issue #90: Fix context menu in c…
Browse files Browse the repository at this point in the history
…ompose window.
  • Loading branch information
Betterbird committed Feb 6, 2023
1 parent 2cc7f0d commit c0e4559
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions 115/12-feature-compose-in-tab-based-on-trunk.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
# HG changeset patch
# User Betterbird <[email protected]>
# Date 1669396446 -3600
# Parent e5721375213a893ed4636cd7cd3e65cc6339a6f1
# Date 1675645659 -3600
# Parent 3c1be92d7eab05f74dbfb21b1b3f83ba334d2aeb
Feature: Compose in tab (see https://bugzilla.mozilla.org/show_bug.cgi?id=449299)

diff --git a/mail/actors/ContextMenuParent.sys.mjs b/mail/actors/ContextMenuParent.sys.mjs
--- a/mail/actors/ContextMenuParent.sys.mjs
+++ b/mail/actors/ContextMenuParent.sys.mjs
@@ -4,17 +4,20 @@
* file, you can obtain one at http://mozilla.org/MPL/2.0/. */

export class ContextMenuParent extends JSWindowActorParent {
receiveMessage(message) {
if (message.name != "contextmenu") {
return;
}

- let browser = this.manager.rootFrameLoader.ownerElement;
+ let browser = this.browsingContext.embedderElement;
+ if (browser.id != "messageEditor") {
+ browser = this.manager.rootFrameLoader.ownerElement;
+ }
let win = browser.ownerGlobal.top;

// Send events from a message display browser to about:3pane or
// about:message if possible.
let tabmail = win.document.getElementById("tabmail");
if (tabmail) {
let chromeBrowser = tabmail.currentTabInfo.chromeBrowser;
if (
diff --git a/mail/base/content/specialTabs.js b/mail/base/content/specialTabs.js
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -1050,16 +1050,23 @@ var specialTabs = {
@@ -1047,16 +1047,23 @@ var specialTabs = {
},
tryCloseTab(aTab) {
return aTab.browser.permitUnload();
Expand Down Expand Up @@ -273,7 +298,7 @@ diff --git a/mail/components/compose/content/ComposerCommands.js b/mail/componen
diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -4155,16 +4155,20 @@ async function ComposeStartup() {
@@ -4176,16 +4176,20 @@ async function ComposeStartup() {
dump("ERROR with parameters: " + ex + "\n");
}

Expand All @@ -294,7 +319,7 @@ diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/compon
// Prefer 860x800.
let defaultHeight = Math.min(screen.availHeight, 800);
let defaultWidth = Math.min(screen.availWidth, 860);
@@ -7451,17 +7455,22 @@ function SetContentAndBodyAsUnmodified()
@@ -7485,17 +7489,22 @@ function SetContentAndBodyAsUnmodified()
gMsgCompose.bodyModified = false;
gContentChanged = false;
}
Expand Down Expand Up @@ -538,7 +563,7 @@ diff --git a/mail/components/compose/content/editorUtilities.js b/mail/component
diff --git a/mail/themes/shared/mail/messengercompose.css b/mail/themes/shared/mail/messengercompose.css
--- a/mail/themes/shared/mail/messengercompose.css
+++ b/mail/themes/shared/mail/messengercompose.css
@@ -440,16 +440,20 @@
@@ -439,16 +439,20 @@
flex: 1 1 0;
min-height: 0;
}
Expand All @@ -559,7 +584,7 @@ diff --git a/mail/themes/shared/mail/messengercompose.css b/mail/themes/shared/m

#attachmentSplitter {
grid-area: attachment-splitter;
@@ -1338,16 +1342,19 @@ button:is(
@@ -1337,16 +1341,19 @@ button:is(
margin-block: -0.2em 0.2em;
margin-inline: 0.2em -0.2em;
}
Expand Down Expand Up @@ -727,7 +752,7 @@ diff --git a/mailnews/base/src/components.conf b/mailnews/base/src/components.co
diff --git a/mailnews/base/src/moz.build b/mailnews/base/src/moz.build
--- a/mailnews/base/src/moz.build
+++ b/mailnews/base/src/moz.build
@@ -124,16 +124,17 @@ EXTRA_JS_MODULES += [
@@ -127,16 +127,17 @@ EXTRA_JS_MODULES += [
"MsgAsyncPrompter.jsm",
"MsgDBCacheManager.jsm",
"MsgIncomingServer.jsm",
Expand Down Expand Up @@ -777,7 +802,7 @@ diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgC
LazyLogModule Compose("Compose");

static nsresult GetReplyHeaderInfo(int32_t* reply_header_type,
@@ -1317,25 +1319,39 @@ NS_IMETHODIMP nsMsgCompose::CloseWindow(
@@ -1327,25 +1329,39 @@ NS_IMETHODIMP nsMsgCompose::CloseWindow(
rv = composeService->UnregisterComposeDocShell(mDocShell);
NS_ENSURE_SUCCESS(rv, rv);
mDocShell = nullptr;
Expand Down Expand Up @@ -821,7 +846,7 @@ diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgC
diff --git a/mailnews/compose/src/nsMsgComposeService.cpp b/mailnews/compose/src/nsMsgComposeService.cpp
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -57,16 +57,17 @@
@@ -56,16 +56,17 @@
# include "nsMsgUtils.h"
#endif

Expand All @@ -839,7 +864,7 @@ diff --git a/mailnews/compose/src/nsMsgComposeService.cpp b/mailnews/compose/src
# include <windows.h>
# include <shellapi.h>
# include "nsIWidget.h"
@@ -172,26 +173,33 @@ nsMsgComposeService::OpenComposeWindowWi
@@ -171,26 +172,33 @@ nsMsgComposeService::OpenComposeWindowWi

nsCOMPtr<nsISupportsInterfacePointer> msgParamsWrapper =
do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
Expand Down Expand Up @@ -880,7 +905,7 @@ diff --git a/mailnews/compose/src/nsMsgComposeService.cpp b/mailnews/compose/src
diff --git a/mailnews/mailnews.js b/mailnews/mailnews.js
--- a/mailnews/mailnews.js
+++ b/mailnews/mailnews.js
@@ -957,16 +957,19 @@ pref("mail.compose.add_undisclosed_recip
@@ -962,16 +962,19 @@ pref("mail.compose.add_undisclosed_recip
pref("mail.compose.dontWarnMail2Newsgroup", false);

// Attach http image resources to composed messages.
Expand Down

0 comments on commit c0e4559

Please sign in to comment.