Commit graph

12085 commits

Author SHA1 Message Date
Martin Gräßlin
c1b4167598 [effects] Allow Built-In Effects using xcbutils.h
xcbutils.h has quite a few inline only implementations such as Xcb::Atom,
the Wrappers, Xcb::Window and the convenient methods. Thus there is
nothing wrong with using it from the built-in Effects.

Xcb::Atom is used in Glide and Logout Effect to get the atom. To keep the
logic of the existing code it got extended by a bool isValid() which
gets the reply and returns true if the atom is set.

REVIEW: 117587
2014-04-28 14:14:20 +02:00
Martin Gräßlin
336a870f5e [kcmkwin] Fix locating the effect configurations
No longer in kf5/ prefix.
2014-04-28 14:06:18 +02:00
Martin Gräßlin
7fcecc616c Drop "kwin4_effect_" prefix for BuiltIn Effects
This removes all the hacks to add kwin4_effect_ to the name of the Effect
and adjusts the desktop files of the effect configuration's parent
component.

Note: the scripted effects still start with kwin4_effect_ prefix.

REVIEW: 117367
2014-04-28 13:52:50 +02:00
Martin Gräßlin
4a1bc2ec96 [effects] Drop the .desktop files for the BuiltIn Effects
All KCMs and KWin core use the BuiltInEffects namespace to find and
interact with the effects. There is no information left in the desktop
file which are of usage. Thus they can be removed.
2014-04-28 13:52:43 +02:00
Martin Gräßlin
4da220adef [kcmkwin/tabbox] Use BuiltInEffects to find CoverSwitch and FlipSwitch
Instead of using the KServiceTypeTrader we use the BuiltInEffects to get
the name of CoverSwitch and FlipSwitch.

Showing the configuration dialog is migrated to KPluginTrader which fixes
the showing of the dialog.
2014-04-28 13:51:30 +02:00
Martin Gräßlin
a20903986a [kcmkwin/screenedges] Use BuiltInEffects to find the Desktop Effects
Instead of using the KServiceTypeTrader we just ask the BuiltInEffects
for the name of our Effects.
2014-04-28 13:51:30 +02:00
Martin Gräßlin
98d813050e [kcmkwin/desktop] Use BuiltInEffects for integration with Effects
The desktops KCM allows selecting between the virtual desktop switching
effects. For those it offers configuring and showing the information.

The KServiceTypeTrader based search is adjusted to be only used for the
scripted effects. The built-in effects are queried through the
information available through the BuiltInEffects namespace.
2014-04-28 13:51:30 +02:00
Martin Gräßlin
a784c91844 [kcmkwin/compositing] Use BuiltinEffects to find all built-in effects
The EffectData in BuiltinEffects is extended by all the data needed for
the desktop effects KCM:
* display name
* comment
* category
* video-url
* exclusive group
* internal

This information is taken directly from the desktop files.

The Built-in effects are now also resolved through the BuiltInEffects
namespace and the KServiceTypeTrader query is adjusted to only find the
scripted effects.

Unfortunately this introduces another round of adding "kwin4_effect_" to
load and save the effects correctly. This will be removed once all KCMs
are adjusted to use the new BuiltInEffects.
2014-04-28 13:51:30 +02:00
Martin Gräßlin
3e32bf9f56 Improve specifying the data about the built-in effects
Instead of having several hashes with data about the built-in effect,
we use a struct EffectData which contains the name, the enabled by
default state and function pointers to create, supported and check
enabled by default. There is one static vector with all the data
specified which is ordered by the BuiltInEffect enum. Thus an enum value
can be used as an index to the data.

In addition it's no longer resolved around QByteArray, but uses QString.

REVIEW: 117354
2014-04-28 13:48:50 +02:00
Martin Gräßlin
e4be4082a0 Require xkbcommon 0.4.1
That's the version required in Qt 5.3 and causing issues if there's a
mismatch in versions.

CCBUG: 333459
2014-04-28 12:07:28 +02:00
l10n daemon script
e1f418f4d0 SVN_SILENT made messages (.desktop file) 2014-04-28 09:00:35 +00:00
Martin Gräßlin
7d302b9039 Keep timestamp of last syncRequest and update with xTime on each sync
The sync protocol with e.g. Qt 4 windows is broken if our app time is
older than the one of the last sync alarm event. Thus we keep a timestamp
in the syncRequest struct of the last sent sync request. If the timestamp
is newer than our xTime when sending the next request, we update the
xTime to ensure that we have a new timestamp again.

