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

Feishu app keeps focus after switching to another window #852

Closed
alt-tab-macos-bot opened this issue Mar 1, 2021 · 6 comments
Closed

Feishu app keeps focus after switching to another window #852

alt-tab-macos-bot opened this issue Mar 1, 2021 · 6 comments
Labels
bug Something isn't working need breakthrough Need a breakthrough idea to move forwards

Comments

@alt-tab-macos-bot
Copy link

This issue was opened by a bot after a user submitted feedback through the in-app form.

From: [email protected]

Message:

When using feishu(https://www.feishu.cn/download), altTab can't change window normally. For example, open 3 windows, window A, window B and feishu. Change to feishu, then B, then A, then feishu, then A, this step will fail, feishu will stay at the front of the screen.

Debug profile

  • App version: 6.17.0
  • App preferences:
    • MSAppCenter310AppCenterUserDefaultsMigratedKey: 1
    • MSAppCenter310CrashesUserDefaultsMigratedKey: 1
    • MSAppCenterInstallId: 9FA972DA-0989-4C25-A84F-FD87DDB42F75
    • MSAppCenterPastDevices: {length = 1132, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000037a }
    • MSAppCenterSessionIdHistory: {length = 452, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000014e }
    • MSAppCenterUserIdHistory: {length = 447, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 00000149 }
    • NSWindow Frame SUAutomaticUpdateAlert: 652 656 616 180 0 0 1920 1055
    • NSWindow Frame SUUpdateAlert: 650 497 620 392 0 0 1920 1055
    • NSWindow Frame com.sindresorhus.Preferences.FrameAutosaveName: 714 259 491 577 0 0 1920 1057
    • SUAutomaticallyUpdate: 1
    • SUEnableAutomaticChecks: 1
    • SUHasLaunchedBefore: 1
    • SULastCheckTime: 2021-03-01 13:57:47 +0000
    • SUUpdateGroupIdentifier: 2652446248
    • SUUpdateRelaunchingMarker: 0
    • alignThumbnails: 1
    • appsToShow: 0
    • crashPolicy: 2
    • fadeOutAnimation: false
    • hideAppBadges: false
    • hideColoredCircles: true
    • hideSpaceNumberLabels: false
    • hideStatusIcons: false
    • hideThumbnails: false
    • hideWindowlessApps: false
    • holdShortcut: ⌘
    • maxCellsPerRow: 7
    • maxHeightOnScreen: 70
    • maxScreenUsage: 70
    • maxWidthOnScreen: 70
    • menubarIcon: 2
    • minCellsPerRow: 5
    • mouseHoverEnabled: false
    • nextWindowShortcut: ⇥
    • preferencesVersion: 6.17.0
    • screensToShow: 0
    • showOnScreen: 2
    • showTabsAsWindows: false
    • spacesToShow: 0
    • startAtLogin: false
    • theme: 1
    • titleTruncation: 0
    • updatePolicy: 2
    • windowMaxWidthInRow: 30
  • Applications: 50
  • Windows: 13
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
  • OS version: 版本10.16(版号20C69)
  • OS architecture: x86_64
  • Locale: zh_CN (current)
  • Spaces: 2
  • Dark mode: Light
  • "Displays have separate Spaces": checked
  • Hardware model: MacBookPro16,1
  • Screens: 1
    • {x: 0.0, y: 0.0, width: 1920.0, height: 1080.0}
  • CPU model: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  • Memory size: 17.18 GB
  • Active CPU count: 12
  • Current CPU frequency: 2.6 Ghz
  • Resource utilization:
    • CPU: 0.0%
    • Memory: 80M-
    • Threads count: 10

@lwouis
Copy link
Owner

lwouis commented Mar 2, 2021

I was able to reproduce!

We had a ticket in the past (#836) but I couldn't understand. But this time I understood it's not about an issue not showing windows, it's an issue where while Feishu is focused, it's impossible to focus back to another app using AltTab.

Reproduction steps:

  • Open Feishu (login window is ok; no need to login)
  • Alt-tab, and try to switch to another app
  • Top menubar flickers as the focus comes back to Feishu

@lwouis lwouis added the bug Something isn't working label Mar 2, 2021
@lwouis
Copy link
Owner

lwouis commented Mar 2, 2021

The issue seems to be that the private API _SLPSSetFrontProcessWithOptions doesn't remove key focus from the currently focused window (only for Feishu for some reason). This means that both the Feishu window and the next focused window appear to have key focus. Yet only the newly focused window has it really. Seems like an artifact of using this private API. It must not be cleaning some internal state properly, compared to using NSRunningApplication.activate.

Now the reason we use this private API in the first place is because NSRunningApplication.activate doesn't let us focus a window on another Space.

I think the way to move forward with this issue is to implement #447

@lwouis
Copy link
Owner

lwouis commented Mar 2, 2021

@wrdcz this is Github. You can use Github notifications, receive emails from github, come to the page every day. It's up to you. This website is a community website like a forum. This is not customer service from a commercial company. There is no deadline and guarantees. This project is mainly volunteer work from me, on my weekends.

@lwouis
Copy link
Owner

lwouis commented Mar 3, 2021

I spent many hours today trying to use the technique of invisible windows discussed in #447, to avoid having to use private APIs to focus other-Space windows.

I can't beat the current implementation. Focusing an invisible window works for switching to another Space. That's pretty cool. However, it doesn't handle 1 use-case that the private APIs currently do:

  • User has 2 windows from the same app (Finder for example), each window on a different Space
  • User focuses another app than Finder
  • User uses AltTab to focus the Finder window on the other Space
  • At this point, with the public APIs, the Finder window on the current Space will be raised

This is because we need to activate the app to give it key focus, but when we do, the latest key window gets activated as well.

I tried a million combinations of all 6 or 7 APIs involved, in different orders. I can't find a way to make it work as nicely as the current implementation.

Since the current implementation works for every app except Feishu, that's another incentive not to change it also.

I'll mark this as Need breakthrough

@lwouis lwouis added the need breakthrough Need a breakthrough idea to move forwards label Mar 3, 2021
@lwouis lwouis changed the title [In-app feedback] Feishu app keeps focus after switching to another window Mar 3, 2021
@lwouis
Copy link
Owner

lwouis commented Apr 17, 2021

Closing in favor of #922 where the overarching issue can be addressed

@lwouis lwouis closed this as completed Apr 17, 2021
@heyppen
Copy link

heyppen commented Apr 24, 2021

Feishu has fixed this issue since V3.47.0

If anyone has the same problem, please upgrade Feishu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need breakthrough Need a breakthrough idea to move forwards
Projects
None yet
Development

No branches or pull requests

3 participants