Commit Graph

254 Commits (89c2688f74cdc14374e9f4b20e6a3bd1c74e6624)

Author SHA1 Message Date
Martin Gräßlin 72882f6aba [kwin] Add sanity checks for the QPA plugin
KWin requires the xcb plugin otherwise KWin crashes when the first
xcb/xlib code is called. First KWin tries to set the QT_QPA_PLATFORM
to "xcb", but that doesn't protect against the command line switch.

Thus KWin also verifies that after constructing the QGuiApplication
the platform name is set to xcb, if not it exits gracefully with a
useful error message instead a crash.

To make that work the KWinSelectionOwner has to be changed to a
pointer and be delayed constructed, otherwise the crash already happens
in the KSelectionOwner.

Furthermore a small sanity check on the plugin is performed by checking
whether KWin can get the XDisplay from the QPA. If not it means that the
QPA plugin was compiled with -no-xcb-xlib which KWin doesn't support, it
still uses XLib at various places. If KWin doesn't get the Display, it
exits gracefully with a clear error message.

CCBUG: 331880
REVIEW: 116669
2014-03-10 08:41:53 +01:00
Martin Gräßlin a8d8d6461c [kwin] Fix operation mode on X11
Picked Wayland by default instead of X11 causing KWin to abort
startup if there is no Wayland backend.

Important lesson: test your changes also on X11 and not just on
Wayland!
2014-01-09 17:39:47 +01:00
Martin Gräßlin b65d54f4d2 Enforce compositing if required
In the Wayland world we need to have a compositor. This means we have to
enforce that the compositor is running. If the setup fails we have to
quit, because it doesn't make any sense any more to be running.

A new method requiresCompositing() is added to the Application. If it
returns true the useCompositing option will always return true and the
unredirect fullscreen option will always return false. That way
compositing is enforced at startup and cannot end by unredirecting.

In addition this method is checked if actions are performed which would
suspend compositing. E.g. the shortcut to toggle compositing. Restarting
the compositor is still possible in order to change the selected
compositing backend without a restart. But if it fails KWin will quit.
2014-01-09 15:16:42 +01:00
Martin Gräßlin 1be3a7a9f0 Introduce a method shouldUseWaylandForCompositing() in KWin::Application
Returns true if the OperationMode requires KWin to composite to a
Wayland surface. This replaces the checks for the WaylandBackend or env
variable used so far in the construction of the Scene.
2014-01-09 15:16:42 +01:00
Martin Gräßlin 6eb104b32a Introduce an OperationMode enum
This enum describes how KWin is operating with the available windowing
systems. By default KWin is using the OperationModeX11, but if the
Wayland backend gets started KWin is using the OperationModeWaylandAndX11

This will be extended in future when XWayland and Wayland only become
viable options.
2014-01-09 15:16:33 +01:00
Martin Gräßlin e92d02ab61 [kwin] Remove include of kdemacros.h from kwinglobals
Instead we generate an export header for kdeinit_kwin and use it
to declare the KWIN_EXPORT. With this change our libs don't include
any KDE4Support headers any more. One step closer to no KDE4Support.
2013-12-06 08:37:16 +01:00
Martin Gräßlin f7ff03f30b [kwin] Remove usage of KDE_VERSION_STRING
Replaced by KWIN_VERSION_STRING where useful. Support information
no longer contains the SC version number. We have to see whether
there will be a useful framework based platform information.
2013-12-05 17:20:14 +01:00
Jacob Logan ac72e9fb73 Changed debug statements in kwin/effects from qDebug() to qCDebug(KWINEFFECTS)
A new .cpp file is added containing the declaration of the logging
category and compiled into the effects lib.

REVIEW: 114194
2013-11-29 08:47:56 +01:00
Eric Newberry 02a42b355b Converted Aurorae to categorized logging. 2013-11-25 15:37:33 +01:00
Martin Gräßlin 85e3a00f27 [kwin] Fix crash checking in startup
Need to do it before we start to claim the manager selection.
2013-11-13 10:23:45 +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
Martin Klapetek 2dc5aebcc2 Inform KSplash via DBus about kwin startup
KSplash for PW2 will use DBus for setting stages instead of xatoms, this
ports kwin to send a DBus message to KSplash.