BUG: 333512
REVIEW: 117734
2014-04-28 07:45:53 +02:00
l10n daemon script
f44575ddbf SVN_SILENT made messages (.desktop file) 2014-04-28 05:16:52 +00:00
l10n daemon script
69c3289c18 SVN_SILENT made messages (.desktop file) 2014-04-27 21:02:43 +00:00
l10n daemon script
ac9c8f6852 SVN_SILENT made messages (.desktop file) 2014-04-27 05:24:22 +00:00
Alex Merry
4804964b3d Install kwin.notifyrc to the correct location 2014-04-26 22:27:35 +01:00
Aleix Pol
220da8a4e5 Adapt to changes in KDEInstallDirs
kde5/services is kservices5
kde5/servicetypes is kservicestypes5
2014-04-26 19:27:52 +02:00
Alex Merry
e5a1f9b309 Remove CONFIG argument from find_package(KF5)
This is no longer wanted, since ECM has a FindKF5 module.
2014-04-26 11:03:30 +01:00
Martin Gräßlin
b92f4a6991 [kwincompositing-kcm] Fix the reinit signal invocation
REVIEW: 117700
2014-04-25 10:04:04 +02:00
Michael Palimaka
801873b216 Fix configure failure when optional packages are missing.
When find_package(KF5 CONFIG REQUIRED) is called, any subsequent
find_package(KF5) calls will be marked as required too. So,
find optional frameworks separately to avoid configure failure
if they are missing.

Also add information about the status of the optional packages
to the feature summary.

REVIEW: 117728
2014-04-24 22:34:26 +10:00
Martin Gräßlin
8e63102855 Discard all deleted before constructing the Scene
The Scene connects to the deletedRemoved signal and tries to remove the
Deleted from it's list of Windows, which will fail because a SceneWindow
doesn't get created for an existing Deleted in the Scene setup.

It doesn't make sense to create a SceneWindow for a Deleted as there is
no pixmap around anyway. Thus the best approach is to ensure that there
are no Deleted by just discarding all prior to creating the Scene.

BUG: 333275
REVIEW: 117557
2014-04-23 15:05:27 +02:00
Marco Martin
ad7e1f6260 don't do fadeout on ksplashqml 2014-04-23 13:24:37 +02:00
Marco Martin
b42cbe66ba make ksplashqml work again 2014-04-23 13:21:22 +02:00
l10n daemon script
4242a0e009 SVN_SILENT made messages (.desktop file) 2014-04-23 04:57:49 +00:00
l10n daemon script
8d83f165d1 SVN_SILENT made messages (.desktop file) 2014-04-20 04:39:49 +00:00
Michael Palimaka
1bca6c3dfa Disable testing if QtTest is not found.
REVIEW: 117393
2014-04-18 16:43:24 +10:00
Martin Gräßlin
f247a41396 [glutils] Forward declare void KWin::cleanupGL() in kwinglplatform.h
Fixes build with clang.
2014-04-17 08:04:53 +02:00
Martin Gräßlin
b45eeae352 [Xcb::Wrapper] Introduce a Property and StringProperty Wrapper subclass
The Xcb::Property can wrap the xcb_get_property call and provides
convenient access methods to read the value of the reply with checks
applied. For this it provides a templated ::value method for reading a
single value or reading an array. There's also a ::toBool and
::toByteArray which performs the conversion directly with default values
for the type and format checks.

Xcb::TransientFor is changed to be derived from Property instead of
Wrapper directly, so that the reading of the property value can be
shared.

Xcb::StringProperty is a convenient wrapper derived from Property to
handle the reading of a string property providing a cast to QByteArray
operator. This replaces the ::getStringProperty from utils. Though the
separator functionality from ::getStringProperty is not provided as that
is only used in one function and handled there.

All the custom usages of xcb_get_property or getStringProperty are
replaced to use this new wrapper. That simplifies the code and ensures
that all properties are read in the same way.

