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

Unstyled Scrollbars When Plugging in Mice #18320

Closed
matthewwithanm opened this Issue Oct 24, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@matthewwithanm
Copy link
Member

matthewwithanm commented Oct 24, 2018

Prerequisites

Description

In some situations, scrollbar-style doesn't notice changes to (or report correct values for) preferredScrollStyle.

Related: #15350

cc @hansonw

Steps to Reproduce

  1. Have Magic Mouse active on my computer.
  2. Plug in Logitech M500 (I think?) mouse.
  3. Turn off Magic Mouse.

Expected behavior: [What you expect to happen]

The "scrollbars-visible-always" class is added to the workspace element.

Actual behavior: [What actually happens]

It's not.

Reproduces how often: [What percentage of the time does it reproduce?]

100% with these repro steps.

Versions

MacOS 10.13.6 (High Sierra)

$ atom --version
Atom    : 1.31.1
Electron: 2.0.7
Chrome  : 61.0.3163.100
Node    : 8.9.3
$ apm --version
apm  2.1.1
npm  6.2.0
node 8.9.3 x64
atom 1.31.1
python 2.7.10
git 2.13.5

Additional Information

It turns out that if you do the observation from the main process instead, it does get the correct values! In other words:

const scrollbarStyle = require('scrollbar-style');
const remoteScrollbarStyle = require('electron').remote.require('scrollbar-style');
assert(scrollbarStyle.getPreferredScrollbarStyle() === remoteScrollbarStyle.getPreferredScrollbarStyle()) // throws!

Using remote.require() is the workaround we'll be using in Nuclide until this is fixed in core. It's worth noting, though, that because of Chromium Bug 454346 (which was fixed in Chromium 62—Atom 1.32 uses Chromium 61), this isn't sufficient for a complete fix. The scrollable elements must also be forcefully redrawn. See this commit for more details.

@rsese

This comment has been minimized.

Copy link
Member

rsese commented Oct 29, 2018

Thanks @matthewwithanm 👍 Just noting that I can't reproduce with my setup, I have a Magic Trackpad and some other Logitech mouse on macOS 10.12.6 with Atom 1.34.0-nightly5 (I can still reproduce #15350). After following your repro steps, the scrollbars are still styled and I see the scrollbars-visible-alwaysclass on <atom-workspace>.

Anything I might be missing? Does the macOS scrollbar setting (Always, When Scrolling, etc) matter? I tried both Always and When Scrolling.

@no-response

This comment has been minimized.

Copy link

no-response bot commented Nov 26, 2018

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.