mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 05:27:59 +01:00
Fixed menu mode to be reliable in Linux and made it more sane in general
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
} //}}}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user