mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 09:37:58 +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
|
// track if a popup is open or the menubar is active
|
||||||
//
|
//
|
||||||
|
|
||||||
var popup_count = 0;
|
|
||||||
var active_menubar = false;
|
var active_menubar = false;
|
||||||
|
|
||||||
function enterPopupMode()
|
function enterPopupMode()
|
||||||
{
|
{
|
||||||
popup_count++;
|
|
||||||
vimperator.log("Open popup window count: " + popup_count, 9);
|
|
||||||
vimperator.addMode(null, vimperator.modes.MENU);
|
vimperator.addMode(null, vimperator.modes.MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitPopupMode()
|
function exitPopupMode()
|
||||||
{
|
{
|
||||||
popup_count--;
|
// gContextMenu is set to NULL by firefox, when a context menu is closed
|
||||||
vimperator.log("Open popup window count: " + popup_count, 9);
|
if (!gContextMenu && !active_menubar)
|
||||||
if (popup_count == 0)
|
|
||||||
vimperator.removeMode(null, vimperator.modes.MENU);
|
vimperator.removeMode(null, vimperator.modes.MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enterMenuMode()
|
function enterMenuMode()
|
||||||
{
|
{
|
||||||
active_menubar = true;
|
active_menubar = true;
|
||||||
vimperator.log("Menubar is active", 9);
|
|
||||||
vimperator.addMode(null, vimperator.modes.MENU)
|
vimperator.addMode(null, vimperator.modes.MENU)
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitMenuMode()
|
function exitMenuMode()
|
||||||
{
|
{
|
||||||
active_menubar = false;
|
active_menubar = false;
|
||||||
vimperator.log("Menubar is inactive", 9);
|
|
||||||
vimperator.removeMode(null, vimperator.modes.MENU);
|
vimperator.removeMode(null, vimperator.modes.MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -688,6 +688,9 @@ function Hints() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.document.addEventListener("DOMContentLoaded", initDoc, null);
|
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
|
// FIXME: add resize support
|
||||||
//window.addEventListener("resize", onResize, null);
|
//window.addEventListener("resize", onResize, null);
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ const vimperator = (function() //{{{
|
|||||||
mode_messages[modes.QUICK_HINT] = "quick";
|
mode_messages[modes.QUICK_HINT] = "quick";
|
||||||
mode_messages[modes.EXTENDED_HINT] = "extended";
|
mode_messages[modes.EXTENDED_HINT] = "extended";
|
||||||
mode_messages[modes.ALWAYS_HINT] = "always";
|
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 mode = modes.NORMAL;
|
||||||
var extended_mode = modes.NONE;
|
var extended_mode = modes.NONE;
|
||||||
|
|||||||
Reference in New Issue
Block a user