Commit Graph

327 Commits (8bdbe4dc159075859e268f6eaa170db686436155)

Author SHA1 Message Date
Martin Gräßlin 89c2fd5598 Remove YesIKnowWhatImDoing from internal API
No need to have Allowed everywhere.

REVIEW: 110197
2013-04-26 12:29:42 +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 a836612a92 Move Composite suspended by dbus notification directly to where it's used 2013-04-23 16:21:30 +02:00
Martin Gräßlin 0fb27fd12e Defines to create the boilerplate code for KWin's singleton classes
The define KWIN_SINGLETON adds to a class definition:

public:
    static Foo *create(QObject *parent = 0);
    static Foo *self() { return s_self; }
protected:
    explicit Foo(QObject *parent = 0);
private:
    static Foo *s_self;

There is an additional define KWIN_SINGLETON_VARIABLE to set a different
name than s_self.

The define KWIN_SINGLETON_FACTORY can be used to generate the create
method. It expands to:

Foo *Foo::s_self = 0;
Foo *Foo::create(QObject *parent)
{
    Q_ASSERT(!s_self);
    s_self = new Foo(parent);
    return s_self;
}

In addition there are defines to again set a different variable name and
to create an object of another inheriting class.

All the classes currently using this pattern are adjusted to use these
new defines. In a few places the name was adjusted. E.g. in Compositor
the factory method was called createCompositor instead of create.

REVIEW: 109865
2013-04-15 09:57:25 +02:00
Alexander Mezin 8741789fd2 Don't redirect/unredirect windows too frequent
REVIEW: 109795
2013-04-02 08:15:57 +02:00
Martin Gräßlin 0ccc060218 Include KGlobal were needed
With KF5 some includes which used to include KGlobal, e.g. KStandardDirs
do no longer include KGlobal. So if we use KGlobal we should include it.
2013-03-07 13:59:15 +01:00
Martin Gräßlin 60c42b7a34 s/KLocale/KLocalizedString/g
Many headers included KLocale to use i18n and co. But those methods are
defined in KLocalizedString and not in KLocale.

With KF5 klocale.h does no longer include KLocalizedString causing lots
of compile errors.
2013-03-07 13:59:15 +01:00
Martin Gräßlin 32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
2013-03-06 10:26:56 +01:00
Thomas Lübking 9aef5b85a0 support a permanent glSwapBuffer
either by
- forcing fullrepaints unconditionally
- turning a repaint to a full one beyond a threshhold
- completing the the backbuffer from the frontbuffer after the paint

BUG: 307965
FIXED-IN: 4.10
REVIEW: 107198
2013-03-05 19:24:30 +01:00
Martin Gräßlin f12cf0efba Replacement class for QCursor
With Qt5 QCursor does no longer provide ::handle() which was used to
set a cursor on a native XWindow for which we do not have a QWidget.

Also KWin has had for quite some time an optimized version to get the
cursor position without doing XQueryPointer each time ::pos() is called.

These two features are merged into a new class Cursor providing more or
less the same API as QCursor.

In addition the new class provides a facility to perform mouse polling
replacing the implementations in Compositor and ScreenEdges.

For more information about the new class see the documentation for the
new class in cursor.h.
2013-02-25 13:35:14 +01:00
Thomas Lübking 48128f268c improve multihead situation
prevents the focus being passed to the other head
manages OpenGLIsUnsafe setting per head

CCBUG: 256242
BUG: 282677
REVIEW: 107853
FIXED-IN: 4.11
2013-02-18 21:55:13 +01:00
Martin Gräßlin 6ade1f3ca5 Do not update screen edges when compositing settings changes
The comment says it all: update all settings which can be done through
the compositing KCM. Years ago screen edges was in the composite KCM, but
it no longer is. So there is no need to update the edges when the
compositing settings changes.
2013-02-07 09:46:51 +01:00
Martin Gräßlin 6c213d4392 Make use of new Xcb Wrapper classes
Use WindowAttributes and WindowGeometry everywhere where the xcb commands
had already been used.

