mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
35252384aa
16 changed files with 39 additions and 216 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB |
|
|
@ -1,94 +0,0 @@
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
window {
|
|
||||||
-moz-appearance: none;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
#doorhanger-container {
|
|
||||||
width: 450px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top-panel {
|
|
||||||
padding: 20px;
|
|
||||||
background: #343c45; /* toolbars */
|
|
||||||
color: #8fa1b2; /* body text */
|
|
||||||
/*
|
|
||||||
* Sloppy preprocessing since UNIX_BUT_NOT_MAC is only defined
|
|
||||||
* in `browser/app/profile/firefox.js`, which this file cannot
|
|
||||||
* depend on. Must style font-size to target linux.
|
|
||||||
*/
|
|
||||||
%ifdef XP_UNIX
|
|
||||||
%ifndef XP_MACOSX
|
|
||||||
font-size: 13px;
|
|
||||||
%else
|
|
||||||
font-size: 15px;
|
|
||||||
%endif
|
|
||||||
%else
|
|
||||||
font-size: 15px;
|
|
||||||
%endif
|
|
||||||
line-height: 19px;
|
|
||||||
min-height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top-panel h1 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-family: Open Sans, sans-serif;
|
|
||||||
font-size: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top-panel p {
|
|
||||||
font-family: Open Sans, sans-serif;
|
|
||||||
font-size: 0.9em;
|
|
||||||
width: 300px;
|
|
||||||
display: block;
|
|
||||||
margin: 5px 0px 0px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#icon {
|
|
||||||
background-image: url("chrome://devtools/content/framework/dev-edition-promo/dev-edition-logo.png");
|
|
||||||
background-size: 64px 64px;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
width: 64px;
|
|
||||||
height: 64px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#lower-panel {
|
|
||||||
padding: 20px;
|
|
||||||
background-color: #252c33; /* tab toolbars */
|
|
||||||
min-height: 75px;
|
|
||||||
border-top: 1px solid #292e33; /* text high contrast (light) */
|
|
||||||
}
|
|
||||||
|
|
||||||
#button-container {
|
|
||||||
margin: auto 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#button-container button {
|
|
||||||
font: message-box !important;
|
|
||||||
font-size: 16px !important;
|
|
||||||
cursor: pointer;
|
|
||||||
width: 125px;
|
|
||||||
opacity: 1;
|
|
||||||
position: static;
|
|
||||||
-moz-appearance: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 30px;
|
|
||||||
width: 450px;
|
|
||||||
/* Override embossed borders on Windows/Linux */
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#close {
|
|
||||||
background-color: transparent;
|
|
||||||
color: #8fa1b2; /* body text */
|
|
||||||
}
|
|
||||||
|
|
||||||
#go {
|
|
||||||
margin-left: 100px;
|
|
||||||
background-color: #70bf53; /* green */
|
|
||||||
color: #f5f7fa; /* selection text color */
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
||||||
<!DOCTYPE window [
|
|
||||||
<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
|
|
||||||
%toolboxDTD;
|
|
||||||
]>
|
|
||||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
|
||||||
<?xml-stylesheet rel="stylesheet" href="chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.css" type="text/css"?>
|
|
||||||
|
|
||||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="dev-edition-promo">
|
|
||||||
<vbox id="doorhanger-container">
|
|
||||||
<hbox flex="1" id="top-panel">
|
|
||||||
<image id="icon" />
|
|
||||||
<vbox id="info">
|
|
||||||
<h1>Using Developer Tools in your browser?</h1>
|
|
||||||
<p>Download Firefox Developer Edition, our first browser made just for you.</p>
|
|
||||||
</vbox>
|
|
||||||
</hbox>
|
|
||||||
<hbox id="lower-panel" flex="1">
|
|
||||||
<hbox id="button-container" flex="1">
|
|
||||||
<button id="close"
|
|
||||||
flex="1"
|
|
||||||
standalone="true"
|
|
||||||
label="No thanks">
|
|
||||||
</button>
|
|
||||||
<button id="go"
|
|
||||||
flex="1"
|
|
||||||
standalone="true"
|
|
||||||
label="Learn more »">
|
|
||||||
</button>
|
|
||||||
</hbox>
|
|
||||||
</hbox>
|
|
||||||
</vbox>
|
|
||||||
</window>
|
|
||||||
|
|
@ -117,7 +117,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
|
||||||
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
|
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
|
||||||
this._onFocus = this._onFocus.bind(this);
|
this._onFocus = this._onFocus.bind(this);
|
||||||
this._onBrowserMessage = this._onBrowserMessage.bind(this);
|
this._onBrowserMessage = this._onBrowserMessage.bind(this);
|
||||||
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
|
|
||||||
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
|
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
|
||||||
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
|
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
|
||||||
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
|
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
|
||||||
|
|
@ -149,8 +148,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
|
||||||
this.on("host-changed", this._refreshHostTitle);
|
this.on("host-changed", this._refreshHostTitle);
|
||||||
this.on("select", this._refreshHostTitle);
|
this.on("select", this._refreshHostTitle);
|
||||||
|
|
||||||
this.on("ready", this._showDevEditionPromo);
|
|
||||||
|
|
||||||
gDevTools.on("tool-registered", this._toolRegistered);
|
gDevTools.on("tool-registered", this._toolRegistered);
|
||||||
gDevTools.on("tool-unregistered", this._toolUnregistered);
|
gDevTools.on("tool-unregistered", this._toolUnregistered);
|
||||||
|
|
||||||
|
|
@ -2095,7 +2092,6 @@ Toolbox.prototype = {
|
||||||
this._target.off("frame-update", this._updateFrames);
|
this._target.off("frame-update", this._updateFrames);
|
||||||
this.off("select", this._refreshHostTitle);
|
this.off("select", this._refreshHostTitle);
|
||||||
this.off("host-changed", this._refreshHostTitle);
|
this.off("host-changed", this._refreshHostTitle);
|
||||||
this.off("ready", this._showDevEditionPromo);
|
|
||||||
|
|
||||||
gDevTools.off("tool-registered", this._toolRegistered);
|
gDevTools.off("tool-registered", this._toolRegistered);
|
||||||
gDevTools.off("tool-unregistered", this._toolUnregistered);
|
gDevTools.off("tool-unregistered", this._toolUnregistered);
|
||||||
|
|
@ -2251,18 +2247,6 @@ Toolbox.prototype = {
|
||||||
this.emit("highlighter-hide");
|
this.emit("highlighter-hide");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* For displaying the promotional Doorhanger on first opening of
|
|
||||||
* the developer tools, promoting the Developer Edition.
|
|
||||||
*/
|
|
||||||
_showDevEditionPromo: function () {
|
|
||||||
// Do not display in browser toolbox
|
|
||||||
if (this.target.chrome) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
showDoorhanger({ window: this.win, type: "deveditionpromo" });
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable / disable necessary textbox menu items using globalOverlay.js.
|
* Enable / disable necessary textbox menu items using globalOverlay.js.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,6 @@ devtools.jar:
|
||||||
content/framework/options-panel.css (framework/options-panel.css)
|
content/framework/options-panel.css (framework/options-panel.css)
|
||||||
content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
|
content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
|
||||||
* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
|
* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
|
||||||
content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
|
|
||||||
* content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
|
|
||||||
content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
|
|
||||||
content/inspector/inspector.xhtml (inspector/inspector.xhtml)
|
content/inspector/inspector.xhtml (inspector/inspector.xhtml)
|
||||||
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
|
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
|
||||||
content/framework/connect/connect.css (framework/connect/connect.css)
|
content/framework/connect/connect.css (framework/connect/connect.css)
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,8 @@ function ConverterObserver() {
|
||||||
|
|
||||||
ConverterObserver.prototype = {
|
ConverterObserver.prototype = {
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
// Only the DevEdition has this feature available by default.
|
|
||||||
// Users need to manually flip 'devtools.jsonview.enabled' preference
|
// Users need to manually flip 'devtools.jsonview.enabled' preference
|
||||||
// to have it available in other distributions.
|
// to have it available.
|
||||||
if (this.isEnabled()) {
|
if (this.isEnabled()) {
|
||||||
this.register();
|
this.register();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,6 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
// Developer edition promo preferences
|
|
||||||
pref("devtools.devedition.promo.shown", false);
|
|
||||||
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
|
|
||||||
|
|
||||||
// Only potentially show in beta release
|
|
||||||
#if MOZ_UPDATE_CHANNEL == beta
|
|
||||||
pref("devtools.devedition.promo.enabled", true);
|
|
||||||
#else
|
|
||||||
pref("devtools.devedition.promo.enabled", false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// DevTools development workflow
|
// DevTools development workflow
|
||||||
pref("devtools.loader.hotreload", false);
|
pref("devtools.loader.hotreload", false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -255,14 +255,6 @@ ResponsiveUI.prototype = {
|
||||||
yield this.connectToServer();
|
yield this.connectToServer();
|
||||||
this.userAgentInput.hidden = false;
|
this.userAgentInput.hidden = false;
|
||||||
|
|
||||||
// Hook to display promotional Developer Edition doorhanger.
|
|
||||||
// Only displayed once.
|
|
||||||
showDoorhanger({
|
|
||||||
window: this.mainWindow,
|
|
||||||
type: "deveditionpromo",
|
|
||||||
anchor: this.chromeDoc.querySelector("#content")
|
|
||||||
});
|
|
||||||
|
|
||||||
// Notify that responsive mode is on.
|
// Notify that responsive mode is on.
|
||||||
this._telemetry.toolOpened("responsive");
|
this._telemetry.toolOpened("responsive");
|
||||||
ResponsiveUIManager.emit("on", { tab: this.tab });
|
ResponsiveUIManager.emit("on", { tab: this.tab });
|
||||||
|
|
|
||||||
|
|
@ -12,40 +12,13 @@ const defer = require("devtools/shared/defer");
|
||||||
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
|
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
|
||||||
|
|
||||||
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||||
const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
|
|
||||||
const DEV_EDITION_PROMO_ENABLED_PREF = "devtools.devedition.promo.enabled";
|
|
||||||
const DEV_EDITION_PROMO_SHOWN_PREF = "devtools.devedition.promo.shown";
|
|
||||||
const DEV_EDITION_PROMO_URL_PREF = "devtools.devedition.promo.url";
|
|
||||||
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||||
.getService(Ci.nsIXULChromeRegistry)
|
.getService(Ci.nsIXULChromeRegistry)
|
||||||
.getSelectedLocale("global");
|
.getSelectedLocale("global");
|
||||||
|
|
||||||
/**
|
|
||||||
* Only show Dev Edition promo if it's enabled (beta channel),
|
|
||||||
* if it has not been shown before, and it's a locale build
|
|
||||||
* for `en-US`
|
|
||||||
*/
|
|
||||||
function shouldDevEditionPromoShow() {
|
|
||||||
return Services.prefs.getBoolPref(DEV_EDITION_PROMO_ENABLED_PREF) &&
|
|
||||||
!Services.prefs.getBoolPref(DEV_EDITION_PROMO_SHOWN_PREF) &&
|
|
||||||
LOCALE === "en-US";
|
|
||||||
}
|
|
||||||
|
|
||||||
var TYPES = {
|
var TYPES = {
|
||||||
// The Developer Edition promo doorhanger, called by
|
// We don't support any doorhanger types at the moment.
|
||||||
// opening the toolbox, browser console, WebIDE, or responsive design mode
|
// This is vestigial from the FF dev edition promo.
|
||||||
// in Beta releases. Only displayed once per profile.
|
|
||||||
deveditionpromo: {
|
|
||||||
predicate: shouldDevEditionPromoShow,
|
|
||||||
success: () => {
|
|
||||||
return Services.prefs.setBoolPref(DEV_EDITION_PROMO_SHOWN_PREF, true);
|
|
||||||
},
|
|
||||||
action: () => {
|
|
||||||
let url = Services.prefs.getCharPref(DEV_EDITION_PROMO_URL_PREF);
|
|
||||||
getGBrowser().selectedTab = getGBrowser().addTab(url);
|
|
||||||
},
|
|
||||||
url: DEV_EDITION_PROMO_URL
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var panelAttrs = {
|
var panelAttrs = {
|
||||||
|
|
|
||||||
|
|
@ -682,12 +682,6 @@ BrowserConsole.prototype = extend(WebConsole.prototype, {
|
||||||
|
|
||||||
this._telemetry.toolOpened("browserconsole");
|
this._telemetry.toolOpened("browserconsole");
|
||||||
|
|
||||||
// Create an onFocus handler just to display the dev edition promo.
|
|
||||||
// This is to prevent race conditions in some environments.
|
|
||||||
// Hook to display promotional Developer Edition doorhanger. Only displayed once.
|
|
||||||
let onFocus = () => showDoorhanger({ window, type: "deveditionpromo" });
|
|
||||||
window.addEventListener("focus", onFocus);
|
|
||||||
|
|
||||||
this._bc_init = this.$init();
|
this._bc_init = this.$init();
|
||||||
return this._bc_init;
|
return this._bc_init;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -186,10 +186,10 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
topNonFullRow_ += GetNumRows(variable.type) * variable.elementCount();
|
topNonFullRow_ += GetNumRows(variable.type) * variable.elementCount();
|
||||||
}
|
|
||||||
|
|
||||||
if (topNonFullRow_ > maxRows_) {
|
if (topNonFullRow_ > maxRows_) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Packs the 3 column variables.
|
// Packs the 3 column variables.
|
||||||
|
|
@ -200,10 +200,10 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
num3ColumnRows += GetNumRows(variable.type) * variable.elementCount();
|
num3ColumnRows += GetNumRows(variable.type) * variable.elementCount();
|
||||||
}
|
|
||||||
|
|
||||||
if (topNonFullRow_ + num3ColumnRows > maxRows_) {
|
if (topNonFullRow_ + num3ColumnRows > maxRows_) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fillColumns(topNonFullRow_, num3ColumnRows, 0, 3);
|
fillColumns(topNonFullRow_, num3ColumnRows, 0, 3);
|
||||||
|
|
|
||||||
|
|
@ -658,8 +658,11 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
|
||||||
*aCached = true;
|
*aCached = true;
|
||||||
}
|
}
|
||||||
if (siteState.mHSTSState == SecurityPropertySet) {
|
if (siteState.mHSTSState == SecurityPropertySet) {
|
||||||
*aResult = siteState.mHSTSIncludeSubdomains;
|
// We do not break here, and continue to walk up the domain in case
|
||||||
break;
|
// any parent domain has HSTS set with included subdomains in which
|
||||||
|
// case it will take precedence. See RFC 6797.
|
||||||
|
// We latch the result with an or-assignment.
|
||||||
|
*aResult |= siteState.mHSTSIncludeSubdomains;
|
||||||
} else if (siteState.mHSTSState == SecurityPropertyNegative) {
|
} else if (siteState.mHSTSState == SecurityPropertyNegative) {
|
||||||
*aResult = false;
|
*aResult = false;
|
||||||
break;
|
break;
|
||||||
|
|
@ -675,7 +678,6 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
|
||||||
SSSLOG(("no HSTS data for %s found, walking up domain", subdomain));
|
SSSLOG(("no HSTS data for %s found, walking up domain", subdomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use whatever we ended up with, which defaults to false.
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -441,7 +441,12 @@ ssl_SendSavedWriteData(sslSocket *ss)
|
||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
ss->pendingBuf.len -= rv;
|
if (rv > ss->pendingBuf.len) {
|
||||||
|
PORT_Assert(0); /* This shouldn't happen */
|
||||||
|
ss->pendingBuf.len = 0;
|
||||||
|
} else {
|
||||||
|
ss->pendingBuf.len -= rv;
|
||||||
|
}
|
||||||
if (ss->pendingBuf.len > 0 && rv > 0) {
|
if (ss->pendingBuf.len > 0 && rv > 0) {
|
||||||
/* UGH !! This shifts the whole buffer down by copying it */
|
/* UGH !! This shifts the whole buffer down by copying it */
|
||||||
PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,
|
PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ this.PopupNotifications = function PopupNotifications(tabbrowser, panel, iconBox
|
||||||
this.buttonDelay = Services.prefs.getIntPref(PREF_SECURITY_DELAY);
|
this.buttonDelay = Services.prefs.getIntPref(PREF_SECURITY_DELAY);
|
||||||
|
|
||||||
this.panel.addEventListener("popuphidden", this, true);
|
this.panel.addEventListener("popuphidden", this, true);
|
||||||
|
this.panel.addEventListener("popuppositioned", this, true);
|
||||||
|
|
||||||
this.window.addEventListener("activate", this, true);
|
this.window.addEventListener("activate", this, true);
|
||||||
if (this.tabbrowser.tabContainer)
|
if (this.tabbrowser.tabContainer)
|
||||||
|
|
@ -475,6 +476,7 @@ PopupNotifications.prototype = {
|
||||||
this._onPopupHidden(aEvent);
|
this._onPopupHidden(aEvent);
|
||||||
break;
|
break;
|
||||||
case "activate":
|
case "activate":
|
||||||
|
case "popuppositioned":
|
||||||
case "TabSelect":
|
case "TabSelect":
|
||||||
let self = this;
|
let self = this;
|
||||||
// setTimeout(..., 0) needed, otherwise openPopup from "activate" event
|
// setTimeout(..., 0) needed, otherwise openPopup from "activate" event
|
||||||
|
|
|
||||||
|
|
@ -250,6 +250,12 @@ gboolean nsDeviceContextSpecGTK::PrinterEnumerator(GtkPrinter *aPrinter,
|
||||||
gpointer aData) {
|
gpointer aData) {
|
||||||
nsDeviceContextSpecGTK *spec = (nsDeviceContextSpecGTK*)aData;
|
nsDeviceContextSpecGTK *spec = (nsDeviceContextSpecGTK*)aData;
|
||||||
|
|
||||||
|
if (spec->mHasEnumerationFoundAMatch) {
|
||||||
|
// We're already done, but we're letting the enumeration run its course,
|
||||||
|
// to avoid a GTK bug.
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Find the printer whose name matches the one inside the settings.
|
// Find the printer whose name matches the one inside the settings.
|
||||||
nsXPIDLString printerName;
|
nsXPIDLString printerName;
|
||||||
nsresult rv =
|
nsresult rv =
|
||||||
|
|
@ -266,7 +272,14 @@ gboolean nsDeviceContextSpecGTK::PrinterEnumerator(GtkPrinter *aPrinter,
|
||||||
// GTK bug (https://bugzilla.gnome.org/show_bug.cgi?id=753041). We
|
// GTK bug (https://bugzilla.gnome.org/show_bug.cgi?id=753041). We
|
||||||
// sidestep this by deferring the print to the next tick.
|
// sidestep this by deferring the print to the next tick.
|
||||||
NS_DispatchToCurrentThread(NewRunnableMethod(spec, &nsDeviceContextSpecGTK::StartPrintJob));
|
NS_DispatchToCurrentThread(NewRunnableMethod(spec, &nsDeviceContextSpecGTK::StartPrintJob));
|
||||||
return TRUE;
|
|
||||||
|
// We're already done, but we need to let the enumeration run its course,
|
||||||
|
// to avoid a GTK bug. So we record that we've found a match and
|
||||||
|
// then return FALSE.
|
||||||
|
// TODO: If/when we can be sure that GTK handles this OK, we could
|
||||||
|
// return TRUE here to avoid some needless enumeration.
|
||||||
|
spec->mHasEnumerationFoundAMatch = true;
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,6 +303,7 @@ void nsDeviceContextSpecGTK::StartPrintJob() {
|
||||||
void
|
void
|
||||||
nsDeviceContextSpecGTK::EnumeratePrinters()
|
nsDeviceContextSpecGTK::EnumeratePrinters()
|
||||||
{
|
{
|
||||||
|
mHasEnumerationFoundAMatch = false;
|
||||||
gtk_enumerate_printers(&nsDeviceContextSpecGTK::PrinterEnumerator, this,
|
gtk_enumerate_printers(&nsDeviceContextSpecGTK::PrinterEnumerator, this,
|
||||||
nullptr, TRUE);
|
nullptr, TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ protected:
|
||||||
nsCString mSpoolName;
|
nsCString mSpoolName;
|
||||||
nsCOMPtr<nsIFile> mSpoolFile;
|
nsCOMPtr<nsIFile> mSpoolFile;
|
||||||
nsCString mTitle;
|
nsCString mTitle;
|
||||||
|
// Helper for EnumeratePrinters / PrinterEnumerator:
|
||||||
|
bool mHasEnumerationFoundAMatch = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void EnumeratePrinters();
|
void EnumeratePrinters();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue