Comment 2 for bug 535088

Revision history for this message
NooP (noop) wrote :

I think i've found where is the bug. But my C++ skill is to bad to rely only on my patch. Need a review from someone who knows better than me C++.

Package : metacity-2.28.1-0ubuntu5-src

Here's the patch :

Index: src/ui/theme.c
===================================================================
--- src/ui/theme.c (revision 1)
+++ src/ui/theme.c (revision 14)
@@ -4526,5 +4526,5 @@
               if ((j == META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND ||
                    j == META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND) &&
- middle_bg_offset < MAX_MIDDLE_BACKGROUNDS)
+ (middle_bg_offset < (MAX_MIDDLE_BACKGROUNDS - 1)))
                 {
                   ++middle_bg_offset;