Introduces another wrapper for overlay window and a subclass for query
tree which also wrapps the children command.
2013-01-25 08:51:38 +01:00
Thomas Lübking c8e2b61f48 32 bit compositing suspension
REVIEW: 108304
BUG: 308438
2013-01-23 21:27:46 +01:00
Martin Gräßlin 5f4935fc66 Merge branch 'KDE/4.10'
Conflicts:
	kwin/workspace.cpp
2013-01-14 15:43:01 +01:00
Martin Gräßlin 412afa3dcd Remove asserts from Compositor and wrap Toplevel::compositing() around Workspace::compositing()
BUG: 312712
FIXED-IN: 4.10
REVIEW: 108321
2013-01-14 15:41:08 +01:00
Martin Gräßlin 334b4bf622 Move handling of Virtual Desktops into a VirtualDesktopManager
The ownership for virtual desktops is moved from Workspace into a new
VirtualDesktopManager. The manager is responsible for providing the count
of virtual desktops and keeping track of the currently used virtual
desktop.

All methods related to moving between desktops are also moved from
Workspace to the new manager, though all methods related to Clients on
Virtual Desktops remain in Workspace for the time being. This is to have
the new manager as independent from KWin core as possible.

An rather important change for the handling of virtual desktops is that
the count and the id of a desktop is now an unsinged integer instead of
an integer. The reason for that is that we cannot have a negative count
of desktops as well as it is not possible to be on a desktop with a
negative identifier.

In that regard it is important to remember that a Client can be on a
desktop with a negative identifier. The special value for a Client being
on all desktops is handled by using -1 as a desktop. For the time being
this is not adjusted but instead of comparing the virtual desktop ids one
should prefer to use the convenient methods like isOnDesktop and
isOnAllDesktops. This would allow in future to internally change the
representation for on all desktops.
2013-01-07 09:47:51 +01:00
Thomas Lübking 708df9b564 NULL Compositor global static on deletion
what moc can do any time for the Workspace deconstructor
BUG: 308040
FIXED-IN: 4.10
REVIEW: 108007
2013-01-02 19:05:10 +01:00
Thomas Lübking cfda9e240d collect shadows of existing clients when toggling the compositor
REVIEW: 107965
2013-01-02 18:43:14 +01:00
Martin Gräßlin 71d5acca00 Fix spelling 2013-01-02 18:35:46 +01:00
Thomas Lübking 8239c686f6 NULL Compositor global static on deletion
what moc can do any time for the Workspace deconstructor
BUG: 308040
FIXED-IN: 4.10
REVIEW: 108007
2013-01-02 18:25:09 +01:00
Thomas Lübking b61f7c7cc2 collect shadows of existing clients when toggling the compositor
REVIEW: 107965
2013-01-02 18:24:15 +01:00
Martin Gräßlin 67174bbf69 Remove outdated and not very useful comment sections
If a section of comments consists of a list of links and all are broken
it's a sign that nobody has used these comments for a long time...

REVIEW: 107933
2012-12-30 09:52:42 +01:00
Martin Gräßlin aa34e8ec18 Port (un)redirecting (sub)windows to XCB 2012-12-20 16:30:39 +01:00
Martin Gräßlin a798a2d3d6 Port create/discardWindowPixmap to XCB 2012-12-20 16:30:39 +01:00
Martin Gräßlin 0ffc8cefc7 Remove not-needed cast to int
The compared values are uint, so there's no need to cast and it is
incorrect in this case.

REVIEW: 107469
2012-11-26 16:37:30 +01:00
Fredrik Höglund bb9f59a89c kwin: Use xcb to optimize damage event handling
Use XDamageReportNonEmpty instead of XDamageReportRawRectangles.

In XDamageReportNonEmpty mode the server generates a single damage
event when the damage state transitions from not-damaged to damaged.
When the compositor is ready to paint the screen, it requests the
damage region for each window and resets the state to not-damaged.

With XCB we can request the damage regions for all windows in a
single roundtrip, making this the preferred mode.

