commit a6b5717b8e31ff939c69d16918b75a8aa2b2910b
parent c6c5f6c2f788aa0d5c188a9fdb85334edf71eda4
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 31 Jan 2012 23:11:40 -0500
Fix Linux focus bugs entirely and also (hopefully) fix the white bar issue
Diffstat:
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js
@@ -97,6 +97,12 @@ var Zotero_QuickFormat = new function () {
panelLocatorLabel = document.getElementById("locator-label");
panelLocator = document.getElementById("locator");
panelInfo = document.getElementById("citation-properties-info");
+
+
+ // Don't need to set noautohide dynamically on these platforms, so do it now
+ if(Zotero.isMac || Zotero.isWin) {
+ tabPanel.setAttribute("noautohide", true);
+ }
} else if(event.target === qfi.contentDocument) {
qfiWindow = qfi.contentWindow;
qfiDocument = qfi.contentDocument;
@@ -769,21 +775,21 @@ var Zotero_QuickFormat = new function () {
* Opens the reference panel and potentially refocuses the main text box
*/
function _openReferencePanel() {
+ if(!Zotero.isMac && !Zotero.isWin) {
+ // noautohide and noautofocus are incompatible on Linux
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=545265
+ referencePanel.setAttribute("noautohide", "false");
+ }
+
referencePanel.openPopup(document.documentElement, "after_start", 15,
null, false, false, null);
+
if(!Zotero.isMac && !Zotero.isWin) {
- // When the reference panel opens, we may lose focus on Linux. We thus look for a
- // deactivate event within 1 second of the panel open request.
- var eventHandler = function(e) {
- if(e.target !== window) return;
- window.removeEventListener("deactivate", eventHandler, false);
- window.clearTimeout(timeoutID);
- window.setTimeout(function() { _refocusQfe(); }, 0);
- };
- window.addEventListener("deactivate", eventHandler, false);
- var timeoutID = window.setTimeout(function() {
- window.removeEventListener("deactivate", eventHandler, false);
- }, 1000);
+ // reinstate noautohide after the window is shown
+ referencePanel.addEventListener("popupshowing", function() {
+ referencePanel.removeEventListener("popupshowing", arguments.callee, false);
+ referencePanel.setAttribute("noautohide", "true");
+ }, false);
}
}
diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul
@@ -67,7 +67,8 @@
<progressmeter id="quick-format-progress-meter" mode="undetermined" value="0" flex="1"/>
</deck>
</box>
- <panel id="quick-format-reference-panel" noautofocus="true" norestorefocus="true" noautohide="true" height="0">
+ <panel id="quick-format-reference-panel" noautofocus="true" norestorefocus="true"
+ height="0" width="0">
<richlistbox id="quick-format-reference-list" flex="1"/>
</panel>
<panel id="citation-properties" type="arrow" orient="vertical"