Fix intersection calculation bug in rect_paint_needed - #52
Open
jEsuSdA wants to merge 1 commit into
Open
Conversation
The intersection rectangle calculation had two copy-paste errors where the x2 and y2 values were incorrectly using x1/y1 instead of x2/y2 in the ternary operators: x2 = (ignore_reg->x2 < reg->x2) ? ignore_reg->x1 : reg->x1; y2 = (ignore_reg->y2 < reg->y2) ? ignore_reg->y1 : reg->y1; This produced incorrect intersection dimensions, which could cause w*h to be negative or wrong, leading to the ignore region being computed incorrectly and windows that should be painted being skipped.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two copy-paste errors in the intersection rectangle calculation that could cause windows to be incorrectly skipped during painting.
Problem
The intersection rectangle calculation in
rect_paint_needed()had two copy-paste errors:This produced incorrect intersection dimensions, which could cause
w*hto be negative or wrong, leading to the ignore region being computed incorrectly and windows that should be painted being skipped.Solution
Correct the ternary operators to use
x2andy2respectively:Scope
comp_rect.cis touched (2 lines)make clean && makeproduces zero warnings, zero errorsImpact
Fixes a correctness bug in the occlusion culling logic. On certain window layouts (overlapping windows with specific positions), this could cause visible windows to not be painted.