Commit Graph

588 Commits (4f1c98773e1eccdcc7a23aede04571d576749e50)

Author SHA1 Message Date
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 1d2c2d5982 Use Q_SLOTS and Q_SIGNALS instead of slots and signals
Fixes compilation with Qt5/KF5 setup.
2013-07-24 09:46:54 +02:00
Martin Gräßlin 17e38f3357 Remove "Block global shortcuts" global shortcut
This shortcut did not make any sense to me, because you could block the
global shortcuts for KWin, but not re-enable them again. So once blocked,
it was blocked for ever till kwin --replace &.

This is in opposite to the commit message which introduced it
(see BUG 108961).

REVIEW: 110364
2013-05-28 08:02:12 +02:00
Thomas Lübking f2dd6d02b1 add previous screen shortcuts
REVIEW: 110521
BUG: 303083
FIXED-IN: 4.11
2013-05-22 22:25:15 +02:00
Martin Gräßlin d305185247 Remove Workspace pointer from Toplevel
Instead have a simple workspace() method returning the pointer.
2013-05-13 08:28:16 +02:00
Martin Gräßlin c4c3eb90fb Remove outdated showWindowMenu(At) functions
Instead of wrapping for exactly one case let's just use the proper
function calls and get rid of all those methods marked as "remove KDE4"
and "backwards compatibility".

REVIEW: 110292
2013-05-04 09:58:44 +02:00
Martin Gräßlin 0811d17329 Encapsulate colormap related functionality in own class
Split out the default and installed colormap from Workspace and put them
into an own class Colormaps.

The method updateColormaps is replaced by a slot update in Colormaps and
activeClientChanged signal is connected to this slot.

At the same time the colormap related code is straight forward ported to
xcb.

REVIEW: 110248
2013-05-02 13:47:02 +02:00
Martin Gräßlin b6681ddc3a Turn RootInfo into a KWIN_SINGLETON
It's not a typical singleton as the ctor is not taking a Workspace* and
needs addtional data to be passed to NETRootInfo.

All the initialization code is moved to RootInfo::create() and the tear-
down code is moved to RootInfo::destroyed(). This includes the support
window which used to be a member of Workspace. It's only needed by
RootInfo, so there is no need to have the ownership inside Workspace.

Instead of using a QWidget we just create a normal window through xcb.
It gets destroyed again in the tear-down code after the RootInfo got
destroyed.

REVIEW: 110238
2013-05-01 19:14:38 +02:00
Martin Gräßlin 2320b71cb7 Port Workspace's null focus window to xcb
Adding wrappers to Xcb::Window for setInputFocus.

REVIEW: 110246
2013-05-01 19:10:06 +02:00
Martin Gräßlin 23b395059f s/Time/xcb_timestamp_t/g in workspace.h
REVIEW: 110249
2013-05-01 19:08:00 +02:00
Martin Gräßlin 28d7b3c563 s/Window/xcb_window_t/g in workspace.h 2013-05-01 19:07:56 +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 65ec86113a Split out Rules related code from Workspace into class RuleBook
Workspace is hardly interacting with Rules and all the Rules related code
is already in rules.cpp. This highly qualifies to move all the code out
of Workspace and improve the names.

REVIEW: 110207
2013-04-30 07:52:08 +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 4a28d000cf Move ShortcutDialog to useractions
It's only used from useractions.cpp which means that it's not the best
fit in utils. We can see the problems with it given that it was in an
ifdef and it included quite some headers into everything.

REVIEW: 110189
2013-04-26 08:53:13 +02:00
Martin Gräßlin c094c7e7cd Cleanup includes and forward declarations in workspace.h 2013-04-26 08:47:33 +02:00
Martin Gräßlin cd025c7526 Make Outline a KWIN_SINGLETON
Given that Outline is now a QObject hold by Workspace, but not used in
Workspace, it can also be a KWIN_SINGLETON.

REVIEW: 110146
2013-04-25 09:04:02 +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 27627bdccb Move killWindowId(Window) from Workspace to KillWindow
Only used from KillWindow and does not operate on private data of
Workspace.

At the same time port to XCB.

