Commit Graph

10710 Commits (d164e16b5603647f9a8104cf0518cfb1d16e1765)

Author SHA1 Message Date
Allen Winter ecb9c1cf5a Add a hack for compiling xcb/xcb_icccm.h with C++.
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
2013-05-28 19:02:58 -04:00
Oliver Henshaw 47acf4ee9a Merge remote-tracking branch 'origin/KDE/4.10' into master
Conflicts:
	kwin/scripting/scripting.cpp
	powerdevil/daemon/actions/bundled/powerdevildimdisplayaction.desktop
	solid-actions-kcm/device-actions/solid-device-SerialInterface.desktop
2013-05-28 17:36:53 +01:00
Oliver Henshaw b61bca0f3d add qml import paths in correct order
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
2013-05-28 17:23:19 +01:00
Oliver Henshaw 2d5ebd3b8d Replace foreach with java-style iterator
In preparation for reversing the loop.

REVIEW: 110670
2013-05-28 17:23:09 +01:00
Oliver Henshaw bf044bf509 Drop unneeded duplicate addImportPath
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
2013-05-28 17:21:48 +01:00
Fredrik Höglund 9c1833920c kwin: Use the new map() interface in renderQuads()
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.
2013-05-28 18:13:34 +02:00
Fredrik Höglund 7a00648195 kwin: Use the new map() interface in makeDecorationArrays()
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.
2013-05-28 18:13:34 +02:00
Fredrik Höglund de4b7e8db1 kwin: Add WindowQuadList::makeInterleavedArrays()
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.
2013-05-28 18:13:06 +02:00
Fredrik Höglund a5a2561f69 kwin: Simplify WindowQuadList::makeArrays()
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.
2013-05-28 16:35:37 +02:00
Fredrik Höglund 6891c900b3 kwin: Simplify makeDecorationArrays()
This also fixes coordinate inversion for rectangular textures.
2013-05-28 16:35:37 +02:00
Fredrik Höglund d4aacd678e kwin: Add more accessors in WindowVertex
Reorder some of the methods and add new u() and v() accessors,
which are aliases of textureX() and textureY().
2013-05-28 16:35:37 +02:00
Fredrik Höglund 7a99b8c0ef kwin: Add GLTexture::matrix()
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
2013-05-28 16:35:36 +02:00
Fredrik Höglund 38678bb84f kwin: Don't unbind vertex array buffers
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.
2013-05-28 16:35:36 +02:00
Fredrik Höglund 159bcf11b6 kwin: Simplify the two setData() methods
Simplify the two setData() methods in GLVertexBuffer by implementing
them in terms of the new map() and unmap() methods.
2013-05-28 16:35:36 +02:00
Fredrik Höglund 188e6d04ca kwin: Expose a map() and an unmap() method in GLVertexBuffer
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.
2013-05-28 16:35:36 +02:00
Fredrik Höglund ab8c6aeec3 kwin: Add a new setData() method in GLVertexBuffer
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.
2013-05-28 16:35:35 +02:00
Fredrik Höglund 395ff72555 kwin: Change the way attrib formats are stored in GLVertexBuffer
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.
2013-05-28 16:35:35 +02:00
Fredrik Höglund 1de20a39a0 kwin: Add convenience classes for working with bitfields 2013-05-28 16:35:35 +02:00
Fredrik Höglund 5782d5307e kwin: Add a Color uniform in GLShader
And use it in GLVertexBufferPrivate::bindArrays(). Also store the color
as a QVector4D in GLVertexBufferPrivate.
2013-05-28 16:35:35 +02:00
Fredrik Höglund c41d05d36c kwin: Do some more refactoring in GLVertexBuffer
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.
2013-05-28 16:35:35 +02:00
Martin Gräßlin 3f69bb0e7f Change Client's clormap to xcb_colormap_t
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
2013-05-28 11:55:39 +02:00
Martin Gräßlin 41b37afa96 Use xcb_timestamp_t for ping window functionality
At same time rename the variable to follow m_camelCase naming scheme and
initialise the variable with default value in ctor.
2013-05-28 11:55:39 +02:00
Martin Gräßlin b39965ec27 Client's userTime related code ported over to XCB
At same time variable user_time renamed to m_userTime to follow naming
scheme.
2013-05-28 11:55:39 +02:00
Martin Gräßlin dc1496f731 Client::killProcess takes xcb_timestamp_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin 48f08bca83 Client::embedClient() takes an xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin edefd5f3d2 Port Client::sendClientMessage to XCB 2013-05-28 11:55:39 +02:00
Martin Gräßlin 5632285b1e Client's button(Press|Release)Event and motionNotifyEvent accept xcb_window_t 2013-05-28 11:55:39 +02:00
Martin Gräßlin 7cf461b154 Client::readIcons accepts xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin 1b7d2e5ca4 Client::restackWindow() accepts xcb_(window|timestamp)_t as argument
At the same time X define usage is changed to XCB enums.
2013-05-28 11:55:39 +02:00
Martin Gräßlin 2f718bd4fb Client::manager() takes an xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin a616d1fe57 Client::decorationId() returns an xcb_window_t 2013-05-28 11:55:39 +02:00
Martin Gräßlin 5dae0cb010 Change Client::window_group to xcb_window_t
At the same time adjust name to m_camelCase to follow naming scheme.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 5afe5f810e Port Client::transient_for handling to XCB
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.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 9d1fb072d4 Find xcb_icccm and link it in KWin core
We need it for porting some aspects of Client to XCB.
2013-05-28 11:55:38 +02:00
Martin Gräßlin aa55cf98ae Port Client's move resize grab window to XCB
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.
2013-05-28 11:55:38 +02:00
Martin Gräßlin b4d2129a3f Port Client::client to XCB
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.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 424589ab4a Use an Xcb::Window for Client::wrapper
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.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 8b2a5f9936 Support for cursor change tracking in KWin::Cursor
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
2013-05-28 08:02:59 +02:00
Martin Gräßlin 17e38f3357 Remove "Block global shortcuts" global shortcut
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
2013-05-28 08:02:12 +02:00
Martin Gräßlin 92bc318e45 Only execute kwin_opengl_test if OpenGL/GLX is going to be used
* 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
2013-05-28 07:39:17 +02:00
Martin Gräßlin 2be7da70e0 Adding support information for Decorations
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
2013-05-28 07:37:42 +02:00
Martin Gräßlin bd01bfefb4 Improve multi-head detection for OpenGLIsUnsafe
This was currently basically broken:
* Screen number got always attached
* openGLIsBroken did not check for screen number
-> KCM reported "everything is fine" while it wasn't