This should reduce the number of wakeups and the time spent
processing damage events between repaints.
2012-11-07 22:17:14 +01:00
Fredrik Höglund 5f220bef2e Revert "delay unsynced window ready_for_painting state"
The next commit will solve this problem in a different way.

This reverts commit e617f176d1e293abcaafbb14d0afcf8aee24f054.
2012-11-07 22:16:49 +01:00
Martin Gräßlin 986d9e5613 Delay releasing the compositor selection
When turning off the compositor do not release the compositor selection
directly but delay it through a timer. The idea is that the internal
change when e.g. restarting the compositor or switching from XRender to
OpenGL should not be visible to the outside world.

This hopefully makes restarting the compositor more robust in Plasma due
to the SelectionWatcher sometimes reporting incorrect results.

When restarting KWin the change does not matter as the selection gets
force claimed by the new instance anyway.

CCBUG: 179042
REVIEW: 106844
2012-10-25 11:23:34 +02:00
Martin Gräßlin 6d2dfe06e7 Introduce dedicated OpenGL1 and OpenGL2 compositing types
The CompositingType enum turns into flags and two new values are
introduced: OpenGL1Compositing and OpenGL2Compositing.

Those new values are or-ed to OpenGLCompositing so that a simple check
for the flag OpenGLCompositing works in case of one of those two new
values. To make the generic check for OpenGL compositing easier a method
in EffectsHandler is introduced to just check for this.

The scenes now return either OpenGL1Compositing or OpenGL2Compositing
depending on which Scene implementation. None returns OpenGLCompositing.
2012-09-29 15:33:57 +02:00
Martin Gräßlin 5a6d9400b2 Split SceneOpenGL into a concrete SceneOpenGL1 and SceneOpenGL2
SceneOpenGL turns into an abstract class with two concrete subclasses:
* SceneOpenGL1
* SceneOpenGL2

It provides a factory method which first creates either the GLX or EGL
backend which is passed to a static supported() method in the concrete
sub classes. These method can test whether the backend is sufficient to
be used for the OpenGL version in question. E.g. the OpenGL 2 scene
checks whether the context is direct.

The actual rendering is moved into the subclasses with specific OpenGL 1
and OpenGL 2 code. This should make the code more readable and requires
less checks whether a Shader is bound. This is now known through the
Scene: the OpenGL1 scene will never have a shader bound, the OpenGL2 scene
will always have a shader bound.

To make this more reliable the ShaderManager is extended by a disable
method used by SceneOpenGL1 to ensure that the ShaderManager will never
be used. This also obsoletes the need to read the KWin configuration
whether legacy GL is enabled. The check is moved into the supported
method of the OpenGL2 scene.

REVIEW: 106357
2012-09-16 21:28:11 +02:00
Martin Gräßlin 9820e4daf6 Introduce dedicated suspend and resume methods on Compositing interface
The new methods suspend and resume are meant to provide a better way to
influence the current compositing state than toggleCompositing. In
addition an overload setCompositing(bool) is added. The resume method is
implemented in a way that it can be used to try to start the compositor
again in case it failed.

Internally the method suspendResume is dropped as it does the same as
setCompositing just with inverted binary logic and worse name. The
compositingToggled signal is now emitted from within setup and finish to
ensure that especially the compositingToggled(true) signal is only
emitted if the Compositor could start.

Also the updateCompositingBlocking is adjusted to use the new dedicated
suspend and resume methods instead of the toggle method.

REVIEW: 106273
2012-09-06 09:59:20 +02:00
Martin Gräßlin 35237aadcb Splitting up of KWin's global D-Bus interface
Two new interfaces are introduced:
* org.kde.kwin.Compositing
* org.kde.kwin.Effects

The Compositing interface is generated from scriptable elements on the
KWin::Compositor class and the Compositor is exported as /Compositor.
It provides the general Compositing related D-Bus methods like whether
the compositor is active and toggling and so on.