REVIEW: 109911
2013-04-15 10:09:04 +02:00
Martin Gräßlin a27bbb9698 Forward declare KillWindow in workspace.h 2013-04-15 10:08:51 +02:00
Martin Gräßlin 2702c1930b Remove useless method Workspace::killWindow
Was just wrapping to slotKillWindow.
2013-04-15 10:08:51 +02:00
Martin Gräßlin a442bd6416 DecorationPlugin becomes a QObject
This allows to move the slot to reset the decoration when compositing
got toggled from Workspace to DecorationPlugin and the custom cleanup
is no longer needed.

REVIEW: 109909
2013-04-15 10:04:09 +02:00
Martin Gräßlin 265b5523e2 Move decoration related methods from Workspace to DecorationPlugin
They were all just delegating to the DecorationPlugin.
2013-04-15 09:59:09 +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 32be37bce3 Rename PluginMgr to DecorationPlugin
It's about the decorations not just *the* plugin.
2013-04-15 09:59:09 +02:00
Martin Gräßlin d503d9ffb6 Turn TabBox into a proper singleton
There is only one instance hold by Workspace which means it should follow
the common approach with ::self and ::create.

The hasTabBox is completely removed as it's rather useless and the same
as the ifdef around the usages any way.

REVIEW: 109851
2013-04-11 14:18:30 +02:00
Martin Gräßlin 6f113d84d3 Turn Scripting into a proper singleton
There is only one instance hold by Workspace which means it should follow
the common approach with ::self and ::create.

REVIEW: 109850
2013-04-11 14:01:39 +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 34d0df3e0a Remove Workspace::updateOnAllActivitiesOfTransients
Method is more or less just a clone of the Virtual Desktop variant and
not needed as toggleClientOnActivity already takes care of transients.
2013-04-11 13:01:36 +02:00
Thomas Lübking 6fb5353cab remove moveResizeMaximized option
REVIEW: 103948
BUG: 91703
BUG: 299245
FIXED-IN: 4.11

- The setting is ignored, the decoration always gets a "true" for it
- moving a maximized window requires breaking a "strong" snap (1/16 of screen height - unless you use quick maximization)
- all snapping is done towards the client, not the frame
- QuickTileMode is exported to the decoration (just as the maximizeMode) so that it can fix the bordersize alongside that.
2013-03-24 22:26:48 +01:00
Martin Gräßlin 15aa42c565 Remove doNotManage hack for Java Applets
The hack used to be used to hide windows before they get embedded into
another window. This has been wrong on multiple levels:
1. it does not belong into a window manager - the window should take care
   of this by itself
2. Window title is not a proper way to identify windows
3. Using D-Bus to inform an X11 window manager about windows which should
   not get managed is rather strange
4. The hack only works with KWin, but not with any other X Window Manager
5. Windows identified with this hack still appear in Alt+Tab, that is
   they are managed after all. Only a flicker is suppressed
6. Such windows are shown in the taskbar which nicely illustrates how
   wrong a D-Bus call to the window manager is

That the hack has been introduced for Java Applets in KHTML also shows
that this is wrong. Why does Gecko and WebKit not need such a hack? Why
is KHTML tied so closely to X11 and KWin? Having a hack for a technology
which is obsoleted (Java Applets) and shouldn't be used due to security
issues is another reason to no longer support this hack. This usage has
been removed from KHTML as of 67939b1 of kdelibs git repo.

REVIEW: 109450
2013-03-22 09:54:45 +01: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 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
Martin Gräßlin 9655c7b3cb Rewrite KillWindow on top of XCB
The code is rewritten in a way to replace the local event loop with event
filtering done in the normal way through events.cpp. Therefore instead of
creating a KillWindow whenever it's needed, there is one available in
Workspace which will be reused on next invocation.

The responsible events are passed from events.cpp to KillWindow for
processing.

In order to port the keycode to symbol to XCB, KWin now finds
xcb_keysyms and links it.

To get the right cursor KWin now links the XCursor library which is
unfortunatelly an XLib based library, but there seems to be no XCB
replacement.
2013-02-25 13:35:14 +01:00
Martin Gräßlin 4a0a4bc27e Split out handling of focus chain into an own class
The new class FocusChain manages two different kind of focus chains.
First of all there is a most recently used focus chain which is primarily
used for TabBox.

Then there is one focus chain per virtual desktop. These chains are used
to determine which Client needs to be activated when e.g. switching to a
virtual desktop.

