Loop directly over the window quad list and check the type instead of
using select(WindowQuadDecoration) when separating the decoration quads.
This avoids the step of creating an intermediate list, and then looping
over that list to separate out the quads that belong to the four sides.
xcb/xcb_iccm.h isn't C++ safe (some versions) because it has
a variable called "class" in function signatures. The hack
is to define "class" to something else before that header is
included, and then undef "class" immediately afterwards.
CCMAIL: mgraesslin@kde.org, fredrik@kde.org
addImportPath prepends the path to importPathList so we must add our
paths in reverse order.
Based on the fix for kdeclarative.cpp in kdelibs
400b9f2e9d10386bb175b6123fe0cdaafeaffe61
REVIEW: 110670
Let KDeclarative::setupBindings() add the import paths: it too takes
paths from KGlobal::dirs()->findDirs("module", "imports"); it adds paths
in the correct (reverse) order [1].
[1] See kdelibs 400b9f2e9d10386bb175b6123fe0cdaafeaffe61 for further
details.
REVIEW: 110670
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, coyping the data into them, and
then copying the data from the arrays into the buffer object.
This also makes renderQuads() handle coordinates for rectangular
textures correctly.
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, copying the data into them, and
then copying the data from arrays into the buffer object.
Unlike makeArrays() this function writes into a pre-allocated array,
and takes a matrix that's used to transform the texture coordinates.
This allows this function to handle coordinates for rectangular
textures correctly.
Note that unlike the previous commit, this doesn't fix texture coordinates
for rectangular textures. That case cannot be handled correctly without
knowing the dimensions of the texture.
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
KWin always updates the array buffer binding before it calls GL functions
that reference it, so there is never any need to reset it.
This should eliminate half the calls to glBindBuffer() while painting
the scene.
These methods make it possible to write directly into the buffer object
when building vertex arrays.
If the buffer object cannot be mapped, the map() method will return
a pointer to local memory which will be submitted to the buffer object
with glBufferData() when unmap() is called.
This overload makes it possible to upload data of an arbitrary size and
type into the buffer object. The intent is for this method to be used
to upload interleaved vertex data.
This commit also adds setVertexCount() and setAttribLayout().
The rationale for decoupling attribute specification from data uploading
is that the attribute formats and layout change less frequently than
the vertex data.
The vertex count is also specified using a separate function to enable
the caller to upload data for multiple draw calls at the same time.
Store the formats as an array in GLVertexBufferPrivate.
This simplifies the code for enabling the generic vertex arrays,
and also makes it easier to add new arrays.
Consolidate the code for binding and unbinding the vertex arrays into
two new methods called bindArrays() and unbindArrays() respectively.
This patch also removes the three paint implementations, since the only
difference between them is the code that sets up the arrays. The actual
painting code is moved into GLVertexBuffer::render(), which uses the
new methods to bind and unbind the arrays.
At same time also renaming variable to follow naming scheme and have a
sensible name. Also moved default value initialization into initializer
list.
REVIEW: 110283
The type of the transient_for related variables are changed to
xcb_window_t. They cannot be Xcb::Window as we don't take ownership over
the transient for window.
Variables are renamed to m_camelCase to follow naming scheme.
A wrapper for retrieving the TransientFor hint is added to the Xcb
Wrappers.
Using Xcb::Window to wrap this helper window and port all the used XLib
calls to XCB.
Also renaming the variable to m_ and camel case to follow general naming
scheme.
Unfortunately the Xcb::Window wrapper cannot be used for the client
window as the client should not be destroyed by KWin.
All the API calls except XSelectInput are changed to xcb and the name is
adjusted to m_client to follow the naming scheme.
The Xcb::Window nicely encapsulates the created wrapper window. As
almost all code is adjusted, the variable is also renamed to
m_wrapper to follow the normal naming scheme.
KWin::Cursor can track changes to the cursor image. It supports a
start/stop tracking to not handle these events if nobody is interested in
them. When enabled and the cursor image changes a signal is emitted with
the serial number of the new cursor image.
To track cursor image changes xcb_xfixes_select_cursor_input is used (see
XFixes Version 5.0 protocol, section 7).
This could be useful for the zoom effect when it replaces the cursor.
REVIEW: 110519
This shortcut did not make any sense to me, because you could block the
global shortcuts for KWin, but not re-enable them again. So once blocked,
it was blocked for ever till kwin --replace &.
This is in opposite to the commit message which introduced it
(see BUG 108961).
REVIEW: 110364
* don't execute OpenGL test app if user selected XRender
* don't execute OpenGL test app if user forces to EGL
If a user selected XRender because OpenGL is failing badly it might not
be the best idea to call an OpenGL application.
If the user enforces EGL it's kind of pointless to call a testapp which
uses GLX.
REVIEW: 110659
Unfortunately only information available through the factory can be read.
As Factory is not a QObject we cannot use the Q_SLOT trick to get further
information dynamically from the loaded decoration plugin.
REVIEW: 110665