Commit graph

298 commits

Author SHA1 Message Date
Martin Gräßlin
1c8233ad6d Use KGlobalAccel to get the shortcut for Suspend Compositing
Ported away from KAction and KShortcut to show our notification
on suspend compositing via DBus.
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
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
37279504cb bind unredirection change to unredirection update
when the option changes, the compositor needs to update
the state as it will later not act (in the disabled case)
and should to reflect the option change.

REVIEW: 111867
BUG: 322633
FIXED-IN: 4.11
2013-08-05 20:43:28 +02:00
Martin Gräßlin
94e4a31370 Port from XLib XSync to xcb sync 2013-07-31 14:05:24 +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
7d25f2a858 Drop Compositor::restartKWin
No longer needed as we don't need to switch the graphics system any more.
2013-07-24 09:46:54 +02:00
Martin Gräßlin
2f9ff5591c Drop support for native graphics system
Qt 5 only supports raster which means our pixmaps are always non native,
so we don't need the Extension information any more and can drop all
special code handling for mapping a native QPixmap to an X11 pixmap.
2013-07-24 09:46:54 +02:00
Martin Gräßlin
e7ab3adafd New class to encapsulate a Window's Pixmap
The behavior for creating a pixmap for a window is moved from Toplevel
into a dedicated class WindowPixmap. Scene::Window holds a reference to
this class and creates a new WindowPixmap whenever the pixmap needs to be
discarded. In addition it also keeps the old WindowPixmap around for the
case that creating the new pixmap fails. The compositor can in that case
use the previous pixmap which reduces possible flickering. Also this
referencing can be used to improve transition effects like the maximize
windows effect which would benefit from starting with the old pixmap.

For XRender and OpenGL a dedicated sub-class of the WindowPixmap is
created which provides the additional mapping to an XRender picture and
OpenGL texture respectively.

BUG: 319563
FIXED-IN: 4.11
REVIEW: 110577
2013-06-05 08:18:11 +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
Fredrik Höglund
041be646b5 kwin: Detect and handle graphics resets
Reset compositing when the GL context state has been lost as a result
of a graphics reset.
2013-05-22 23:38:51 +02:00
Thomas Lübking
69ef2f9c16 tidy up
REVIEW: 109785
2013-05-20 16:09:27 +02:00
Thomas Lübking
b7e6a334da rebase measuring to nano res + fix vsync padding
REVIEW: 109784
2013-05-20 16:09:27 +02:00
Thomas Lübking
9446abc696 hasWaitSync -> blocksForRetrace and syncsToVBlank
since that's not the same.
also autodetect triple buffering

REVIEW: 109783
2013-05-20 16:09:27 +02:00
Martin Gräßlin
76d96506dc Remove damage argument in Toplevel::resetDamage
We always reset with the complete window geometry, so the subtracting
doesn't make any sense. We can just always set the damage to an empty
region.

REVIEW: 110438
2013-05-17 10:07:45 +02:00
Thomas Lübking
7efc42774f delay withdraw of support props
The CM selecton withdraw delay was introduced to mostly unburden
plasma from recreating the theme on temporary changes, but since
plasma also watches some properties hinting supported features
and acts in consequence, this isn't sufficient and actually causes
two theme changes instead of one in the case of a regular suspend

REVIEW: 110232
CCBUG: 179042
2013-05-15 22:18:29 +02:00
Thomas Lübking
dc1a489f91 don't RE-claim CM selection
stealing it from ourself is reported to be able
to confuse KWindowSystem about the state.
Also it causes minor but unnecessary overhead.

REVIEW: 110231
CCBUG: 179042
2013-05-15 22:18:28 +02:00
Martin Gräßlin
1276eb044f Move KWinSelectionOwner to main.(h|cpp)
KWinSelectionOwner is only used in KWin::Application which means that
utils is the wrong place for it.

REVIEW: 110245
2013-05-01 19:15:19 +02:00
Martin Gräßlin
94470f1ea2 Change Toplevel::damage_handle to xcb_damage_damage_t
Damage handling has already been ported to XCB - no need to keep it on an
XLib datatype.
2013-04-26 12:32:08 +02:00
Martin Gräßlin
eb6ce2b7c4 Remove XDamageNotifyEvent* argument from Toplevel::damageNotifyEvent
It's not used...

REVIEW: 110201
2013-04-26 12:31:07 +02:00
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