The individual chains are implemented as a simple QList of Client* with
the most recently used Client as the last element. That way one can see
it as a LIFO like structure.

The desktop focus chains are internally represented as a hash with the id
of the virtual desktop as the key and a list as described as the value.

FocusChain is a singleton which provides some methods to manipulate the
chains and to get a specific Client for a task (e.g. TabBox).

While splitting out the code some unused code inside TabBox got removed
as well as some activities related code (windows cannot be moved while
switching activities).

REVIEW: 107494
2013-02-21 09:57:46 +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
Thomas Lübking 004bdee7a2 do not try to raise possible panel proxies
but drop screenedges below the supportWindow instead
that's why it exists, that's deterministic, that's faster

includes adaption to new screenedge and xcb invocation (compared to 4.10)

BUG: 314625
FIXED-IN: 4.10.1
REVIEW: 108867
2013-02-12 21:58:46 +01:00
Martin Gräßlin a8539ff54e Turn ScreenEdges into a Singleton
In fact it already used to be a Singleton as there is just one object
hold by the Singleton Workspace. So let's make it a proper Singleton
following our kind of standard approach of having a ::create factory
method called from Workspace ctor and a ::self to get to the singleton
instance.
2013-02-07 09:46:52 +01:00
Martin Gräßlin d9aedf620b Rewrite of KWin's Screen Edge Handling
This rewrite is mostly motivated by the need to handle multi screen
setups correctly. That is have edges per screen and not for the combined
geometry. Also porting from XLib to XCB has been a motivation for the
rewrite.

The design of the new ScreenEdge handling is described in the
documentation of ScreenEdges in screenedge.h.

In addition the following changes have been performed:
* move configuration from Options to ScreenEdge
* add screen edge information to Workspace::supportInformation (obviously
  replaces what had been read from Options)
* have Workspace hold a pointer to ScreenEdges instead of an object
* forward declaration of ScreenEdges in workspaces.h, this explains the
  seemingly unrelated changes of just another include in some files

BUG: 290887
FIXED-IN: 4.11
2013-02-07 09:46:52 +01:00
Thomas Lübking c158507a66 signal change of stacking order to the effects
REVIEW: 108059
2013-02-05 19:15:39 +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 3ee9869ba0 Move ScreenEdge configuration from Workspace to ScreenEdge
Main motivation for this change except the fact that it doesn't belong
into Workspace is that the screen edges got updated from within setting
the desktop layout which got removed with the introduction of the
VirtualDesktopManager.

The ScreenEdge now keeps some state to be able to correctly unreserve the
electric borders when changes in the configuration are performed. There
is still room for improvement as there are still some deep function calls
from within reconfiguring in Workspace.

REVIEW: 107493
2013-01-07 09:47:59 +01:00
Martin Gräßlin 1d959dea64 Move Desktop Chain management from Workspace into own class
Most recently used virtual desktop chain is only used in the context of
TabBox and therefore moved into this namespace. KWin uses one desktop
chain for each activity. This is mapped by having multiple DesktopChains.
In addition there is a DesktopChainManager which contains all those
chains which are identified by a QString.

The manager gets connected to the signals emitted by VirtualDesktopManager
for changes in virtual desktops and to signals related to Activities
emitted by Workspace. This means the manager is rather generic as it does
not depend on any other components.
2013-01-07 09:47:51 +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
Martin Gräßlin 533d57da60 Mark most ctors as explicit as reported by Krazy2 checker 2013-01-02 18:35:46 +01:00
Martin Gräßlin 41f6a2c7d2 Remove Placement* member variable from Workspace
Not needed anymore given that Placement became a singleton.

REVIEW: 107416
2012-12-20 07:19:53 +01:00
Martin Gräßlin f689df14d5 Remove Placement wrappers from Workspace
The two methods:
* place
* placeSmart
have only forwarded the call to the Placement object. Now that Placement
is a singleton there is no need to have them. Every user can call them
directly without going over Workspace.
2012-12-20 07:19:53 +01:00
Martin Gräßlin 835648bc20 Move cascadeDesktop and unclutterDesktop to Placement
It is more Placement related and does not really fit into geometry given
that it only calls methods on Placement. It probably only was inside
Workspace due to being part of the DBus interface. The DBus methods are
used by external components so it needs to stay.

