Hacker News new | ask | show | jobs
by awirth 3406 days ago
Wow this rabbit hole is impressive. I'll summarize to the best of my understanding (I'm no expert in X).

Basically, chrome uses an X property called _NET_WORKAREA (which is basically supposed to be a rectangle that includes all the parts of the screen that aren't the toolbars) to clip popup menus for dropdowns, so they don't draw over your taskbar or whatever.[1]

Earlier this year, they fixed a race condition so that now they listen for updates to _NET_WORKAREA changes[2], which fixed an issue where the clip area would be wrong for users who hot (un/)plugged extra monitors on relatively "standard" distros like Linux Mint. Basically, you could only see the drop downs on your primary monitor, because _NET_WORKAREA was out of date.

Once this change finally landed in stable, XMonad users noticed that now they couldn't see dropdowns on ANY monitor if they were changing workspaces and had multiple monitors. It turns out that this is because Chrome reads _NET_WORKAREA from the root window, and XMonad (unlike mainstream WMs) uses separate root windows per monitor. Now that Chrome was watching for changes, Xmonad and chrome were miscommunicating with each other about the current clip area. Chrome works around-ish this by only doing the clipping on the primary display[3] "Since that is where the 'desktop chrome' usually lives, this works ok in practice."

The workaround on the XMonad side is to just stop setting _NET_WORKAREA altogether[4], which is the same thing that i3, awesome and qtile do. Note that they had originally set this property in the first place because not having it caused Gtk and Qt malfunctions. To further complicate things, some Display Managers like LightDM set _NET_WORKAREA itself, so XMonad has to actively delete this property when it starts instead of ignoring it altogether.

Anyway, it was a pretty interesting read.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=510079 [2] https://bugs.chromium.org/p/chromium/issues/detail?id=510079... [3] https://bugs.chromium.org/p/chromium/issues/detail?id=510079... [4] https://github.com/xmonad/xmonad-contrib/pull/79#issuecommen...

1 comments

Separate root windows, hmm. Wonder what effect that has one security...