diff --git a/Applications/MineCode IDE.app/Main.lua b/Applications/MineCode IDE.app/Main.lua index 23991a50..23c439a4 100755 --- a/Applications/MineCode IDE.app/Main.lua +++ b/Applications/MineCode IDE.app/Main.lua @@ -1380,7 +1380,7 @@ local function createEditOrRightClickMenu(menu) end local function checkScrollbar(y) - return codeView.horizontalScrollBar.hidden or y < codeView.y + codeView.height - 1 + return not codeView.horizontalScrollBar.hidden or y >= codeView.y + codeView.height - 1 end local uptime = computer.uptime() @@ -1388,10 +1388,12 @@ codeView.eventHandler = function(workspace, object, e1, e2, e3, e4, e5) if e1 == "touch" then e3, e4 = math.ceil(e3), math.ceil(e4) - if not checkScrollbar(e4) then + if checkScrollbar(e4) then return end + GUI.alert("aefaf") + if e5 == 1 then createEditOrRightClickMenu(GUI.addContextMenu(workspace, e3, e4)) else @@ -1407,7 +1409,7 @@ codeView.eventHandler = function(workspace, object, e1, e2, e3, e4, e5) elseif e1 == "drag" then e3, e4 = math.ceil(e3), math.ceil(e4) - if not checkScrollbar(e4) then + if checkScrollbar(e4) then return end diff --git a/Libraries/Event.lua b/Libraries/Event.lua index b067e1ef..8598d9a4 100755 --- a/Libraries/Event.lua +++ b/Libraries/Event.lua @@ -13,7 +13,7 @@ local event, handlers, interruptingKeysDown, lastInterrupt = { push = computer.pushSignal }, {}, {}, 0 -event.interruptingFunction = event.defaultInterruptingDFunction +event.interruptingFunction = event.defaultInterruptingFunction local computerPullSignal, computerUptime, mathHuge, mathMin, skipSignalType = computer.pullSignal, computer.uptime, math.huge, math.min diff --git a/Libraries/System.lua b/Libraries/System.lua index 52d06450..f7965dbb 100755 --- a/Libraries/System.lua +++ b/Libraries/System.lua @@ -1761,10 +1761,12 @@ end -------------------------------------------------------------------------------- -local function updateMenu() +local function updateDesktopMenuAndGetTopmostWindow() local topmostWindow = desktopWindowsContainer.children[#desktopWindowsContainer.children] desktopMenu.children = topmostWindow and topmostWindow.menu.children or system.menuInitialChildren + + return topmostWindow end local function setWorkspaceHidden(state) @@ -1816,7 +1818,7 @@ local function windowRemove(window) -- Удаляем само окошко table.remove(window.parent.children, window:indexOf()) - updateMenu() + GUI.focusedObject = updateDesktopMenuAndGetTopmostWindow() end function system.addWindow(window, dontAddToDock, preserveCoordinates) @@ -1887,10 +1889,10 @@ function system.addWindow(window, dontAddToDock, preserveCoordinates) end -- Когда окно фокусицца, то главная ОСевая менюха заполницца ДЕТИШЕЧКАМИ оконной менюхи - window.onFocus = updateMenu + window.onFocus = updateDesktopMenuAndGetTopmostWindow -- Заполняем главную менюху текущим окном - updateMenu() + updateDesktopMenuAndGetTopmostWindow() break end