The DBus Wrapper is now calling the methods on the singleton Placement
directly, so no need in Workspace anymore.
2012-12-20 07:19:53 +01:00
Martin Gräßlin 533e3e5adf Move circulateDesktopApplications into DBusInterface
It is not used anywhere inside KWin at all and the DBus method is not
used anywhere inside KDE's repositories (according to lxr). Because of
that marked as deprecated and going to die with Qt 5.

REVIEW: 107406
2012-11-22 09:49:08 +01:00
Martin Gräßlin 5a2504b19e Remove not implemented method from Workspace 2012-11-22 09:44:12 +01:00
Martin Gräßlin 5d7b3b6df5 Remove not implemented methods from Workspace class definition
Methods are nowhere implemented and in general placement related code is
in Placement.
2012-11-21 18:29:02 +01:00
Martin Gräßlin aac42d04db Remove unused variables transSlider and transButton
Whatever those have been...
2012-11-21 14:29:42 +01:00
Ignat Semenov 32dffca2bd fix building with KWIN_BUILD_KAPPMENU set to off
Forgot to fix the header file kwin/workspace.h in ed0eead6.
2012-11-13 15:23:56 +04:00
Cedric Bellegarde 53ae2b91e2 GUI: Kwin appmenu support:
- Add support for application menu button in Kwin
- Add kded appmenu configuration in kcm_style
2012-11-09 13:44:50 +01:00
Martin Gräßlin 9308028fa4 Decoration can announce whether it currently requires an alpha channel
A decoration can provide the AbilityAnnounceAlphaChannel in addition to
AbilityUsesAlphaChannel. If this ability is provided the decoration can
enable/disable the use of the alpha channel through setAlphaEnabled().

The base idea behind this mechanism is to be able to tell the compositor
that currently alpha is not needed. An example is the maximized state in
which the decoration is fully opaque so that there is no need to use the
translucency code path which would render all windows behind the deco.

In addition also the blur effect honors this setting so that behind a
known opaque decoration no blurring is performed.

Oxygen is adjusted to disable translucency in maximized state and Aurorae
is adjusted to allow themes to enable/disable translucency. For Plastik
translucency and with that also blurring is disabled.

REVIEW: 106810
2012-11-09 10:36:43 +01:00
Fredrik Höglund c679ec6508 kwin: Port most of Workspace::init() to xcb 2012-11-07 22:13:13 +01:00
Martin Gräßlin 8bfffed27d Deprecate KDecoration's AbilityColor
Nobody is interested in whether the Abilities are supported.
There is one method in KWin core checking for the colors
supported by the currently loaded decoration:
Workspace::decorationSupportedColors

This method is not called from anywhere inside KWin, but is
part of the D-Bus interface, though nobody in KDE's repository
is calling it [1].

As it is part of public API the Abilities are only deprecated
and scheduled for removal with the next big break.

[1] http://lxr.kde.org/search?filestring=&string=decorationSupportedColors

REVIEW: 105785
2012-09-07 07:33:39 +02:00
Martin Gräßlin 2764565f9d Allow Scripts to add menus to the UserActionsMenu
A script can register a callback through registerUserActionsMenu to be
informed when the UserActionsMenu is about to be shown. This menu calls
the Scripting component to gather actions to add to a Scripts submenu.

The Scripting component now asks all scripts for the actions, which will
invoke the registered callbacks with the Client for which the menu is to
be shown as argument.

The callback is supposed to return a JSON structure describing how the
menu should look like. The returned object can either be a menu item or
a complete menu. If multiple menu items or menus are supposed to be added
by the script it should just register multiple callbacks.

The structure for an item looks like the following:
{
    text: "My caption",
    checkable: true,
    checked: false,
    triggered: function (action) {
       print("The triggered action as parameter");
    }
}

The structure for a complete menu looks quite similar:
{
    text: "My menu caption",
    items: [
         {...}, {...} // items as described above
    ]
}

The C++ part of the script parses the returned object and generates
either QAction or QMenu from it. All objects become children of the
scripts QMenu provided by the UserActionsMenu.

Before the menu is shown again the existing menu is deleted to ensure
that no outdated values from no longer existing scripts are around. This
means the scripts are queried each time the menu is shown.