The Effects interface is generated from scriptable elements on the
KWin::EffectsHandlerImpl class and the instance is exported as /Effects.
It provides all the effects related D-Bus methods like loading an effect
or the list of all effects.

This removes the need to have all these methods provided on the global
org.kde.KWin interface. For backwards compatibility they are kept, but
no longer provided by the Workspace class. Instead a new DBusInterface
is generated which wrapps the calls and delegates it to one of our three
related Singleton objects:
* Workspace
* Compositor
* EffectsHandlerImpl
2012-09-06 09:58:12 +02:00
Martin Gräßlin 7497ef9148 Make the Compositor a proper Singleton
The Compositor class actually behaves like a Singleton so it should be
one. Therefore four static methods are added:
* self() to access the Singleton
* createCompositor() to be used by Workspace to create the instance
* isCreated() to have a simple check whether the Singleton is already
  created
* compositing() as a shortcut to test whether the compositor has been
  created and is active

The isCreated() check is actually required as especially Clients might
be created and trying to access the Compositor before it is setup.
2012-09-06 09:55:22 +02:00
Thomas Lübking ad2059bdbe fix flicker with fullscreen effects
BUG: 304375
FIXED-IN: 4.9.1
REVIEW: 106142
2012-08-28 21:29:12 +02:00
Thomas Lübking 976037717b delay unsynced window ready_for_painting state
by at max 50ms (and thus trigger a full repaint with the state change)

BUG: 295254
REVIEW: 106173
FIXED-IN: 4.9.1
2012-08-28 21:08:02 +02:00
Martin Gräßlin 7a1fe42be0 Fix uninitialized memory and logic error in PaintRedirector
The refactoring of Compositor starting with b1739c3 caused some
regressions due to variables in Workspace and Compositor not
being initialized. Furthermore there was a boolean logic error
in PaintRedirector causing the decorations not to paint.

BUG: 305875
2012-08-27 19:45:01 +02:00
Martin Gräßlin 8e5b2ae1aa Pass Compositor to EffectsHandlerImpl
Obsoletes the need to go through the Workspace object to get to
the Compositor.

TODO for future: make the Compositor being the parent object for
the EffectsHandlerImpl.

Closing Review and bug from this commit, which is the top most
of the patch series.

REVIEW: 106060
BUG: 299277
FIXED-IN: 4.10
2012-08-26 20:49:08 +02:00
Martin Gräßlin 62c4d449f5 Use signals'n'slots instead of deep function call into Compositor
For most actions where the compositor needs to perform an action
(e.g. scheduling another repaint) signals were already emitted.
So it's easier to just connect the signals to the Compositor
which in turn makes the code much more readable.

All signals are connected from the Workspace when either the
Compositor gets constructed or a Toplevel gets created.
2012-08-26 20:44:46 +02:00
Martin Gräßlin 0f2e5e61a8 Move reinitializeCompositing and restartKWin into the Compositor
The DBus signal which causes KWin to reinitialize the Compositor
is moved into the Compositor as everything can be handled from
there as well. This comes together with moving the restartKWin
functionality into the Compositor as it is only relevant there.
Restart will only happen if the wrong Qt graphicssystem is used
for the chosen compositing backend.
2012-08-26 20:44:46 +02:00
Martin Gräßlin df6c423962 Connect the lost CM Ownership directly to finish slot
All the custom slot did was printing a debug statement and
calling finish. We do not need this debug statement. The times
of Compositors not part of Window Managers are over, so it is
extremely unlikely that we lose the ownership without KWin
going down anyway.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 28a5487d4d Drop compositing prefixes from methods and variables in Compositor
Yes everything in the Compositor is related to compositing, no
need to state it everywhere.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 2d954a6bf3 Make the Scene owned by the Compositor
The Scene has always been created and destroyed inside what is
now the split out compositor. Which means it is actually owned
by the Compositor. The static pointer has never been needed
inside KWin core. Access to the Scene is not required for the
Window Manager. The only real usage is in the EffectsHandlerImpl
and in utils.h to provide a convenient way to figure out whether
compositing is currently active (scene != NULL).

