Commit Graph

274 Commits (ce674ed509301a6756bc9f1a8e946e9c21c4205d)

Author SHA1 Message Date
Aleix Pol 7b110f0671 Improve CMake usage
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
2013-11-15 13:37:47 +01:00
Martin Gräßlin c32ec9b32b [kwin] Work around broken xcb_sync_create_alarm
The xcb sync protocol is incorrectly defined (see [1]) which results in
xcb_sync_create_alarm not creating a valid alarm. To work around this
issue we only create the alarm without setting the int64 values. For
those we use the XLib XSyncChangeAlarm call after we verified that the
alarm got created. This unfortunately reintroduces linking against
libxext. But at least resizing works again.

[1] http://lists.freedesktop.org/archives/xcb/2013-June/008375.html
2013-11-11 11:36:26 +01:00
Martin Gräßlin 324aae916a [kwin] Drop testapp for detecting whether direct rendering works on glx
The main purpose of the opengl testapp was to set the environment
variable LIBGL_ALWAYS_INDIRECT if direct rendering is not supported
before glx gets initialized.

With Qt5 we may no longer set this environment variable. QtQuick
requires direct rendering. On IvyBridge QtQuick is crashing if the
variable is set. Thus we are no longer allowed to set it and thus the
complete test becomes pointless.

The test app basically whitelisted most drivers anyway, the only
drivers which were problematic are the proprietary Catalyst drivers.
It that's still a problem we can also disable OpenGL compositing on
those drivers through the recommendation in the GLPlatform.

This also means that the KWIN_DIRECT_GL variable is no longer useful.
2013-11-05 14:48:40 +01:00
David Edmundson 59e3d0e099 kde4_install_icons -> ecm_install_icons
REVIEW: 113600
2013-11-04 13:24:41 +01:00
Aurélien Gâteau 05b6de1002 ${KDE4Support_LIBRARIES} => KF5::KDE4Support
Fixes a few link errors
2013-10-29 13:00:46 +01:00
Sebastian Kügler b68867463e Change KF5::plasma to KF5::Plasma
Library name has changed in plasma-framework to bring it in line with
KF5:CamelCasing naming.
2013-10-16 01:36:56 +02:00
Martin Gräßlin e3618e8796 [kwin] Follow Qt's OpenGL choice for KWin
As KWin indirectly uses Qt's OpenGL through QtQuick we need to ensure
to not mix OpenGL and OpenGLES. So we have to built KWin only against
OpenGL if Qt is built against OpenGL and we have to built KWin only
against GLESv2 if Qt is built against GLESv2.

This means the kwin_gles binary is no more. There is only kwin which
either links GL or GLESv2.
2013-10-14 09:04:03 +02:00
Sebastian Kügler 1c3e540507 kde4_add_kdeinit_executable becomes kf5_add_kdeinit_executable 2013-10-08 01:00:27 +02:00
Sebastian Kügler bfe710dce7 KF5::KDeclarative 2013-10-04 22:21:22 +02:00
Martin Gräßlin a63ca0c311 Fix linking and includes
Seems like there were some changes, we need more explicit linking.
2013-10-02 15:23:56 +02:00
Martin Gräßlin 5d185a9adc Welcome back to kcmkwin - so far only desktop
Note to people compiling from source: it's only the default of the
cmake variable which got changed. You have to delete the variable
from the cache to get this change.
2013-09-27 13:45:25 +02:00
Sebastian Kügler a1641efdf1 Remove kdeqt5staging
Reviewed-by: Martin
2013-09-11 13:57:41 +02:00
Martin Gräßlin caad13ff95 Use new components based Find XCB 2013-09-09 06:03:35 +02:00
Martin Gräßlin 489addf901 Add default debug area to KWin main CMakeLists 2013-09-02 10:34:00 +02:00
Martin Gräßlin a536e07488 Use kdeqt5staging for QCommandLineParser
Makes it also compile with not latest Qt.
2013-08-29 16:22:30 +02:00
Martin Gräßlin fb111be903 Use Qt5::Script in linker definition of KWin core
Missed that one in the other commit.
2013-08-20 10:49:33 +02:00
Martin Gräßlin e21225fa47 Use XCB Shape instead of XLib Shape in KWin core 2013-08-20 09:48:14 +02:00
Martin Gräßlin 84a2f3020b Use Qt5:: in target link libraries in KWin 2013-08-20 09:14:24 +02:00
Martin Gräßlin 5ca6654eb8 Fix linking
KDEUI is dead which caused collateral damage.
2013-08-20 08:47:47 +02:00
Martin Gräßlin 5007a19062 Add a ScreenEdgeItem to reserve a screen edge from QML
Usage:
ScreenEdgeItem {
    edge: ScreenEdgeItem.LeftEdge
    onActivated: doSomething()
}
2013-08-13 09:57:51 +02:00
Martin Gräßlin 96bde02b38 New QML Type DBusCall
The DBusCall is exported as a QObject to the QML environment. It is
intended as a declarative replacement for the callDBus method which used
to be exported on global scope in the QtQuick 1 world.