FEATURE: 303756
FIXED-IN: 4.10
REVIEW: 106285
2012-09-07 07:32:00 +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 952579bb09 fix untabbing position
the geometry setting needs to happen out of recursion,
has to be smarter for unmaximizing and also no real
place in TabGroup - the client is no longer tabbed thus
it's not the groups task to manage it's geometry.

BUG: 226881
REVIEW: 106182
FIXED-IN: 4.9.1
2012-08-28 21:08:03 +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 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
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 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 5042ca2bdc Adding a screen menu to the Client's useraction menu
New "Move To Screen" menu is shown after the "Move To Desktop"
menu if there are multiple screens and the window can be moved
to another screen. Menu contains one radio button for each
screen.

Selecting an entry sends the Client to the selected screen.

BUG: 269207
FIXED-IN: 4.10
REVIEW: 106065
2012-08-18 09:45:30 +02:00
Martin Gräßlin 90365e27d0 Merge branch 'KDE/4.9'
Conflicts:
	khotkeys/data/kde32b1.khotkeys
	kinfocenter/Modules/opengl/opengl.desktop
	kwin/tabbox/tests/CMakeLists.txt
	plasma/generic/applets/system-monitor/plasma-applet-sm_hdd_activity.desktop
2012-08-17 17:59:49 +02:00
Martin Gräßlin 23f2de009b Effects can provide support information through properties
The supportInformation is extended to also read the properties
on all effects. In addition each effect can be queried just for
itself through D-Bus, e.g.:
qdbus org.kde.kwin /KWin supportInformationForEffect kwin4_effect_blur

All effects are extended to provide their configured and read
settings through properties. In some cases also important
runtime information is exposed.

REVIEW: 105977
BUG: 305338
FIXED-IN: 4.9.1
2012-08-17 17:49:49 +02:00
Martin Gräßlin a394fade64 Remove Tiling support from KWin
As discussed on the mailinglist [1] the tiling support is
removed from KWin. The main reasons for this step are:
* it is unmaintained
* it is a mode not used by any of the core KWin team
* original developer said at Akademy 2012 that he is not
  interested in picking up the work again
* tiling has quite some bugs, e.g. multi screen not supported
* is conflicting with other concepts in KWin, e.g. activities

There is ongoing work to get tiling supported through a KWin
script, which is a preferred way as it does not influence the
existing C++ code base.

[1] http://lists.kde.org/?l=kwin&m=133149673110558&w=2
BUG: 303090
FIXED-IN: 4.10
REVIEW: 105546
2012-07-14 11:18:06 +02:00
Martin Gräßlin 30bb8be037 Add activity support to Workspace Script Wrapper and Effects
New properties for the current activity and the available
activities plus related signals in scripts. Signals added to
effects.

BUG: 302060
FIXED-IN: 4.9.0
2012-06-24 18:35:56 +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
makis marimpis 7de8f5e7fe Add activity support for desktop focus chains.
REVIEW: 104649
BUG: 299309
FIXED-IN: 4.9.0
2012-05-06 15:31:21 +02:00
Thomas Lübking a332bf183b add desktopChanged signal to effects that carries the optionally changing widget
CCBUG: 213847
FIXED-IN: 4.9
2012-05-03 22:56:27 +02:00
Thomas Lübking 3a6095726e Only reserve required electric borders for ElectricAlways
CCBUG: 293011
REVIEW: 104073
2012-05-03 19:48:20 +02:00
makis marimpis a9e66dc7f3 "New Desktop" in to Desktop menu
Adding a new desktop entry to create a new desktop and move the
selected window there.

REVIEW: 104781
2012-05-03 16:42:25 +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
Alex Fiestas 21c5264efe Remove forward declaration of Kephal stuff (leftover from the port I guess) 2012-04-29 21:07:10 +02:00
Martin Gräßlin be55ac5c60 Introduce post Workspace init phase
Workspace emits a signal when the initialization finished and
interested parties can connect to this signal to perform post
init actions. That is everything that does not have to be
performed to have a completely working Window Manager.

As an example loading the scripts is moved into this post init
phase.

REVIEW: 104580
2012-04-27 19:02:21 +02:00
Martin Gräßlin 818714432f Move Scripting from main to Workspace
Scripting can be started after everything else is started, there
is no reason to have it in main.cpp.
2012-04-22 22:28:56 +02:00
Thomas Lübking 9ca81a2f79 move sync dbus calls to kactivitymanagerd into extra thread
to prevent broken dbus chain from blocking the compositor

