atom-gtk-dark-theme icon indicating copy to clipboard operation
atom-gtk-dark-theme copied to clipboard

Wrong window's title bar darkened

Open meghprkh opened this issue 9 years ago • 2 comments

This happens when you launch an application just after launching atom.

For example, I open atom using atom . and while that is loading and window is still not shown I open pinta (or any other application with a titlebar, you wont be able to see the difference in a header bar window)

screenshot from 2016-07-25 16-18-17

meghprkh avatar Jul 25 '16 10:07 meghprkh

I have the same issue, because I launch my work applications automatically on startup and atom is launched, then slack and slack get the dark titlebar and atom does not. I have to restart atom to get it to work.

moimael avatar Feb 10 '17 09:02 moimael

This is caused by a race condition that I can't easily fix. The way the titlebar is darkened follows these steps asynchronously:

  1. Get all windows open on the desktop.
  2. Get all process IDs that belong to Atom.
  3. For each window, check if it is owned by any of Atom's process IDs. If so, set the titlebar to dark.

The problem is, Atom could spawn or terminate processes at any point while this is happening, and a PID formerly assigned to Atom could be claimed by a different application.

I'm not sure if this is fixable. This is already an improved version of the strategy used by Sublime Text's GTKDarkThemeVariantSetter, which was subject to even more race condition bugs.

I would say #1 is related, and could solve this problem once and for all.

sagebind avatar Feb 10 '17 15:02 sagebind