REVIEW: 117574
2014-04-17 07:41:33 +02:00
Martin Gräßlin
8d3b12b928 [Xcb::Wrapper] Change the Wrapper to use variadic template arguments
So far the Wrapper class was not able to properly wrap all xcb calls and
there was the restriction that the request function needs to have an
xcb_window_t argument. The result was that wrapper functions were used
for calls with no arguments or for multiple arguments, but in a rather
limited way.

By using variadic template arguments this restriction is removed and the
Wrapper is able to wrap any xcb request/reply group. The main difference
is how the function pointers are defined. Those cannot be specified as
template arguments as the variadic arguments need to be the last in the
list.

The pointers are now defined by a WrapperData struct. For complete usage
please see the extensive documentation added to WrapperData on how it is
supposed to be used.

REVIEW: 117559
2014-04-17 07:41:11 +02:00
Martin Gräßlin
98f259d63e [Xcb::Wrapper] Add unit test for TransientFor 2014-04-17 07:41:11 +02:00
Martin Gräßlin
e25abdf3bb [Xcb::Wrapper] Add unit test for CurrentInput 2014-04-17 07:41:11 +02:00
Martin Gräßlin
9db9f172bc [Xcb::Wrapper] Add a unit test for Xcb::Tree
Based on the test Tree::children() is extended for a test case on no
children which used to return a garbage pointer.
2014-04-17 07:41:11 +02:00
Martin Gräßlin
4230a0d331 [effects] Get xcb_connection_t* and rootWindow through EffectsHandler API
So far the effects could just use the connection() and rootWindow()
provided by kwinglobals. Thus an internal detail from KWin core is
accessed directly.

To be more consistent with the rest of the API it's wrapped through the
EffectsHandler and with a convenient method in Effect.

The connection() is provided as xcbConnection() to free the very generic
name connection which could create confusion once we provide a wayland
connection to the Effects.

The rootWindow() is provided as x11RootWindow() to indicate that it is
for the X11 world.

REVIEW: 117597
2014-04-16 16:05:05 +02:00
Martin Gräßlin
93e5ebac63 Try to wait for DESTROY_NOTIFY before releasing an Unmanaged
So far the Unmanaged got released after an XCB_UNMAP_NOTIFY. This event
gets created after xcb_unmap_window or after xcb_destroy_window. In the
latter case the window is already distroyed and any of KWin's cleanup
calls will cause a BadWindow (or similar) error.

The idea to circumvent these errors is to try to wait for the
DESTROY_NOTIFY event. To do so the processing of the release is slightly
delayed. If KWin gets the destroy notify before the delay times out the
Unamanged gets released immediately but with a Destroy flag. For this a
new enum ReleaseToplevel is introduced and Unmanage::release takes this
as an argument instead of the bool which indicated OnShutdown. Also this
enum is added to Toplevel::finishCompositing so that it can ignore the
destroyed case and not generate an error.

REVIEW: 117422
2014-04-16 13:32:11 +02:00
Martin Gräßlin
d2d89653b2 Print better error messages for XCB errors from extensions
Qt doesn't print proper error messages for any errors caused by
extensions. As KWin is a heavy user of extensions not of interest to Qt
(e.g. damage or composite) we do our own error code mapping.

The Xcb::ExtensionData is extended by a vector of OpCodes and ErrorNames.
In ::workspaceEvent it's checked whether the event is an error and if
that is the case KWin tries to map the error to one of the extensions.

If that is successful it prints a warning looking like Qt's one:
XCB error: 151 (BadDamage), sequence: 12534, resource id: 127926362, \
    major code: 143 (DAMAGE), minor code: 2 (Destroy)

and the event gets filtered out, so that the Qt error messages is not
printed in addition.

If the error is not from one of the extensions the error is not filtered
out and so the default Qt behavior gets applied.

REVIEW: 117421
2014-04-16 13:30:31 +02:00
Martin Gräßlin
fd0fd82ad6 Use NETWM to get updates on blocking compositing
Adds NET::WM2BlockCompositing to the Client's properties which allows to
read the state from the NETWinInfo object and get updates without having
to resolve the atom ourselve.

REVIEW: 117561
2014-04-14 15:34:39 +02:00
Martin Gräßlin
c63e3533f4 Get Toplevel::resourceName() and ::resourceClass() from NETWinInfo
It's provided by the NETWinInfo, no need to keep an own implementation.
To keep compatibility with existing KWin code using the window class or
resource it's always converted to lower.

