-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes the rendering issues pqiv had on Wayland. Turns out GTK has a model where if client side decorations are used, as is the case on Wayland or if GTK_CSD=1 is set, the decorations are part of the dimensions exposed to the program. So if you resize your window to (h0,w0), GTK will come around and actually resize it to (h1,w1), and expose these dimensions to the program. Worse, the program is able to make full use of these dimensions, including some transparent area surrounding the actual window. Drawing to coordinate (0,0) of a window will draw outside the decorated area. There is no API to query the dimensions of the CSD. GTK devs take the position that drawing straight to the window is a bad idea anyways (but still provide an API to do that, which is weird), and apparently do not intend to ever fix this (from my perspective) broken interface where window decorations aren't transparent to application developers but also cannot be queried.. The workaround pqiv goes for is to add a box to the window at startup, and query its allocation once the window is realized, to measure the CSD dimensions once. They are then added/subtracted as needed. It does this once for simplicity, which has the downside that if the theme is changed while pqiv is running, things will break. If anyone complains, it'll be easy to change this later.
- Loading branch information
1 parent
8af563e
commit 10aad05
Showing
2 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters