3526
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3525
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3524
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3523
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3522
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3521
|
|
Ensure that we never get a BadWindow due to the sibling in a ConfigureWindow.
Issuing a ConfigureWindow request with a sibling parameter that refers to a sibling that's actually destroyed server side results in a BadWindow error, and causes what we might think is a correct ConfigureWindow request to fail. This would cause even more problems because we had marked the request as succeeding, and adjusted serverWindows appropriately, which would cause further restacks to rely on the invalid internal state.
Unfortunately, this is effectively a race condition between the client and the server. We receive our events and are racing the server to not destroy the window internally before we get a chance to issue a ConfigureWindow request relative to the destroyed window.
Because of that, we need to hold a server grab during the period in which we check if the sibling window is still valid server side and when we issue a ConfigureWindow request. If it is valid, then we can guaruntee that the server will process the request relative to the sibling window, and if not, we can select another sibling as appropriate.
Adjusted the API such that any function which looks for an appropriate sibling or any function which calls XConfigureWindow with the sibling parameter set requires a server grab to be active (by virtue of the fact that they accept a const ServerLock &).
The only implicit contract between clients now is that the client must obtain the sibling window either by using one of the designated functions to do so which requires a ServerLock, or that the client holds a server lock and while it holds the ServerLock, it calls XGetWindowAttributes or XGetGeometry to check if the sibling window is valid.
configureXWindow was split into configureXWindow and restackAndConfigureXWindow. The latter requires a server lock, the former will warn about this potential race condition if you attempt to restack a window using it.
Passing tests:
[ RUN ] CompizXorgSystemStackingTest.TestCreateRelativeToDestroyedWindowFindsAnotherAppropriatePosition [ OK ] CompizXorgSystemStackingTest.TestCreateRelativeToDestroyedWindowFindsAnotherAppropriatePosition (55 ms)
(LP: #1088399)
|
Sam Spilsbury |
11 years ago
|
|
|
3520
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3519
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3518
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3517
|
|
|
Daniel van Vugt |
11 years ago
|
|
|
3516
|
|
|
Daniel van Vugt |
11 years ago
|
|
|
3515
|
|
|
Didier Roche |
11 years ago
|
|
|
3514
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3513
|
|
|
Daniel van Vugt |
11 years ago
|
|
|
3512
|
|
|
Sam Spilsbury |
11 years ago
|
|
|
3511
|
|
|
Daniel van Vugt |
11 years ago
|
|
|
3510
|
|
|
Matija Skala |
11 years ago
|
|
|
3509
|
|
|
Jussi Pakkanen |
11 years ago
|
|
|
3508
|
|
|
Daniel van Vugt |
11 years ago
|
|
|
3507
|
|
|
Automatic PS uploade... |
11 years ago
|
|
|