In addition a notify signal Toplevel::windowClassChanged is added and
emitted from the event handler whenever the WM2WindowClass property is
set.

REVIEW: 117496
2014-04-14 08:46:38 +02:00
Martin Gräßlin
b8cc10ffab [kwinglutils] Improve cleanup handling
* add static cleanup handlers to GLTexturePrivate and GLRenderTarget
* revert the runtime resolved features (e.g. RenderTargets are not
  supported once we run the cleanup code)
* clear the extension lists
* reset the version variables

REVIEW: 117484
2014-04-14 08:33:19 +02:00
Martin Gräßlin
c837ffddf4 Add a cleanup() method to GLPlatform
Adds a cleanup() method to GLPLatform which deletes the static instance.
It gets invoked from cleanupGL() in kwinglutils on tear-down of the
OpenGL backend. Thus the backend doesn't leave incorrect GL info around.

E.g. if KWin starts with llvmpipe the recommended compositor is XRender.
So the backend and the platform is created. Now KWin starts the XRender
Compositor and the GLPlatform is still valid and when trying to load the
Blur or Contrast effect this will succeed as the GLPlatform data would
allow it. But on first try to use the Effect it will fail due to no
valid OpenGL context and even crash.

REVIEW: 117480
2014-04-14 08:31:39 +02:00
l10n daemon script
09d421fbb4 SVN_SILENT made messages (.desktop file) 2014-04-14 05:00:20 +00:00
l10n daemon script
d117d38efa SVN_SILENT made messages (.desktop file) 2014-04-13 05:18:57 +00:00
Marco Martin
7380379fcf we don't have different widgets for vd anymore 2014-04-11 16:46:28 +02:00
Martin Gräßlin
651ea9f374 [blur|contrast] Explicitly check for openglCompositing in ::supported()
Ensures that the further checks are not performed on XRender compositing.

REVIEW: 117497
2014-04-11 08:36:43 +02:00
Martin Gräßlin
1c0d0211ca Add const method variants to Xcb::Wrapper
Adding a const variant for ::data() to remove an unexpected copy.
To complete also the bool cast operator and isNull get a const
variant.

REVIEW: 117469
2014-04-11 07:36:18 +02:00
Martin Gräßlin
acdff6ea52 Drop static getStringProperty wrappers in Toplevel
The methods Toplevel::staticWmCommand and Toplevel::staticSessionId were
both only used from one method and just wrapping an invocation to
getStringProperty.

REVIEW: 117474
2014-04-10 18:10:58 +02:00
Martin Gräßlin
f1f6d6eea8 Get windowRole from NETWinInfo instead doing it ourself
NETWinInfo provides windowRole if NET::WM2WindowRole is added to the
properties2. Thus KWin doesn't need to monitor and fetch itself, but
can just wrap the data provided by NETWinInfo.

In addition a signal is added to Toplevel whenever the window role
changes.

REVIEW: 117470
2014-04-10 15:57:00 +02:00
Martin Gräßlin
cf498cc14b Use KWindowInfo::clientMachine in ClientMachine::resolve
Let's use the available API instead of duplicating code.

Nice side effect: client_machine.cpp doesn't include utils.h any more
which simplifies the unit test.

REVIEW: 117473
2014-04-10 15:55:17 +02:00
Martin Gräßlin
4a79cec8a6 Drop hacks and default rule for XV
Apparently it's not about mplayer but about XV [1], not really a relevant
application nowadays which would be important enough for having hacks.

REVIEW: 117479

[1] https://en.wikipedia.org/wiki/Xv
2014-04-10 15:04:19 +02:00
Martin Gräßlin
6828f33548 Remove hack for "mozilla"
It's dead, since 2006 it's "SeaMonkey" and it has a proper window class:
WM_CLASS(STRING) = "Navigator", "Seamonkey"

(Yes, I installed it. No, my distro doesn't have a package.)

REVIEW: 117472
2014-04-10 11:36:37 +02:00
l10n daemon script
003ba3f343 SVN_SILENT made messages (.desktop file) 2014-04-10 05:10:58 +00:00