The EffectsHandlerImpl gets also created by the Compositor after
the Scene is created and gets deleted just before the Scene gets
deleted. This allows to inject the Scene into the EffectsHandlerImpl
to resolve the static access in this class.

The convenient way to access the compositing() in utils.h had
to go. To provide the same feature the Compositor provides a
hasScene() access which has the same behavior as the old method.
In order to keep the code changes small in Workspace and Toplevel
a new method compositing() is defined which properly resolves
the state. A disadvantage is that this can no longer be inlined
and consists of several method calls and pointer checks.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 523b537962 Use singleton accessor for Workspace in Compositor
Replaces the member variable which is actually not needed as a
pointer to the Workspace can always be retrieved through the
singleton accessor of Workspace.
2012-08-26 20:43:56 +02:00
Arthur Arlt f3739469a2 Move Workspace's compositing functions to own class Compositor
All Workspace functions which were implemented in the file composite.cpp
were moved to an own class Compositor. The header entries were moved as well.
All functions calls are updated.
2012-08-26 20:43:56 +02:00
Martin Gräßlin ab6e4a41da Do not discard popup when compositing state changes
Not needed any more as the menu does no longer contains any
compositing related functionality.
2012-08-26 20:38:45 +02:00
Martin Gräßlin 46996d318e Split the User Actions Menu out of Workspace
All methods and variables related to the User Actions Menu
(rmb window deco, Alt+F3) is moved out of the Workspace class
into an own UserActionsMenu class.

The class needs only a very small public interface containing
methods to show the menu for a Client, closing the menu and
discarding the menu. Everything else is actually private to the
implementation which is one of the reasons why it makes sense
to split the functionality out of the Workspace class.

As a result the methods and variables have more sane names and
the variable names are standardized.

REVIEW: 106085
BUG: 305832
FIXED-IN: 4.10
2012-08-26 20:32:31 +02:00
Martin Gräßlin 2c23c6e864 Spellchecking
SVN_SILENT
2012-08-16 08:03:07 +02:00
Thomas Lübking 86c22ff9ca fix conditional glXSwapInterval usage
and cleanup profiling relics

REVIEW: 105632
BUG: 303397
2012-07-21 19:59:09 +02:00
Thomas Lübking fc665106c9 Swap vsync order, trade in 1frame lag
REVIEW: 103058
2012-05-17 11:41:26 +02:00
Martin Gräßlin d14cf2da92 Show detailed information why an effect cannot be loaded
Effects can specify their minimum requirements in their
desktop file:
* OpenGL
* OpenGL 2 (GLSL required)
* Shaders (either ARB or OpenGL 2)

The configuration module uses this information in combination
with which backend KWin is currently using. So if e.g. OpenGL
is used and an effect requires OpenGL 2 a detailed error
message can be showed that OpenGL 2 is required.

BUG: 209213
FIXED-IN: 4.9.0
REVIEW: 104847
2012-05-15 18:02:57 +02:00
Thomas Lübking ee53114054 erase vector instead of clearing it to preserve the pre-allocated memory
CCBUG: 299594
REVIEW: 104897
2012-05-10 19:33:40 +02:00
Martin Gräßlin f1a50e0fb5 Only create decoration once during Client::manage
Client::manage calls setupCompositing on the not
yet fully managed client before it wants to create
the window decoration. This means the decoration is
created twice and maybe even if not needed (noBorder
not yet set).

If the Client is not yet managed setupCompositing
will not update the decoration - it will be handled
by manage later on.

Furthermore if compositing is not active, setup
compositing does not have to perform any action.

REVIEW: 104758
2012-05-01 08:49:20 +02:00
Martin Gräßlin de5003299b Don't recreate the decoration on release window
When a window is going to be closed there is no
need to recreate the window decoration from
finishCompositing.

REVIEW: 104759
2012-05-01 08:49:20 +02:00
Martin Gräßlin e3f2dd7612 Move KServiceTypeTrader query for Effects into a thread
By moving the query for effects into an own thread the
startup does not have to wait till all effects are loaded.
The thread moves the loading of the effects after the
Window Manager and Compositor has been fully initialized.
This is possible as EffectsHandler is fully functional even
without any effects.