CCBUG: 293104
REVIEW: 104563
2012-04-20 23:59:37 +02:00
Martin Gräßlin c4d8a54e98 Keep position in stacking order for deleted windows
Workspace::addDeleted swaps the Client with the Deleted in the
stacking order. For Unmanaged windows the Deleted is appended
to the stacking order which is the same layer.

When the deleted is closed the window is removed from the stacking
order.

The result is that a deleted window is no longer raised above all
other clients.

REVIEW: 104519
BUG: 158262
FIXED-IN: 4.9.0
2012-04-20 08:36:24 +02:00
Martin Gräßlin f0c6f06241 Stacking Order becomes a list of Toplevel Windows
The common usage of stacking order is to loop through
the list and find a specific Client. All these usages
still need to find a Client. For that the loops are
adjusted to first cast the Toplevel into a Client and
continue if the current item is no Client.

At the moment all entries in the stacking order should
still be Clients as the Deleted are not yet added.
2012-04-20 08:36:24 +02:00
Martin Gräßlin c175e75939 ConstrainedStackingOrder() return ToplevelList 2012-04-20 08:36:23 +02:00
Thomas Lübking ab86f0e837 add screen inversion through XF86VidModeSetGammaRamp or XRRSetCrtcGamma
use opengl invert effect as fallback

REVIEW: 104371
2012-04-17 21:11:03 +02:00
Thomas Lübking 7bdf96c2f3 export clientpopup mapping state and use it to skip mouse driven focus changes
BUG: 81743
FIXED-IN: 4.9
REVIEW: 104620
2012-04-17 21:08:35 +02:00
Martin Gräßlin a0c6f70a0e Drop refresh method on D-Bus interface
The method is nowhere inside KWin called, nor used as a slot.
It's also not used from any of the KCMs and the method does not
do what the name says. It just shows and hides a window as big
as the screen geometry.

REVIEW: 104418
2012-04-01 08:11:54 +02:00
Martin Gräßlin 2fb8fb1c21 Introducing a build option for KActivities support
REVIEW: 104100
2012-03-30 09:13:46 +02:00
Martin Gräßlin d4a919a9bf Demands Attention support for KWin Scripting
Client has a property for demands attention and Workspace
is emitting a signal whenever the demands attention state
of any Client changes.

REVIEW: 104204
2012-03-12 21:25:45 +01:00
Martin Gräßlin 214375f923 Query KWin for available debug output
This adds extensive support information about the running instance
by printing out all used options, the compositing information
including GL platform, loaded effects and active effects.

The debug output can be retrieved through D-Bus:

qdbus org.kde.kwin /KWin supportInformation

or through a KWin Script (use desktop console):

print(workspace.supportInformation())

REVIEW: 104142
2012-03-04 15:21:10 +01:00
Martin Gräßlin 6c225755fc Drop C++ based Desktop Change OSD
No longer needed as it has been replaced by a declarative script.
2012-03-02 09:10:10 +01:00
Thomas Lübking b79a176be3 resolve merge conflicts 2012-02-21 19:22:08 +01:00
Thomas Lübking 7e7846adce Focus window under mouse after MouseLowerOp
BUG: 255052
REVIEW: 103975
2012-02-21 17:18:04 +01:00
Thomas Lübking 85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00
Thomas Lübking bf88ec09ac Revert "fix tabbing"
pushed out of branch, not master - leading to absent revision, found hash collision??

This reverts commit 94b2ad7b85801e37e2df4671cdc4f26b6d7e5506.
2012-02-11 16:29:14 +01:00
Thomas Lübking d245035a17 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:01:41 +01:00
Thomas Lübking 48c28a9b3d add dbus debug "activeEffects"
REVIEW: 103572
CCBUG: 288948
CCBUG: 290025
(cherry picked from commit 089aeee91b807d13c0c2b86fa18d05776bef5190)
2012-01-02 18:57:44 +01:00
Thomas Lübking 5b40492a84 add support for graphicssystem selection
REVIEW: 103430
CCBUG: 289904
(cherry picked from commit ded4ed4e9dc32316c41a43b6e906bece4b92338f)
2012-01-02 18:56:21 +01:00