sidebery icon indicating copy to clipboard operation
sidebery copied to clipboard

Odd behavior on window unfocus

Open hmnd opened this issue 3 years ago • 8 comments

Steps to reproduce

  • Open Firefox in new profile
  • Install Sidebery
  • Open two tabs
  • Drag one of the tabs within Sidebery
  • Switch to a different window/application
  • Switch back to your Firefox window

Expected behavior

Sidebery behaves as normal

Actual behavior

Sidebery becomes stuck in dragging mode until a tab is dragged or Sidebery is restarted. This behavior continues to occur without any further tab dragging, even after the sidebar is closed and reopened and only goes away after a browser restart.

Debug info

https://user-images.githubusercontent.com/12853597/196543790-57b5f455-ca12-426d-a971-670753f3899f.mp4

Addon data { "settings": { "nativeScrollbars": false, "nativeScrollbarsThin": true, "nativeScrollbarsLeft": false, "selWinScreenshots": false, "updateSidebarTitle": true, "markWindow": false, "markWindowPreface": "[Sidebery] ", "ctxMenuNative": false, "ctxMenuRenderInact": true, "ctxMenuRenderIcons": true, "ctxMenuIgnoreContainers": "", "navBarLayout": "horizontal", "navBarInline": true, "navBarSide": "left", "hideAddBtn": false, "hideSettingsBtn": false, "navBtnCount": true, "hideEmptyPanels": true, "navActTabsPanelLeftClickAction": "none", "navActBookmarksPanelLeftClickAction": "none", "navTabsPanelMidClickAction": "none", "navBookmarksPanelMidClickAction": "none", "navSwitchPanelsWheel": true, "groupLayout": "grid", "skipEmptyPanels": false, "dndTabAct": true, "dndTabActDelay": 750, "dndTabActMod": "none", "dndExp": "pointer", "dndExpDelay": 750, "dndExpMod": "none", "dndOutside": "win", "searchBarMode": "dynamic", "warnOnMultiTabClose": "collapsed", "activateLastTabOnPanelSwitching": true, "showTabRmBtn": true, "hideInact": false, "activateAfterClosing": "next", "activateAfterClosingGlobal": false, "activateAfterClosingNoFolded": true, "activateAfterClosingNoDiscarded": true, "askNewBookmarkPlace": true, "tabsRmUndoNote": true, "nativeHighlight": false, "tabsUnreadMark": false, "tabsUpdateMark": "all", "tabsReloadLimit": 5, "tabsReloadLimitNotif": true, "showNewTabBtns": true, "newTabBarPosition": "after_tabs", "tabsPanelSwitchActMove": false, "tabsUrlInTooltip": "full", "openSubPanelOnMouseHover": false, "colorizeTabs": false, "colorizeTabsSrc": "domain", "moveNewTabPin": "start", "moveNewTabParent": "last_child", "moveNewTabParentActPanel": false, "moveNewTab": "end", "moveNewTabActivePin": "start", "pinnedTabsPosition": "panel", "pinnedTabsList": false, "pinnedAutoGroup": false, "tabsTree": true, "groupOnOpen": true, "tabsTreeLimit": "none", "hideFoldedTabs": false, "autoFoldTabs": false, "autoFoldTabsExcept": "none", "autoExpandTabs": false, "rmChildTabs": "none", "tabsChildCount": true, "tabsLvlDots": false, "discardFolded": false, "discardFoldedDelay": 0, "discardFoldedDelayUnit": "sec", "tabsTreeBookmarks": true, "treeRmOutdent": "branch", "colorizeTabsBranches": false, "colorizeTabsBranchesSrc": "url", "warnOnMultiBookmarkDelete": "collapsed", "autoCloseBookmarks": false, "autoRemoveOther": false, "highlightOpenBookmarks": false, "activateOpenBookmarkTab": false, "showBookmarkLen": false, "bookmarksRmUndoNote": true, "loadBookmarksOnDemand": true, "pinOpenedBookmarksFolder": true, "loadHistoryOnDemand": true, "fontSize": "m", "animations": true, "animationSpeed": "norm", "theme": "proton", "colorScheme": "ff", "sidebarCSS": false, "groupCSS": false, "snapNotify": true, "snapExcludePrivate": false, "snapInterval": 0, "snapIntervalUnit": "min", "snapLimit": 0, "snapLimitUnit": "snap", "hScrollAction": "none", "navSwitchPanelsDelay": 128, "scrollThroughTabs": "none", "scrollThroughVisibleTabs": false, "scrollThroughTabsSkipDiscarded": false, "scrollThroughTabsExceptOverflow": true, "scrollThroughTabsCyclic": false, "scrollThroughTabsScrollArea": 0, "autoMenuMultiSel": true, "multipleMiddleClose": false, "longClickDelay": 500, "wheelThreshold": false, "wheelThresholdX": 10, "wheelThresholdY": 60, "tabDoubleClick": "none", "tabsSecondClickActPrev": true, "shiftSelAct": true, "activateOnMouseUp": false, "tabLongLeftClick": "none", "tabLongRightClick": "none", "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, "bookmarksMidClickPos": "default", "syncName": "", "syncSaveSettings": false, "syncSaveCtxMenu": false, "syncSaveStyles": false, "syncSaveKeybindings": false }, "permissions": { "allUrls": false, "tabHide": false, "clipboardWrite": false, "webRequest": false, "webRequestBlocking": false }, "storage": { "size": "4.86 kb", "props": { "containers": "1.25 kb", "favDomains": "213 b", "favHashes": "34 b", "favicons": "1.62 kb", "panelIndex": "1 b", "prevTabsDataCache": "242 b", "profileID": "14 b", "sidebar": "1.01 kb", "tabsDataCache": "355 b", "ver": "10 b" } }, "sidebar": { "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 }, "firefox-default": { "type": 2, "id": "firefox-default", "name": "len: 7", "color": "toolbar", "iconSVG": "icon_tabs", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": false, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "", "bookmarksFolderId": -1, "newTabBtns": [] }, "KQaIsLUdyv2S": { "type": 2, "id": "KQaIsLUdyv2S", "name": "len: 11", "color": "toolbar", "iconSVG": "icon_tabs", "iconIMGSrc": "", "iconIMG": "", "lockedPanel": false, "skipOnSwitching": false, "noEmpty": false, "newTabCtx": "none", "dropTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "", "bookmarksFolderId": -1, "newTabBtns": [] } }, "nav": [ "bookmarks", "firefox-default", "KQaIsLUdyv2S", "add_tp", "sp-0", "settings" ] }, "containers": [ { "id": "firefox-container-1", "cookieStoreId": "firefox-container-1", "name": "8", "icon": "...", "color": "blue", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-2", "cookieStoreId": "firefox-container-2", "name": "4", "icon": "...", "color": "orange", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-3", "cookieStoreId": "firefox-container-3", "name": "7", "icon": "...", "color": "green", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" }, { "id": "firefox-container-4", "cookieStoreId": "firefox-container-4", "name": "8", "icon": "...", "color": "pink", "colorCode": "#37adff", "proxified": false, "proxy": null, "includeHostsActive": false, "includeHosts": "", "excludeHostsActive": false, "excludeHosts": "", "userAgentActive": false, "userAgent": "" } ], "windows": [ { "state": "normal", "incognito": false, "tabsCount": 3 } ], "bookmarks": { "bookmarksCount": 11, "foldersCount": 6, "separatorsCount": 1, "maxDepth": 2 } }

hmnd avatar Oct 18 '22 21:10 hmnd

I can't reproduce this issue, what version of Firefox are you using? Are you using Wayland or x11?

mbnuqw avatar Oct 21 '22 08:10 mbnuqw

@mbnuqw I've been able to repro both on Firefox stable (106.0) and beta (107.0b1). Should've mentioned I'm on Wayland.

hmnd avatar Oct 21 '22 16:10 hmnd

I have been running into this for some days now as well, also on wayland here

Erk- avatar Oct 24 '22 13:10 Erk-

I can confirm the same behavior as well, also on Wayland, Firefox 106.0.1, Sidebery 4.10.2

msmol avatar Oct 25 '22 19:10 msmol

I tried to repro the issue in Wayland(kde) with no success, so I've prepared some additional logs in v5.0.0b28. Could anyone with this issue share them?

To get the logs:

  • Open about:devtools-toolbox?id=%7B3c078156-979c-498b-8990-85f7987dd929%7D&type=extension
  • Click on the rectangular icon (with three sections) in the top-right area of the debugger page
  • Select sidebar/sidebar.html
  • In Console tab run sideberyLogsDnD = true to activate logs
  • Reproduce the issue
  • Copy and save logs
  • Run getSideberyState()
  • Expand result object, right click on the "Object" followed by "DnD" field and select "Copy Object"
  • Share the result logs and DnD state object

mbnuqw avatar Nov 01 '22 18:11 mbnuqw

@mbnuqw please see below. It seems that DnD gets an erroneous start event when switching away from Firefox. I started looking into what could be going on myself, and I found that calling reset() after start() fixed the issue but broke dragging tabs between browser windows; didn't have time to continue looking into it unfortunately.

Logs

[sidebar:1] DnD.start chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter null null chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter tab 1 chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragLeave: !!e?.relatedTarget: true chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDrop chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.dropEventWasConsumed chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnd chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetDragPointer chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.reset chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetDragPointer chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.reset chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetOther chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.start chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter null null chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter tab 1 chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragLeave: !!e?.relatedTarget: true chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDrop chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.dropEventWasConsumed chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnd chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetDragPointer chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.reset chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetDragPointer chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.reset chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.resetOther chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter tab 2 chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter: From outside chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.onDragEnter: From outside: Native chunk-ARMHQ3QF.js:1418:11
[sidebar:1] DnD.start chunk-ARMHQ3QF.js:1418:11
state.DnD
{
  "dropEventConsumed": false,
  "items": [],
  "isExternal": true,
  "goOutside": false,
  "startX": 156,
  "startY": 121,
  "srcType": 4,
  "srcIncognito": false,
  "srcPin": false,
  "srcWinId": -1,
  "srcPanelId": -1,
  "srcIndex": -1,
  "dragEndedRecently": false
}

hmnd avatar Nov 01 '22 20:11 hmnd

@hmnd, thank you for the info. Yes, it looks like the "dragenter" event is fired right after the end of drag and drop, which triggers the "onDragEnter > start". What version of plasma are you using? I'll try to find maybe there is a bug in plasma and try to reproduce it again.

mbnuqw avatar Nov 02 '22 10:11 mbnuqw

I am using the latest version of Plasma from the arch repos (5.26.2), I only experience it if I run Firefox with MOZ_ENABLE_WAYLAND=1 so ensure you start it with that as well.

Erk- avatar Nov 02 '22 10:11 Erk-

I have the same issue. It also frequently causes unintended tab switches every time I focus another window and focus back to Firefox, which is very annoying.

I'm also using Plasma Wayland, and I'm running Firefox in native Wayland mode.

KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7 Firefox version: 107.0b9

Compizfox avatar Nov 05 '22 14:11 Compizfox

Yes, as @albino1 kindly pointed out to me after i'd raised my own Issue on this, i'm also having this annoying problem in Plasma Wayland sessions.

guigirl42 avatar Nov 07 '22 06:11 guigirl42

Should be fixed in v5.0.0b29, please check

mbnuqw avatar Nov 10 '22 05:11 mbnuqw

@mbnuqw fixed, thank you!!

hmnd avatar Nov 10 '22 05:11 hmnd

@hmnd, I'll leave this issue open because v4 is still subject to this bug.

mbnuqw avatar Nov 10 '22 05:11 mbnuqw

fixed in v5.0.0b29, please check

Woohoo, brilliant, tis all fine again, thanks so much.

guigirl42 avatar Nov 10 '22 06:11 guigirl42

@mbnuqw hmm, this issue still seems to be happening sporadically. Not sure how to consistently reproduce yet though...

hmnd avatar Nov 17 '22 00:11 hmnd

... still seems to be happening sporadically...

Oh! So far it's been fine here [Nightly, PlasmaWayland5.26.3], but now seeing you still have some problems i feel slightly apprehensive... 😱

guigirl42 avatar Nov 17 '22 02:11 guigirl42

I have been experiencing this same behavior, but with Tree Style Tab. Except with that it would also sometimes activate tabs at random as well. It started at the same time Deadbeef developed an issue where it thought I was constantly dragging tracks around. Not sure at this point what update those issues started with, but since Firefox and Deadbeef are GTK applications I'm assuming there's a greater issue at play?

Switched to Sidebery and 4.10.2 did have OP's example. 5.0.0b29 seems fine so far. Using KDE Wayland.

Update: I have gotten several instances of a tab move line upon refocusing, but it's extremely rare. Still haven't had a different tab activate itself.

DonKatsu avatar Jan 20 '23 00:01 DonKatsu

Except with that it would also sometimes activate tabs at random as well.

@DonKatsu I've actually experience this in Firefox without any tab management addons enabled too. It's gotten annoying to the point that I've switched to Chrome as my primary browser for now. I haven't been able to find an existing issue for it on Firefox's bug tracker; have you? If not, one of us should probably report it :).

hmnd avatar Jan 20 '23 02:01 hmnd

@hmnd I tried searching the KDE and Firefox bugtrackers but couldn't find anything relevant either. Not sure where to begin honestly.

DonKatsu avatar Jan 20 '23 06:01 DonKatsu

Unfortunately still happening

https://user-images.githubusercontent.com/12853597/233712942-ef1895fc-128a-49c1-af58-17a82afc02c8.mp4

hmnd avatar Apr 21 '23 18:04 hmnd