The compositor ensures that at least one frame is rendered
before the started thread returns which makes the complete
startup more responsive.

REVIEW: 104583
2012-05-01 08:49:20 +02:00
Martin Gräßlin bb5dce0e3b Use KGlobal::config() instead of specifying kwinrc
Inside KWin we can just use the global configuration
instead of manually opening kwinrc which is just the
same.

REVIEW: 104754
2012-04-29 21:55:45 +02:00
Martin Gräßlin 6919b4dc94 Drop CompositingPrefs from Compositing KCM
Instead of getting the information from CompositingPrefs
the running KWin instance is queried through D-Bus.
In general the running KWin should have more information
about whether Compositing will work or not.

This means the kcm no longer has to link OpenGL.

REVIEW: 104753
2012-04-29 21:50:09 +02:00
Martin Gräßlin 704902720b Perform detection of CompositingPrefs async
Detecting CompositingPrefs invokes an external program. Waiting
for this can be moved in a second thread.

Due to the introduction of the thread the initialization order
of KWin is changed: the WindowManager is initialized before the
Compositor. Interestingly this makes KWin felt more responsive
as the screen is not frozen for several seconds.

REVIEW: 104579
2012-04-29 21:47:04 +02:00
Martin Gräßlin b49356bc33 Do not perform setupCompositing on Client if Toplevel is not setup
Toplevel::setupCompositing returns a boolean value and returns
false in the cases where it has not setup compositing.

This is used by the specialization on Client to not perform the
Client specific setup if Toplevel has not setup.

REVIEW: 104767
2012-04-28 09:42:26 +02:00
Thomas Lübking 1070bf895b split decorationRect / visibleRect usage
REVIEW: 104215

cherry-picked from 0f3380f3b10e57416f81a1288dc10b8dfe11d87e
Conflicts:

	kwin/geometry.cpp
	kwin/scene.cpp
2012-03-21 00:36:50 +01:00
Martin Gräßlin 212908ee88 Refactoring of KWin::Options: getter methods instead of public variables 2012-02-27 19:31:58 +01:00
Martin Gräßlin 7f0770f99d Properly ifdef everything requiering HAVE_XSYNC
REVIEW: 104080
2012-02-26 17:22:38 +01:00
Philipp Knechtges 239d5757f2 kwin: move/resize events shall not force a repaint of all layers
This patch adds a new function Toplevel::addLayerRepaint, that in contrast
to addWorkspaceRepaint does not invalidate every blur texture cache that
overlaps with that region. As the name suggests it rather invalidates the
to the window associated layer at that position. This is especially useful
in the case of move/resize events in combination with oxygen-transparent,
where the altered window is almost always the topmost window and the blur
texture cache of the windows underneath are unchanged.

For the case of fully opaque windows the behaviour of addLayerRepaint
and addWorkspaceRepaint should be same.

REVIEW: 103906
2012-02-12 16:57:12 +01:00
Martin Gräßlin 3c59983589 EffectWindow becomes a QObject 2012-01-27 08:21:52 +01:00
Martin Gräßlin f5b93b0159 Remove scene basic
Was never used and it is unlikely that it would work at all after
all the changes over the last years.
2012-01-27 08:19:00 +01:00
Thomas Lübking 4d7161dd75 Delay added signal and other signal bindings for synced windows until the window is actually visually shown
Makes animations of showing windows run completely and thus appear smoother

REVIEW: 103742
2012-01-24 22:43:10 +01:00
Thomas Lübking 3b2476850e add dbus debug "activeEffects"
REVIEW: 103572
CCBUG: 288948
CCBUG: 290025
2012-01-02 18:54:12 +01:00
Thomas Lübking 0b23c516a7 add support for graphicssystem selection
REVIEW: 103430
CCBUG: 289904
2012-01-02 18:53:20 +01:00
Thomas Lübking d73c46925d fix gravitation after compositor "polluted" it by updating the decoration _before_ placement
BUG: 278981
REVIEW: 103391
2011-12-18 19:51:25 +01:00
Martin Gräßlin 6c62fcd400 Make use of resize effect when resizing windows
Fixes a regression. When resize effect is available we can do a
fast resizing by only perform the resizing after the user ended
resizing the window.

