Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middle-Clicking Tab Above Media-Playing Tab Erroneously Pauses Media-Playing Tab During Close Animation #1283

Closed
TheV360 opened this issue Sep 26, 2023 · 3 comments

Comments

@TheV360
Copy link

TheV360 commented Sep 26, 2023

Steps to reproduce

  1. Have at least two tabs open. One tab above the other, so that when you close it, the lower tab slides up during the close animation.
  2. Start playing media in the lower tab so that the 🔊 icon button appears.
  3. Close the above tab.

Expected behavior

  • The above tab closes without impacting anything else.

Actual behavior

  • The lower tab's media is paused (which seems to be a special feature of the 🔊 icon button, which is neat!!) without it being as another click.
    • This is not related to my mouse, nor does it stop when I change the length of time I click the middle mouse button for.
    • I had a moment of panic where I thought it was indeed my mouse, but it turns out that my touchpad with buttons sends the press and release button events so quickly that this bug is not triggered. I've tested it with two different USB mice (one wireless and the other wired)
    • It does actually seem to not activate if you're fast enough, but we're talking "1 frame" vs "2 frames" here.

Might be that the close tab gets the mousedown event, and the icon button gets the click/mouseup event?

Screencast.from.2023-09-26.15-57-54.webm

Apologies that the GNOME screen recorder doesn't show clicks. I middle clicked once (per tab closing) in this video. I tried to find a good mouse event visualizer to re-record and update the above video, but screenkey doesn't work with Wayland and everything else was made in 2010 and has never been updated.

Debug info

