Merge lp://staging/~renatofilho/unity/unity-lp876017 into lp://staging/unity
Proposed by
Renato Araujo Oliveira Filho
Status: | Merged |
---|---|
Approved by: | Renato Araujo Oliveira Filho |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2650 |
Proposed branch: | lp://staging/~renatofilho/unity/unity-lp876017 |
Merge into: | lp://staging/unity |
Diff against target: |
729 lines (+507/-31) 6 files modified
CMakeLists.txt (+1/-2) plugins/unityshell/CMakeLists.txt (+1/-1) plugins/unityshell/src/unityshell.cpp (+428/-0) plugins/unityshell/src/unityshell.h (+39/-1) unity-shared/PanelStyle.cpp (+37/-27) unity-shared/PanelStyle.h (+1/-0) |
To merge this branch: | bzr merge lp://staging/~renatofilho/unity/unity-lp876017 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Spilsbury (community) | Approve | ||
Review via email:
|
Commit message
UnityWindow now implements ScaleWindowInte
Implemented support to close window during the scale plugin.
Fake windows decoration rendering using panel code as base.
Description of the change
UnityWindow now implements ScaleWindowInte
Implemented support to close window during the scale plugin.
Fake windows decoration rendering using panel code as base.
To post a comment you must log in.
Right approach, some pointers:
76 +// Based on Scale plugin code :checkForWindow At (int x, int y) :reverse_ iterator rit = screen->windows ().rbegin (); osition ();
77 +CompWindow* UnityScreen:
78 +{
79 + int x1, y1, x2, y2;
80 + CompWindowList:
81 +
82 + for (; rit != screen->windows ().rend (); ++rit)
83 + {
84 + CompWindow *w = *rit;
85 + SCALE_WINDOW (w);
86 +
87 + ScalePosition pos = sw->getCurrentP
88 + if (sw->hasSlot ())
89 + {
90 + x1 = w->x () - w->input ().left * pos.scale;
91 + y1 = w->y () - w->input ().top * pos.scale;
92 + x2 = w->x () + (w->width () + w->input ().right) * pos.scale;
93 + y2 = w->y () + (w->height () + w->input ().bottom) * pos.scale;
94 + x1 += pos.x ();
95 + y1 += pos.y ();
96 + x2 += pos.x ();
97 + y2 += pos.y ();
98 + if (x1 <= x && y1 <= y && x2 > x && y2 > y)
99 + return w;
100 + }
101 + }
102 + return NULL;
103 +}
Is this necessary?
I think you can just overload scaleSelectWindow to determine what the currently hovered window is. From there you will need to damage and re-render both the new and old window. Have a look at the scaleaddon plugin.
151 + gWindow->geometry ().reset (); >glAddGeometry (ml, iconReg, iconReg); translate (x, y, 0.0f); getMatrix ()); >glDrawTexture (icon, fragment, mask);
152 + if (width && height)
153 + gWindow-
154 +
155 + if (gWindow->geometry ().vCount)
156 + {
157 + GLFragment::Attrib fragment (attrib);
158 + GLMatrix wTransform (transform);
159 +
160 + wTransform.
161 +
162 + glPushMatrix ();
163 + glLoadMatrixf (wTransform.
164 + gWindow-
165 + glPopMatrix ();
166 + }
You will need to put this inside of #if USE_MODERN_ COMPIZ_ GL ifdefs. Sorry :( Here's how to do it:
#ifdef USE_MODERN_ COMPIZ_ GL >vertexBuffer ()->begin (); >glAddGeometry (ml, iconReg, iconReg); COMPIZ_ GL >vertexBuffer ().end (); >vertexBuffer ().countVertices ()) COMPIZ_ GL translate (x, y, 0.0f); COMPIZ_ GL >glDrawTexture (icon, wTransform, attrib, mask); getMatrix ()); >glDrawTexture (icon, fragment, mask);
gWindow-
#else
151 + gWindow->geometry ().reset ();
#endif
152 + if (width && height)
153 + gWindow-
154 +
#ifdef USE_MODERN_
gWindow-
if (gWindow-
#else
155 + if (gWindow->geometry ().vCount)
#endif
156 + {
#ifdef USE_MODERN_
157 + GLFragment::Attrib fragment (attrib);
#endif
158 + GLMatrix wTransform (transform);
159 +
160 + wTransform.
161 +
#ifdef USE_MODERN_
gWindow-
#else
162 + glPushMatrix ();
163 + glLoadMatrixf (wTransform.
164 + gWindow-
165 + glPopMatrix ();
#endif
166 + }
172 + // BG
173 + glColor3f (0.0f, 0.0f, 0.0f);
174 + glRectf (x, y2, x2, y);
Preferably use client side buffers for this, eg
#ifndef USE_MODERN_ COMPIZ_ GL :streamingBuffe r ();
172 + // BG
173 + glColor3f (0.0f, 0.0f, 0.0f);
174 + glRectf (x, y2, x2, y);
#else
GLVertexBuffer *vertexBuffer = GLVertexBuffer:
vertexBuffer->begin (GL_TRIANGLE_STRIP)
const GLfloat vertices[] =
{
x, y2, 0.0f,
x, y, 0.0f,
x2, y, 0.0f,
x2, y2, 0.0f
};
vertexBuffer- >addVertices (4, vertices); >color4f (0.0f, 0.0f, 0.0f, 1.0f); >render (transform, attrib);
vertexBuffer-
vertexBuffer->end ();
vertexBuffer-
209 + x + CLOSE_ICON_SPACE, iconY,
210 + maxWidth , maxHeight);
Make this a constant
190 + if (!sWindow- >hasSlot( ) || // animation finished
191 + ...