REVIEW: 103363
2011-12-09 20:48:46 +01:00
Thomas Lübking 796c9d43ae "do NOT attempt to call suspendCompositing(true); from within the eventchain!" either...
sth. changed, possibly damage collection - dunno. however this now leads to undefined states as well
can't reproduce bug #280508 afterwards either - pot. implicitly fixing by bypassing pollution (BeFaded was
probably just resistent by different stacking order handling)

CCBUG: 280508
2011-11-24 20:17:20 +01:00
Thomas Lübking bdc3cc5564 skip empty damages, reset damageRatio also when pixmaps are created 2011-11-09 21:24:07 +01:00
Marco Martin 69ad0fc5fc Merge branch 'master' into ksplash/ksplash-qml 2011-11-03 21:00:01 +01:00
Fredrik Höglund ebd0d9303b kwin: Replace calls to QElapsedTimer::restart() with start()
It doesn't make sense to call restart() without using the return
value, or when the timer has never been started.
2011-10-29 17:41:16 +02:00
Andriy Rysin 4317ca8e88 Revert "Make kwin compile without OpenGL libs"
This reverts commit 940db4e348cf3ee016df04484616df7599504863.
2011-09-30 18:30:49 -04:00
Andriy Rysin e94f58dd1b Make kwin compile without OpenGL libs
REVIEW: 101418
2011-09-29 23:27:16 -04:00
Marco Martin a95019e713 Merge branch 'master' into ksplash/ksplash-qml 2011-09-26 14:11:29 +02:00
Martin Gräßlin 6e15c0c208 Change timers to QElapsedTimers
Instead of calculating the elapsed time from epoch clock, using
a QElapsedTimer as well as reusing the timer object instead of
creating a new one in the scene each frame.

REVIEW: 102473
2011-08-29 06:48:44 +02:00
Thomas Lübking e930a50f8a coding style 2011-08-28 20:25:58 +02:00
Thomas Lübking 9d4a7c3d19 drop ignored damage events from the X11 event queue 2011-08-28 14:23:56 +02:00
Martin Gräßlin 4fb110383d Drop an unused timer 2011-08-28 10:05:00 +02:00
Thomas Lübking 12b9b1c79e fix xsync protocol
BUG: 160393
REVIEW: 102311
2011-08-24 01:39:34 +02:00
Martin Gräßlin 0c47ca5e97 Remove defines for X extensions
The following dependencies have become mandatory build deps:
* XRandR
* XRender
* XFixes
* XDamage
* XComposite
2011-08-13 16:46:43 +02:00
Martin Gräßlin 987bc837d9 Remove define KWIN_HAVE_OPENGL_COMPOSITING
Due to changes in build system we have always either OpenGL or OpenGL ES.
This allows to remove the KWIN_HAVE_OPENGL_COMPOSITING define. In the
effects the define is kept as KWIN_HAVE_OPENGL which can be used in
future to build also an XRender only effect system.
2011-08-13 16:46:43 +02:00
Martin Gräßlin b7d2b16b8d Remove define KWIN_HAVE_COMPOSITING
Building the workspaces requires to have all the build dependencies
which were required for KWIN_HAVE_COMPOSITING to be set. This allows
us to remove all the ifdefs for this and gives us a cleaner code.
2011-08-13 16:46:43 +02:00
Thomas Lübking 2843436393 add some damageRatio = 0.0 resets, required for esp. GTK+ popups 2011-08-13 10:36:35 +02:00
Martin Gräßlin c3cf4482a3 Move GLX detection from kwinglobals to CompositingPrefs
Removes the Extension::glxAvailable() from kwinglobals and
implements the functionality in CompositingPrefs, where it
is only needed. There used to be one additional check in
scene_opengl_glx.cpp which is moved into composite.cpp
before the OpenGL Scene is created.