Example usage:
DBusCall {
    id: dbus
    service: "org.kde.KWin"
    path: "/KWin"
    method: "setCurrentDesktop"
    arguments: [1]
    Component.onCompleted: dbus.call()
}
2013-08-13 09:57:51 +02:00
Martin Gräßlin abbe84bab4 Port declarative scripting to QtQuick
Getting all functionality from old solution into new one is not really
possible. Main problems are that QtScript provided more functionality
than the QJSEngine. For example it's no longer possible to just export
functions to the engine. We need to have a Qt wrapper object. At the
moment this wrapper object doesn't export all functions as the callbacks
are tricky. A solution might be to create specific QML types
encapsulating functionality which used to be exported on the functions.

Nevertheless a basic QML script loads and works and the ported readConfig
function works, too.
2013-08-13 09:57:51 +02:00
Martin Gräßlin 69b109b5b9 Adjust the ThumbnailItems to QtQuick2
AbstractThumbnailItem inherits from QQuickPaintedItem using QPainter to
do the fallback painting of icons.

The scene is adjusted to get the information from QQuickItem instead of
QDeclarativeItem. Clipping got a little bit more complex as the clip
path does not exist any more. To get it right the ThumbnailItem needs to
specify the parent it wants to be clipped to with the clipTo property.
E.g.:
clipTo: listView

The scene uses this clipTo parent item to correctly calculate the clip
region. Also the ThumbnailItem needs to have clipping enabled.

Note: this commit currently breaks TabBox as the qml and view are not
yet adjusted. In scripting the export of the item is disabled, but any
qml script using a ThumbnailItem would obviously also fail.
2013-08-09 11:47:17 +02:00
Martin Gräßlin 9291b18cee Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/effects.cpp
	kwin/effects/logout/logout.cpp
	kwin/effects/presentwindows/main.qml
	kwin/effects/presentwindows/presentwindows.cpp
	kwin/effects/presentwindows/presentwindows.h
	kwin/effects/zoom/zoom_config.cpp
	kwin/libkwineffects/kwinglutils_funcs.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/nvidiahack.cpp
	kwin/xcbutils.h
	plasma/desktop/containments/desktop/plasma-containment-desktop.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-08-07 10:10:06 +02:00
Thomas Lübking 3c593f4357 remove nvidiahack lib
1. it apparently is ineffective
2. if it was effective, it's current behavior would be not exactly helpful
   (sets __GL_YIELD to NOTHING, causing busy waits on doublebuffer swapping)
3. it does for sure pollute the doublebuffer/usleep detection (setenv is set to override),
   ie. the overehad detection code gets a different opinion on __GL_YIELD than libGL

REVIEW: 111858
CCBUG: 322060
2013-08-05 20:43:27 +02:00
Martin Gräßlin c16c0c3753 Port invert screen from XLib xrandr to xcb randr
With this we can drop the linking to xrandr in KWin core.
2013-08-01 10:26:39 +02:00
Martin Gräßlin dcc273fe0f KWin core doesn't need to link some XLib libs any more
* XExt
* ICE
* SM
* XRender
* XDamage
* XFixes
2013-07-31 07:28:15 +02:00
Martin Gräßlin 4141c101f1 Enable building of the Oxygen window decoration
Demo and config stays disabled - we are only interested in the window
decoration for now.

Seems to work :-)

CCMAIL: hugo@oxygen-icons.org
2013-07-30 07:57:15 +02:00
Martin Gräßlin 48b1c388bc Re-enable compilation of KWin decorations
Only Aurorae gets compiled for now. Oxygen is disabled by config option
and legecay decos are commented in CMakeLists.txt.
2013-07-25 18:05:58 +02:00
Martin Gräßlin 2fcc26d29b Enable compilation of a KWin subset again
To ease porting a few features are disabled, this includes:
* kcms
* decorations
* activities