Addon data
{
  "addonVersion": "5.0.0",
  "firefoxVersion": "117.0.1",
  "settings": {
    "nativeScrollbars": true,
    "nativeScrollbarsThin": true,
    "nativeScrollbarsLeft": true,
    "selWinScreenshots": false,
    "updateSidebarTitle": true,
    "markWindow": true,
    "markWindowPreface": "",
    "ctxMenuNative": true,
    "ctxMenuRenderInact": false,
    "ctxMenuRenderIcons": true,
    "ctxMenuIgnoreContainers": "",
    "navBarLayout": "hidden",
    "navBarInline": false,
    "navBarSide": "left",
    "hideAddBtn": true,
    "hideSettingsBtn": false,
    "navBtnCount": false,
    "hideEmptyPanels": true,
    "hideDiscardedTabPanels": false,
    "navActTabsPanelLeftClickAction": "none",
    "navActBookmarksPanelLeftClickAction": "none",
    "navTabsPanelMidClickAction": "discard",
    "navBookmarksPanelMidClickAction": "none",
    "navSwitchPanelsWheel": true,
    "subPanelRecentlyClosedBar": false,
    "subPanelBookmarks": false,
    "subPanelHistory": false,
    "groupLayout": "list",
    "containersSortByName": false,
    "skipEmptyPanels": false,
    "dndTabAct": false,
    "dndTabActDelay": 750,
    "dndTabActMod": "none",
    "dndExp": "none",
    "dndExpDelay": 0,
    "dndExpMod": "none",
    "dndOutside": "win",
    "dndActTabFromLink": true,
    "dndActSearchTab": true,
    "dndMoveTabs": false,
    "dndMoveBookmarks": false,
    "searchBarMode": "dynamic",
    "searchPanelSwitch": "same_type",
    "searchBookmarksShortcut": "",
    "searchHistoryShortcut": "",
    "warnOnMultiTabClose": "collapsed",
    "activateLastTabOnPanelSwitching": true,
    "activateLastTabOnPanelSwitchingLoadedOnly": true,
    "switchPanelAfterSwitchingTab": "always",
    "tabRmBtn": "none",
    "activateAfterClosing": "next",
    "activateAfterClosingStayInPanel": false,
    "activateAfterClosingGlobal": false,
    "activateAfterClosingNoFolded": true,
    "activateAfterClosingNoDiscarded": true,
    "askNewBookmarkPlace": false,
    "tabsRmUndoNote": true,
    "tabsUnreadMark": false,
    "tabsUpdateMark": "all",
    "tabsUpdateMarkFirst": true,
    "tabsReloadLimit": 5,
    "tabsReloadLimitNotif": true,
    "showNewTabBtns": false,
    "newTabBarPosition": "bottom",
    "tabsPanelSwitchActMove": true,
    "tabsPanelSwitchActMoveAuto": true,
    "tabsUrlInTooltip": "full",
    "newTabCtxReopen": false,
    "tabWarmupOnHover": true,
    "tabSwitchDelay": 0,
    "moveNewTabPin": "start",
    "moveNewTabParent": "last_child",
    "moveNewTabParentActPanel": false,
    "moveNewTab": "end",
    "moveNewTabActivePin": "start",
    "pinnedTabsPosition": "panel",
    "pinnedTabsList": true,
    "pinnedAutoGroup": false,
    "pinnedNoUnload": false,
    "tabsTree": true,
    "groupOnOpen": true,
    "tabsTreeLimit": 4,
    "autoFoldTabs": false,
    "autoFoldTabsExcept": "none",
    "autoExpandTabs": false,
    "autoExpandTabsOnNew": false,
    "rmChildTabs": "none",
    "tabsLvlDots": true,
    "discardFolded": false,
    "discardFoldedDelay": 0,
    "discardFoldedDelayUnit": "sec",
    "tabsTreeBookmarks": true,
    "treeRmOutdent": "branch",
    "ignoreFoldedParent": false,
    "colorizeTabs": false,
    "colorizeTabsSrc": "domain",
    "colorizeTabsBranches": false,
    "colorizeTabsBranchesSrc": "url",
    "inheritCustomColor": true,
    "hideInact": false,
    "hideFoldedTabs": false,
    "hideFoldedParent": "none",
    "nativeHighlight": false,
    "warnOnMultiBookmarkDelete": "collapsed",
    "autoCloseBookmarks": false,
    "autoRemoveOther": false,
    "highlightOpenBookmarks": false,
    "activateOpenBookmarkTab": false,
    "showBookmarkLen": false,
    "bookmarksRmUndoNote": true,
    "loadBookmarksOnDemand": true,
    "pinOpenedBookmarksFolder": true,
    "oldBookmarksAfterSave": "ask",
    "loadHistoryOnDemand": true,
    "fontSize": "xxs",
    "animations": true,
    "animationSpeed": "fast",
    "theme": "proton",
    "density": "default",
    "colorScheme": "sys",
    "sidebarCSS": true,
    "groupCSS": false,
    "snapNotify": true,
    "snapExcludePrivate": false,
    "snapInterval": 0,
    "snapIntervalUnit": "min",
    "snapLimit": 0,
    "snapLimitUnit": "snap",
    "snapAutoExport": false,
    "snapAutoExportType": "json",
    "snapAutoExportPath": "Sidebery/snapshot-%Y.%M.%D-%h.%m.%s",
    "snapMdFullTree": false,
    "hScrollAction": "switch_panels",
    "navSwitchPanelsDelay": 128,
    "scrollThroughTabs": "panel",
    "scrollThroughVisibleTabs": true,
    "scrollThroughTabsSkipDiscarded": false,
    "scrollThroughTabsExceptOverflow": true,
    "scrollThroughTabsCyclic": true,
    "scrollThroughTabsScrollArea": 0,
    "autoMenuMultiSel": true,
    "multipleMiddleClose": false,
    "longClickDelay": 500,
    "wheelThreshold": false,
    "wheelThresholdX": 10,
    "wheelThresholdY": 60,
    "tabDoubleClick": "new_child",
    "tabsSecondClickActPrev": false,
    "tabsSecondClickActPrevPanelOnly": false,
    "shiftSelAct": true,
    "activateOnMouseUp": true,
    "tabLongLeftClick": "none",
    "tabLongRightClick": "none",
    "tabMiddleClick": "close",
    "tabMiddleClickCtrl": "discard",
    "tabMiddleClickShift": "duplicate",
    "tabCloseMiddleClick": "close",
    "tabsPanelLeftClickAction": "none",
    "tabsPanelDoubleClickAction": "tab",
    "tabsPanelRightClickAction": "menu",
    "tabsPanelMiddleClickAction": "tab",
    "newTabMiddleClickAction": "new_child",
    "bookmarksLeftClickAction": "open_in_act",
    "bookmarksLeftClickActivate": false,
    "bookmarksLeftClickPos": "default",
    "bookmarksMidClickAction": "open_in_new",
    "bookmarksMidClickActivate": false,
    "bookmarksMidClickRemove": false,
    "bookmarksMidClickPos": "default",
    "historyLeftClickAction": "open_in_act",
    "historyLeftClickActivate": false,
    "historyLeftClickPos": "default",
    "historyMidClickAction": "open_in_new",
    "historyMidClickActivate": false,
    "historyMidClickPos": "default",
    "syncName": "",
    "syncSaveSettings": true,
    "syncSaveCtxMenu": true,
    "syncSaveStyles": true,
    "syncSaveKeybindings": false,
    "selectActiveTabFirst": true
  },
  "permissions": {
    "allUrls": true,
    "webRequest": true,
    "webRequestBlocking": true,
    "proxy": true,
    "tabHide": false,
    "clipboardWrite": true,
    "history": false,
    "bookmarks": true,
    "downloads": false
  },
  "storage": {
    "size": "210 kb",
    "props": {
      "containers": "540 b",
      "contextMenu": "1.24 kb",
      "disabledKeybindings": "2 b",
      "favDomains": "10.5 kb",
      "favHashes": "2.7 kb",
      "favicons_01": "188 kb",
      "favicons_02": "2 b",
      "favicons_03": "2 b",
      "favicons_04": "2 b",
      "favicons_05": "2 b",
      "groupCSS": "260 b",
      "profileID": "14 b",
      "settings": "4.8 kb",
      "sidebar": "667 b",
      "sidebarCSS": "439 b",
      "tabsDataCache": "880 b",
      "ver": "7 b"
    }
  },
  "sidebar": {
    "nav": [
      "firefox-default",
      "sp-0",
      "settings"
    ],
    "panels": {
      "bookmarks": {
        "type": 1,
        "id": "bookmarks",
        "name": "len: 9",
        "iconSVG": "icon_bookmarks",
        "iconIMGSrc": "",
        "iconIMG": "",
        "color": "toolbar",
        "lockedPanel": false,
        "tempMode": false,
        "skipOnSwitching": false,
        "rootId": "root________",
        "viewMode": "tree",
        "autoConvert": false,
        "srcPanelConfig": null
      },
      "firefox-default": {
        "type": 2,
        "id": "firefox-default",
        "name": "len: 7",
        "color": "toolbar",
        "iconSVG": "icon_tabs",
        "iconIMGSrc": "",
        "iconIMG": "",
        "lockedPanel": false,
        "skipOnSwitching": false,
        "noEmpty": false,
        "newTabCtx": "none",
        "dropTabCtx": "none",
        "moveRules": [],
        "moveExcludedTo": -1,
        "bookmarksFolderId": -1,
        "newTabBtns": [],
        "srcPanelConfig": null
      }
    }
  },
  "containers": [
    {
      "id": "firefox-container-6",
      "cookieStoreId": "firefox-container-6",
      "name": "6",
      "icon": "...",
      "color": "red",
      "colorCode": "#37adff",
      "proxified": false,
      "proxy": null,
      "reopenRulesActive": false,
      "reopenRules": [],
      "userAgentActive": false,
      "userAgent": ""
    },
    {
      "id": "firefox-container-7",
      "cookieStoreId": "firefox-container-7",
      "name": "5",
      "icon": "...",
      "color": "blue",
      "colorCode": "#37adff",
      "proxified": false,
      "proxy": null,
      "reopenRulesActive": false,
      "reopenRules": [],
      "userAgentActive": false,
      "userAgent": ""
    }
  ],
  "sidebarCSSLen": "415",
  "groupCSSLen": "249",
  "windows": [
    {
      "state": "maximized",
      "incognito": false,
      "tabsCount": 6
    }
  ],
  "bookmarks": {
    "bookmarksCount": 570,
    "foldersCount": 83,
    "separatorsCount": 6,
    "maxDepth": 6
  }
}
CSS (just in case)
#root.root {--tabs-inner-gap: 4px;}
#root.root {--general-border-radius: 0px;}
#root.root {--tabs-activated-bg: #C096FA3f;}
#root.root {--tabs-activated-shadow: none;}
#root.root {--bg: #232323ff;}
#root.root {--ctx-menu-font: 1rem sans-serif;}