Now changed to:
* only attach screen number if it is a multi-head setup
* use same logic in both Composite and CompositingPrefs

Still problematic:
* kcm is not multi-head aware so it will report everything is fine in
  case of a broken multi-head setup

REVIEW: 110631
2013-05-27 08:16:21 +02:00
l10n daemon script 79d09f5336 SVN_SILENT made messages (.desktop file) 2013-05-25 04:07:51 +00:00
l10n daemon script b4a70ca2ef SVN_SILENT made messages (.desktop file) 2013-05-24 05:48:46 +00:00
l10n daemon script 3a0999688f SVN_SILENT made messages (.desktop file) 2013-05-24 03:35:07 +00:00
Martin Gräßlin 4f2f8bda11 Use GLSL 1.40 shaders as GLSL 300 es shaders for effects
Like for the scene shaders. Makes the effects work again when using
GLES 3.
2013-05-23 09:55:16 +02:00
Martin Gräßlin 5c78f7eabe GLSL 1.40 shader for lookingglass effect
REVIEW: 110574
2013-05-23 09:45:26 +02:00
Martin Gräßlin c00d468f0f GLSL 1.40 shader for CoverSwitch Reflection
Shader moved to 1.10 subdirectory and a new version for 1.40 added.
At the same time call to glPolygonMode removed as it caused errors with
core context (and seems to not be needed).

REVIEW: 110572
2013-05-23 09:43:43 +02:00
Martin Gräßlin c1486596fb GLSL 1.40 shaders for cube effect
Shaders are moved into dedicated directories 1.10 and 1.40. 1.10 contains
the already existing versions, 1.40 copies of them adjusted to GLSL 1.40.

REVIEW: 110571
2013-05-23 09:39:35 +02:00
Martin Gräßlin 2bee9a0ee0 Use generic fragment shader for Cylinder and Sphere
Shaders were broken. Issue mentioned in the TODO seems to no longer be
present (at least not on the system I used for testing).

REVIEW: 110570
2013-05-23 09:38:14 +02:00