REVIEW: 102002
2011-07-27 18:34:31 +02:00
Arthur Arlt 04fd63b201 Move scene->windowAdded() to Toplevel's setupCompositing() function
Moved the function call of scene->windowAdded() to setupComposition() of
Toplevel. The function calls from Workspace were removed, since
windowAdded() is called by setupCompositing() now, which is called anyway.

REVIEW: 102047
2011-07-25 12:27:43 +02:00
Philipp Knechtges fc5e74f4e2 kwin: make decoration repaints window-specific
This gives the new Scene::paintSimpleScreen more room for optimizations.
2011-07-15 10:27:11 +02:00
Thomas Lübking f0492f9b02 fix shadow fix
(cherry picked from commit 55986b32de9e5f5f66ac0c3448b26863cfc2dee0)
2011-07-13 23:08:03 +02:00
Thomas Lübking d20b841713 fix GL-less kwin compilation
BUG: 277667
2011-07-13 04:09:35 +02:00
Thomas Lübking 7057bb2c25 fix new shadows
(cherry picked from commit 6f03f28509834cb145b8548dfd0322cc6d62364f)
2011-07-12 22:20:21 +02:00
Philipp Knechtges 85c5181a81 kwin: Avoid painting damaged areas which are occluded by another opaque window.
So far we have not used the information that damage events are window-specific, resulting in the
behavior that we repainted the damaged area although it might be hidden behind another window.
E.g. the CPU-Monitor plasmoid is almost all day occluded by a browser etc. and before this patch
we have been repainting the appropiate area every time the plasmoid has been updated.

Thx to Thomas Lübking for optimizing the patch.

REVIEW: 101846
2011-07-11 19:35:29 +02:00
Martin Gräßlin b4de899b2c Fix broken creation of OverlayWindow
The HAVE_XCOMPOSITE_OVERLAY define had not been moved to the new
overlaywindow.cpp file causing the OverlayWindow to not be created
at all. In fact after moving the define to the new file the code
did not even compile as that code parts still used m_overlayWindow
instead of m_window.

The regression would have been easy to spot when testing with all
backends as the GLES/EGL backend still requires the overlay window.

CCMAIL: a.arlt@stud.uni-heidelberg.de
2011-07-11 19:12:56 +02:00
Thomas Lübking cf66e4c86d KWin: Make damageNotifyEvent handling more aggressively aggregate rects
and skip damage handling if the window is already completely damaged.
Also avoid QRegion handling during this since we know about the rects and
the region is handled when adding the damage anyway.
2011-07-10 00:10:43 +02:00
Arthur Arlt d8072be54d Move OverlayWindow from Workspace to its own class
All the functionality of Overlay Window is moved to its own class
OverlayWindow. It is created and owned by class Scene, since almost
all function calls are called from this class.

REVIEW: 101866
2011-07-09 19:08:48 +02:00
Martin Gräßlin e766fe0a82 Remove the compositing too slow checks
The heuristic never worked reliable.

REVIEW: 101750
2011-06-26 09:18:08 +02:00
Philipp Knechtges 2c0b0e9f18 Performance bugfix.
In case we use OpenGL compositing and KWin is started with the raster graphicssystem,
the decoration gets painted with the raster backend.
REVIEW: 101370
2011-05-18 21:27:11 +02:00
Thomas Lübking 364ce6fbfc Allow the user to rearm OpenGLIsUnsafe KWIn autocrash protection
Also add a usable "doesn't work why" info and WARN! the user about clicking the rearm button.
Merge "OpenGLIsUnsafe" and "CheckIsSafe" config keys
Move the entire checking into CompositingPrefs

BUG:250865
FIXED-IN:4.7
2011-05-11 20:16:08 +02:00
Ivan Čukić 0f7f8a833e KWin effect support for ksplashqml 2011-05-01 16:17:21 +02:00