.TabsPanel {
	margin-block: 1rem;
}
.Tab {
	width: 100%;
}
.Tab[data-pin="false"] .ctx {
	width: 2px;
	right: 2px; /* unrelated to width despite them both being 2px */
}

(There is nothing logged to the console when this happens)

@llc0930
Copy link
Contributor

llc0930 commented Sep 26, 2023

You are right, I tried turning off the animation.
The position I clicked was closer to the middle, and then the two tabs below the tab I expected to close were also closed...
Then I turned the animation back on and tried long pressing the middle button... the tabs randomly got closed...
Then I remembered that the micro-switch in the middle button of my mouse had some poor sensitivity, so it would cause double clicks...
It seems that I am not qualified to test this problem yet.

@TheV360
Copy link
Author

TheV360 commented Sep 26, 2023

(Updated my post with more details)
I've been having similar problems with my mouse, hah. It doesn't seem to be impacting the bug, because I've swapped the mouse out for a wired one -- also at one point trying my touchpad with its physical buttons (which doesn't send complete middle-clicks in the first place and is thus disqualified) -- and the bug still exists.
I added some speculation on the cause of the issue to the post too: It might be that the close tab gets the mousedown event, and the icon button gets the click/mouseup event?

@TheV360
Copy link
Author

TheV360 commented Oct 21, 2023

Still running into this problem from time to time. I think I've maybe narrowed it down (I guess I'm not busy enough to not look into code, but too busy to get development extension running) to an interaction between these two things:

And a possible simple fix would to have the onAudioMouseDown event handler also check closeLock before doing things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants