From 28a8c6862d912143ceaf1175313289898edb6ae4 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Tue, 28 Aug 2007 22:41:51 +0000 Subject: [PATCH] Fixed menu mode to be reliable in Linux and made it more sane in general --- chrome/content/vimperator/events.js | 10 ++-------- chrome/content/vimperator/hints.js | 3 +++ chrome/content/vimperator/vimperator.js | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js index 469e6bd2..2ef08d23 100644 --- a/chrome/content/vimperator/events.js +++ b/chrome/content/vimperator/events.js @@ -76,35 +76,29 @@ function Events() //{{{ // track if a popup is open or the menubar is active // - var popup_count = 0; var active_menubar = false; function enterPopupMode() { - popup_count++; - vimperator.log("Open popup window count: " + popup_count, 9); vimperator.addMode(null, vimperator.modes.MENU); } function exitPopupMode() { - popup_count--; - vimperator.log("Open popup window count: " + popup_count, 9); - if (popup_count == 0) + // gContextMenu is set to NULL by firefox, when a context menu is closed + if (!gContextMenu && !active_menubar) vimperator.removeMode(null, vimperator.modes.MENU); } function enterMenuMode() { active_menubar = true; - vimperator.log("Menubar is active", 9); vimperator.addMode(null, vimperator.modes.MENU) } function exitMenuMode() { active_menubar = false; - vimperator.log("Menubar is inactive", 9); vimperator.removeMode(null, vimperator.modes.MENU); } diff --git a/chrome/content/vimperator/hints.js b/chrome/content/vimperator/hints.js index c750cb50..565c22bc 100644 --- a/chrome/content/vimperator/hints.js +++ b/chrome/content/vimperator/hints.js @@ -688,6 +688,9 @@ function Hints() //{{{ } window.document.addEventListener("DOMContentLoaded", initDoc, null); + //window.document.addEventListener("DOMContentLoaded", function() { vimperator.log("contentloaded"); }, null); + //window.addEventListener("load", function() { vimperator.log("load"); }, null); + //window.document.addEventListener("pageshow", function() { vimperator.log("pageshow"); }, null); // FIXME: add resize support //window.addEventListener("resize", onResize, null); } //}}} diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 16d35791..49f76d2f 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -64,7 +64,7 @@ const vimperator = (function() //{{{ mode_messages[modes.QUICK_HINT] = "quick"; mode_messages[modes.EXTENDED_HINT] = "extended"; mode_messages[modes.ALWAYS_HINT] = "always"; - mode_messages[modes.MENU] = "menu"; // TODO: desirable? + // mode_messages[modes.MENU] = "menu"; // TODO: desirable? -> now that it seems to work reliable -> NO (--mst) var mode = modes.NORMAL; var extended_mode = modes.NONE;