Note: KWin doesn't work yet, the event filter is not yet ported!
2013-07-24 09:58:45 +02:00
Martin Gräßlin 9ab751042a Drop X11_XCB library dependency
We don't need it anymore - the xcb connection is also provided by
QX11Info.
2013-07-24 09:58:43 +02:00
Martin Gräßlin b800d58a3d Disable compilation of data subdirectory for porting
It's probably not worth to port those update scripts.
2013-07-24 09:58:42 +02:00
Martin Gräßlin f04b39c548 Adjust target link libraries 2013-07-24 09:58:42 +02:00
Fredrik Höglund a87e8f5e8e kwin: Drop the xcb_icccm dependency
This dependency is causing build problems on a number of systems,
and it doesn't make much sense to bring in a whole library for three
one-line convenience functions.
2013-07-02 00:21:32 +02:00
Martin Gräßlin b7423a45cd Only build Wayland backend if both Wayland and EGL are found 2013-06-07 11:57:08 +02:00
Martin Gräßlin b6990078ec Add support for Wayland seat: keyboard and pointer
Rudimentary support for input events. Events from Wayland are forwarded
to X's root window using the XTest extension.

Currently supported:
* left/middle/right mouse button
* keyboard events

Not supported:
* additional mouse buttons
* mouse wheel
* touch events

Obviously this is a rather huge hack and is only intended till we have
XWayland support and proper input redirection inside KWin.
2013-06-05 13:46:00 +02:00
Martin Gräßlin bab5f16d3c Egl Backend using a Wayland surface for rendering
This backend is able to composite on a Wayland surface instead of an X11
overlay window. It can be considered as a prototype for a Wayland session
compositor.

For texture from X11 pixmap the backend uses XShm. This is far from
optimal, but the KHR_image_pixmap extension is not available in Mesa's
Wayland backend. It's a temporary solution till we have XWayland and
texture from Wayland buffer.

To use this backend one needs to specify the environment variable
KWIN_OPENGL_INTERFACE with "egl_wayland". In future KWin should probably
use this backend if the Wayland display env variable is defined.

To use this setup:
1. Have a normal X-Server running on e.g. VT7
2. Start Weston on VT1
3. Start a terminal on Weston
4. start KWin with:

DISPLAY=:0 KWIN_OPENGL_INTERFACE=egl_wayland kwin --replace &

This should map a Wayland surface to Weston showing the content of the X
setup. At the moment it's not yet possible to interact with the surface
as input events are not yet recieved in the backend.

There are still a lot of limitations as documented in the code.
2013-06-05 13:45:45 +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 db18c08dd0 Move RootInfo and WinInfo into an own header and impl file
Main motivation for this change is that it's unhandy to have the class
definition in workspace.h and client.h while the implementation is in
events.cpp although nothing in events.cpp uses it directly.

By getting it out of workspace.h we get the header a little bit smaller
which should improve compile time given that it's included almost
everywhere.

In events.cpp the enum usage is changed to NETWinInfo as that's the class
where they are defined.

RootInfo does no longer hold a workspace pointer. Where it's needed it
uses the singleton accessor of Workspace.

REVIEW: 110199
2013-04-30 08:06:12 +02:00
Martin Gräßlin 6d0d9cfe43 Remove KWin::Notifications
Overall all notifications except compositing suspended by DBus were
configured by default to not have any action. This means all the time we
emit a notification we keep DBus and KDED busy for nothing.

All the cases when a notification is triggered ire also exported to
KWin scripting, so if one really needs to handle something in case a
window is moved, it could be done through a KWin script with much more
context about the event.

REVIEW: 110113
BUG: 258097
FIXED-IN: 4.11
2013-04-23 16:23:55 +02:00
Martin Gräßlin edb074cbc2 Split out screen handling from Workspace into own class Screens
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.

The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse

The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.

All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.

REVIEW: 109839
2013-04-15 10:25:10 +02:00
Martin Gräßlin d8e1b1c00e Rename plugins.(h|cpp) to decorations.(h|cpp) 2013-04-15 09:59:09 +02:00
Martin Gräßlin da85b5fdc7 Split out Activities related code from Workspace
All activities related code moves into new singleton class Activities.
This class gets only included into the build if the build option is
enabled which means there are less ifdefs all over the code and it also
handles better the moc doesn't like ifdef case.

The class holds the list of open and all activites, the current and the
previous activity and the KActivities::Controller. It also emits the
signals for any activities related changes.

Workspace still contains some activities related code. That is the
adjustment on change of current activity. Nevertheless the code looks
much cleaner now and does not contain the confusing naming conflict with
takeActivity() which existed before.

In all the places where Activities got used the code got adjusted and
quite often the ifdef got added with a fallback for the disabled case.
2013-04-11 13:01:36 +02:00
Martin Gräßlin 8fa3f8daa8 Model to provide easy access to KWin's Clients from QML
A new ClientModel is added which provides multiple different views on
KWin's Clients. The model is organized as a tree model supporting the
following levels:
* activities
* virtual desktops
* screens
* none

