[XembedSNIProxy] Send all container windows to background on KWin restart
ClosedPublic

Authored by kmaterka on Nov 28 2019, 8:08 PM.

Details

Summary

For each tray icon XEmbedSNIProxy is creating container window 32x32 in size. It is black with opaque set to 0 (fully transparent when compositor is enabled). All of these container windows are stacked below all windows, so normally you can't see them. On creation all container windows are created in top-left corner. When user clicks on the tray icon, container window is moved to the click location (to handle events correctly).
On KWin restart all windows are shuffled, usually KWin is able to restore ordering correctly, but for some reason not it this case. As a result black/transparent container windows are stacked above all other windows and panels.
To solve that, on KWin restart, XembedSNIProxy needs to iterate over all known container windows and stack them below again.

BUG: 357443

Test Plan
  1. [Optional] Disable compositor - with disable container window is black and easier to spot
  2. Run any application with XEmbed system tray icon, do not click on the icon
  3. Restart KWin

a) Before: black/transparent rectangle in the top-left corner, reacts to mouse click
b) After: no rectangle, mouse clicks work as expected

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19263
Build 19281: arc lint + arc unit
kmaterka requested review of this revision.Nov 28 2019, 8:08 PM
kmaterka created this revision.
kmaterka updated this revision to Diff 70528.Nov 28 2019, 8:18 PM

Empty line removed

kmaterka edited the test plan for this revision. (Show Details)Nov 28 2019, 8:23 PM
davidedmundson accepted this revision.Nov 29 2019, 12:00 AM

Alternatively, if we need to reset something when our window gets moved...could we watch for our window getting moved?
It'll be the more technically correct, and keeps this code agnostic.

No idea how feasible that is though. Your call.

This revision is now accepted and ready to land.Nov 29 2019, 12:00 AM

Alternatively, if we need to reset something when our window gets moved...could we watch for our window getting moved?
It'll be the more technically correct, and keeps this code agnostic.

No idea how feasible that is though. Your call.

I'm fully aware that this "fix" is an ugly hack. Checking if window moved probably won't work, as window is not moving, it is just stacked above other windows (or all other are stacked below?). In addition, it is probably not a KWin fault. Container window is very strange for KWin, for example it has no window decorations. Maybe it is missing some essential window hint?
Anyway, I will think about this, but firstly I need to learn more about X windows, hints, compositing etc. From the other side XembedSNIProxy should be simple, not as complex as window manager :)

This revision was automatically updated to reflect the committed changes.