REVIEW: 113524
2013-11-04 11:17:24 +01:00
Martin Gräßlin a360d0b96e [kwin] Call QQuickWindow::setDefaultAlphaBuffer before creating first window
We want to have the QQuickWindows using translucency.
2013-10-25 13:00:50 +02:00
Martin Gräßlin e448a4bfc1 Merge branch 'KDE/4.11'
Conflicts:
	kwin/main.cpp
2013-09-26 07:54:51 +02:00
Thomas Lübking 61f1bcc991 Revert "Add ability to disable multihead support"
The variable is set not from config nor anywhere else when kwin is
started through ksmserver by startkde.

In addition the KGlobal implementation is twisted compared to the kcminit
config behavior (the config value defaults to true, not false - ie. if the
variable isn't set (by kcm init) it's reasonable to assume true either.

Therefore and in alignment with PW/2, the environment is read directly and
on absence resolved to "true".

To control the behavior, please export KDE_MULTIHEAD=true/false before starting KWin
(eg. in /usr/bin/startkde)

This reverts commit ab6d5c048a25bcb2f5bdb822ba3eda64019c61bc.

REVIEW: 112579
CCBUG: 256242
2013-09-26 07:52:47 +02:00
Martin Gräßlin 108252194a Use Xcb::Atom in KWin::Atoms to resolve all atoms
During startup we only create the request, the reply will be fetched
once the atom is needed.

To make proper use of this async behavior the creation of Atoms is
moved directly to the claim of the manager selection, so they can be
fetched while we wait for the previous manager selection to give up
on it.
2013-09-10 15:30:11 +02:00
Martin Gräßlin 64dde54f35 Perform crash count checking before we claimed the manager selection
The crash count checking does not depend on whether or not we will
be able to claim the window manager selection. As claiming the selection
can take up to one second we should try to get as many checks which do
not depend on it out.
2013-09-10 15:30:11 +02:00
Martin Gräßlin 5d6c52e26c Drop initing variable from kwin/main.cpp
It's nowhere read, just set once to true and once to false and by
that rather useless.
2013-09-10 15:30:11 +02:00
Martin Gräßlin 26c0e36400 Do not build KWin::SessionManager for the time being
KSessionManager is deprecated and there is no replacement yet. So
let's get rid of the warnings for now. Needs to be re-added once
there is a working QSessionManager again.
2013-09-09 06:03:35 +02:00
Martin Gräßlin 139201a2e2 KGlobal::config() -> KSharedConfig::openConfig()
KWin Core says good bye to KGlobal. We will not miss the threading
issues.
2013-09-04 16:11:40 +02:00
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin c1d0a32b64 Drop close on exit hack in kwin/main
See http://lists.kde.org/?l=kwin&m=137777699329758&w=2
2013-08-30 07:48:17 +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 e62001758f Drop some no longer required includes from main.cpp 2013-08-29 13:59:28 +02:00
Martin Gräßlin 1b30755b32 Use XCB for startup and multi-head check in KWin
Multi-head is somehow tested with Xvfb. At least the fork works and
the display variables are properly adjusted.
2013-08-29 13:59:28 +02:00
Martin Gräßlin 16fdecb495 Do not use KGLobalSettings::isMultiHead
KGlobalSettings is kde4supports, so just check the env variable
directly.
2013-08-29 13:59:28 +02:00
Martin Gräßlin d85802da4e Port send event to splash screen to XCB
Not yet tested.
2013-08-29 13:59:28 +02:00
Martin Gräßlin af2359ef98 Port setInputFocus in KWin::Application dtor to XCB 2013-08-29 10:41:45 +02:00
Martin Gräßlin a2d97fef17 Port KWinSelectionOwner to XCB
One usage of DefaultScreen is still present as QX11Info is not yet
providing the primaryScreen from QXcbConnection.
2013-08-29 10:34:11 +02:00
Martin Gräßlin 1f302b0c4a Drop dependency on kde_file.h in kwin/main.cpp 2013-08-29 10:34:11 +02:00
Martin Gräßlin 0dd7adf5f5 Port KWin::Application to QApplication and QCommandLineParser
Done in one step as it requires changes which are better suited with a
QApplication.

To not need to parte the QCommandLineParser around the needed arguments
are added to the KWin::Application through setters and the crash count
is available through a static getter/setter pair.
2013-08-28 14:13:39 +02:00
Martin Gräßlin 437f762466 Use xcb_atom_t for the Atoms in KWinSelectionOwner 2013-08-28 14:13:39 +02:00
Martin Gräßlin d973194c36 Use an XCB replacement for XSelectInput
Wrapped in xcbutils.

In addition the check whether another WM is running in main.cpp is
improved by doing a checked request and directly checking for the
error. If there is an error, KWin puts out an error message and
quits.
2013-08-19 10:52:22 +02:00
Martin Gräßlin bec5bcd50e Drop XSynchronize from KWin
Doesn't make any sense nowadays where we are mostly on XCB.
2013-08-15 13:25:52 +02:00
Martin Gräßlin fa9f640426 Reorder includes in kwin/main.cpp
Group by vendor - kde - qt - x
2013-08-15 13:17:29 +02:00
Martin Gräßlin d01ec8c0ff Remove not needed includes from kwin/main.cpp 2013-08-15 13:09:28 +02:00
Martin Gräßlin 87f362c953 Do not delete effects pointer from KWin::Application dtor
Not needed as the Compositor already deletes the effects pointer.
2013-08-15 13:08:49 +02:00
Martin Gräßlin 3cb4e0322f AlternativeWMDialog ported to QDialog 2013-08-15 12:54:32 +02:00
Anselmo L. S. Melo c9b079e628 Porting kwin main, data and compositingprefs to Qt5/KF5: QStandardPaths
REVIEW: 111971
2013-08-13 17:53:39 -03: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
Martin Gräßlin 5d0433f20b Drop some no longer needed includes
Less warnings
2013-08-06 11:38:52 +02:00
Martin Gräßlin bd18adcbee kdefakes.h got removed 2013-08-05 11:02:11 +02:00
Martin Gräßlin 65f6db4312 Do an XSync before trying to claim the manager selection
I was getting weird crashes inside the QPA without it.
2013-08-02 08:29:15 +02:00
Martin Gräßlin d164e16b56 Use own Xcb::sync() method in main.cpp
QApplication::syncX() is a no-op in Qt 5 so we need a replacement.
2013-07-31 07:28:15 +02:00
Martin Gräßlin 8da23f76d3 Delay startup till the manager selection is claimed
Moving all the startup code into closure connected to the
claimedOwnership signal.
2013-07-31 07:28:15 +02:00
Martin Gräßlin 03432b5618 Drop the X11ErrorHandler from KWin
The XLib error handler became a little bit useless and we don't get
access to the XCB errors, which get logged as debug messages by Qt.
2013-07-31 07:28:15 +02:00
Martin Gräßlin f11e3283d7 Introduce an XcbEventFilter and install it in the Application
Forwards all xcb events to Workspace::workspaceEvent() which got changed
to process xcb events instead of XEvents. So far all handling is
disabled. Will be re-enabled step by step in the following patches.
2013-07-29 08:58:05 +02:00
Martin Gräßlin 053841f87f KManagerSelection::claim() emits signal in case it fails
We need to connect to this signal instead of waiting for it to time out.
This means we are already starting the window manager while it might be
that we fail.
2013-07-24 09:58:41 +02:00
Martin Gräßlin 330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
2013-07-24 09:58:33 +02:00
Martin Gräßlin d45d900dc5 Fix includes in main.cpp 2013-07-24 09:47:04 +02:00