~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174

« back to all changes in this revision

Viewing changes to debian/patches/01_bzr_fix_resize.patch

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-07 18:06:44 UTC
  • mfrom: (0.168.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110407180644-7xwnirf7k3zotc2w
Tags: 1:0.9.4+bzr20110407-0ubuntu2
* New upstream snapshot:
  - fix unity-window-decorator crashed with SIGSEGV in event_filter_funct
    (LP: #711561)
* debian/patches/086_new_grid_defaults.patch:
  - change threshold to 15 on sides and 20 on top to work well with the new
    animtion
* debian/patches/01_bzr_fix_grid_on_multimonitor.patch,
  01_bzr_fix_resize.patch, 01_bzr_fix_grid_premultiply.patch:
  - from upstream bzr, fix grid on multimonitor and colors handling
* debian/patches/086_new_grid_defaults.patch,
  debian/patches/029_default_options.patch:
  - set the resize grid shadow to orange (LP: #752711)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'plugins/resize/src/resize.cpp'
 
2
--- a/plugins/resize/src/resize.cpp     2011-03-14 16:12:45 +0000
 
3
+++ b/plugins/resize/src/resize.cpp     2011-04-07 15:35:23 +0000
 
4
@@ -1483,8 +1483,20 @@
 
5
                                unsigned short            *borderColor,
 
6
                                unsigned short            *fillColor)
 
7
 {
 
8
-    BoxRec   box;
 
9
-    GLMatrix sTransform (transform);
 
10
+    BoxRec        box;
 
11
+    GLMatrix      sTransform (transform);
 
12
+    GLint         origSrc, origDst;
 
13
+    float_t       fc[4], bc[4];
 
14
+
 
15
+    glGetIntegerv (GL_BLEND_SRC, &origSrc);
 
16
+    glGetIntegerv (GL_BLEND_DST, &origDst);
 
17
+
 
18
+    /* Premultiply the alpha values */
 
19
+    
 
20
+    bc[3] = (float) borderColor[3] / (float) 65535.0f;
 
21
+    bc[0] = ((float) borderColor[0] / 65535.0f) * bc[3];
 
22
+    bc[1] = ((float) borderColor[1] / 65535.0f) * bc[3];
 
23
+    bc[2] = ((float) borderColor[2] / 65535.0f) * bc[3];
 
24
 
 
25
     getPaintRectangle (&box);
 
26
 
 
27
@@ -1496,16 +1508,22 @@
 
28
 
 
29
     glDisableClientState (GL_TEXTURE_COORD_ARRAY);
 
30
     glEnable (GL_BLEND);
 
31
+    glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
32
 
 
33
     /* fill rectangle */
 
34
     if (fillColor)
 
35
     {
 
36
-       glColor4usv (fillColor);
 
37
+       fc[3] = (float) fillColor[3] / (float) 65535.0f;
 
38
+       fc[0] = ((float) fillColor[0] / 65535.0f) * fc[3];
 
39
+       fc[1] = ((float) fillColor[1] / 65535.0f) * fc[3];
 
40
+       fc[2] = ((float) fillColor[2] / 65535.0f) * fc[3];
 
41
+
 
42
+       glColor4f (fc[0], fc[1], fc[2], fc[3]);
 
43
        glRecti (box.x1, box.y2, box.x2, box.y1);
 
44
     }
 
45
 
 
46
     /* draw outline */
 
47
-    glColor4usv (borderColor);
 
48
+    glColor4f (bc[0], bc[1], bc[2], bc[3]);
 
49
     glLineWidth (2.0);
 
50
     glBegin (GL_LINE_LOOP);
 
51
     glVertex2i (box.x1, box.y1);
 
52