The levels can be ordered in whatever way one wants. That is the tree
structure can have an ordering of activities then virtual desktops or
the other way around.

In addition the model provides Exclusion flags  to exclude clients of
certain types. E.g. it's possible to exclude all windows which are not on
the current desktop or all windows which are of type dock.

The model gets automatically updated whenever a Client is added/removed
or changes a state in a way that it should be excluded/included.

The ClientModel is not directly exported to QML. Instead there are
specific sub classes for certain common orderings. This solutions is
chosen to workaround some limitations of QML. The initial idea was to
use a property taking a list of the levels, but this doesn't work because
we are not notified when the QDeclarativeListProperty changes.

Currently the following models are provided to QML:
* ClientModel -> no restrictions
* ClientModelByScreen -> ordering by screen
* ClientModelByScreenAndDesktop -> screen, then desktop

These can be used to get all Clients:
ClientModel {
}

Or to get the classic Present Windows on current desktop:
ClientModelByScreen {
    exclusions: ClientModel.OtherDesktopsExclusion | ClientModel.NotAcceptingFocusExclusion | ...
}

Or to get the classic Present Windows on all desktops:
ClientModelByScreen {
    exclusions: ClientModel.NotAcceptingFocusExclusion | ...
}

Or our well known desktop grid:
ClientModelByScreenAndDesktop {
    id: desktopGrid
    exclusions: ClientModel.NotAcceptingFocusExclusion | ...
}

To support filtering as known by the Present Windows effect one can use
a ClientFilterModel, which is a QSortFilterProxyModel filtering on
window caption, role and class:
ClientFilterModel {
    id: filterModel
    clientModel: desktopGrid
    filter: filterItem.text
}

In case it's a tree level obviously QML does not support this correctly.
So we need to use a VisualDataModel:
VisualDataModel {
    id: clientModel
    model: filterModel
    Component.onCompleted: {
        clientModel.rootIndex = modelIndex(0);
        clientModel.rootIndex = modelIndex(0);
        clientModel.delegate = thumbnailDelegate;
    }
}

As we can see, the rootIndex has to be set to the level which contains
the Clients. Also it seems to be important to create the delegate after
the model index has been set. The idea is to have only one ClientModel
and multiple VisualDataModels if multiple views on the data is needed.

The model has been tested with a painful modeltest session. It looks good
so far modulo the listed limitations and that modeltest is not liking
closing Yakuake in the ClientModelByScreenAndDesktop setup, though it
works fine in real world testing.

REVIEW: 109604
2013-04-08 10:30:45 +02:00
Martin Gräßlin 7e3809a3ca Split out Application Menu related code into own class
Following the approach to move out of Workspace what doesn't belong into
Workspace Appmenu support goes into an own class.

This also has the advantage of better compilation with Qt 5 as moc seems
to dislike ifdefs in the slot definitions.

REVIEW: 109497
2013-03-21 09:34:56 +01:00
Martin Gräßlin 5a2d14baf7 More fine grained linking than X11_LIBRARIES
Use X11_X11_LIB and actually needed additional libs instead of
everything coming with X11_LIBRARIES.

REVIEW: 109141
2013-03-06 10:14:21 +01:00
Martin Gräßlin d2371e7478 CMake cleanup: empty else() 2013-03-06 10:14:15 +01:00
Martin Gräßlin 928e5d4912 Split the libs we link to into multiple variables
Using a lib variable for:
* own libs
* qt libs
* kde libs
* xlib libs
* xcb libs

and link those groups together in target_link_libraries. This should
make the code easier to read and easier to support in future for some
time both Qt4 and Qt5.
2013-03-06 10:14:15 +01:00
Martin Gräßlin 5ea22e362d CMake Cleanup: empty endif 2013-03-06 10:14:15 +01:00
Martin Gräßlin 650c606e95 Provide config interface for scripted effects and KWin scripts
A scripted component providing:
* ui/config.ui
* config/main.xml

can get a config interface by using the following in metadata.desktop:
X-KDE-ServiceTypes=KWin/Effect,KCModule
X-KDE-PluginKeyword=`X-KDE-PluginInfo-Name`
X-KDE-Library=kcm_kwin4_genericscripted
X-KDE-ParentComponents=`X-KDE-PluginInfo-Name`

`X-KDE-PluginInfo-Name` has to be replaced by the actual value. In case
of a KWin Script the X-KDE-ServiceTypes needs to be:
X-KDE-ServiceTypes=KWin/Script,KCModule

The GenericScriptedConfig tries to identify the package from the keyword
and creates a Plasma::ConfigLoader and loads the UI from the packaged UI
file.
2013-03-04 10:29:24 +01:00