Commit Graph

221 Commits (97ba1ebd1ec510727d699689f01160925c22fed8)

Author SHA1 Message Date
Martin Gräßlin 97ba1ebd1e Use KConfigXT in KWin::Options
For the time being the current design of Options is more or less kept to
not have to adjust KWin code all over the place. Also for some parts the
generated class from KConfigXT cannot be used due to inter-settings
dependencies defined in the setters.

Options now holds a pointer to a Settings object which is generated from
KConfigXT and uses it to read the default values and the individual
settings. This means the static default value methods are dropped and the
variables are initialized with a normal default value (all int 0, all
boolean false and so on) in the initializer list. Afterwards the values
are set to the correct default value through KConfigXT.

So far for the first step only Windows category is using KConfigXT.

REVIEW: 108572
2013-02-14 08:29:03 +01:00
Martin Gräßlin 10c07080bb Notify effects when the screen gets locked
EffectsHandlerImpl starts to monitor DBus for the screen being locked and
provides this information to the Effect system by allowing them to ask
whether the screen is currently locked and by emitting a signal when the
screen gets locked/unlocked.

This information is needed to ensure that no private data is shown on the
screen. The following effects are adjusted:
* taskbar thumbnails
* thumbnail aside
* mouse mark
* screen shot

BUG: 255712
FIXED-IN: 4.11
REVIEW: 108670
2013-02-07 10:23:30 +01:00
Martin Gräßlin b967527db3 Use XCB to resolve the X11 Extensions
The extension handling is removed from kwinglobals and moved into the
xcbutils in KWin core in namespace KWin::Xcb. The motivation for this
change is that the Extensions are only used in KWin core and are marked
as internal. So there is no need to have them in the library.

What remains in Extensions are the non-native pixmaps. This will be
removed once we are on Qt 5 as QPixmap can no longer reference an XPixmap.

The remaining code in kwinglobals also still initialize the XLib versions
of extensions emitting events. It seems like there are no XEvents emitted
if not done so even if the extension is correctly initialized with xcb.
This needs to be removed once the event handling is ported over to xcb.

REVIEW: 107832
2013-01-22 07:50:03 +01:00
Martin Gräßlin 5cd223f051 Improved resolving whether a window is on local machine
Most windows use the hostname in WM_CLIENT_MACHINE, but there are windows
using the FQDN (for example libreoffice). So instead of "foo" it is
"foo.local.net" or similar. The logic so far has been unable to properly
determine whether windows with FQDN are on the local system.

In order to solve this problem the handling is split out into an own
class which stores the information of hostname and whether it is a local
machine. This is to not query multiple times. To determine whether the
Client is on the local system getaddrinfo is used for the own hostname
and the FQDN provided in WM_CLIENT_MACHINE. If one of the queried
names matches, we know that it is on the local machine. The old logic to
compare the hostname is still used and getaddrinfo is only a fallback in
case hostname does not match.

The problem with getaddrinfo is, that it accesses the network and by that
could block. To circumvent this problem the calls are moved into threads
by using QtConcurrent::run.

Obviously this brings disadvantages. When trying to resolve whether a
Client is on the local machine and a FQDN is used, the information is
initially wrong. The new ClientMachine class emits a signal when the
information that the system is local becomes available, but for some
things this is just too late:
* window rules are already gathered
* Session Management has already taken place

In both cases this is an acceptable loss. For window rules it just needs
a proper matching of the machine in case of localhost (remote hosts are
not affected). And the case of session management is very academic as it
is unlikely that a restoring session contains remote windows.

BUG: 308391
FIXED-IN: 4.11
REVIEW: 108235
2013-01-21 16:00:49 +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 ccda10950b Port OverlayWindow from XLib to XCB
With this change KWin core no longer depends on the XLib based
composite extension.

REVIEW: 107685
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
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
Fredrik Höglund 0e8b4ffb0c kwin: Link to libxcb-xfixes and libxcb-damage 2012-11-07 22:13:13 +01:00
Fredrik Höglund ac0e85bf91 kwin: Link to libxcb and libX11-xcb 2012-11-01 23:56:32 +01:00
Martin Gräßlin cf5de22586 Introduce a build option KWIN_BUILD_OPENGL_1_COMPOSITING
If the build option is enabled KWIN_HAVE_OPENGL_1 is passed as a compile
flag when build against OpenGL.

This compile flag is meant to replace the KWIN_HAVE_OPENGLES. So far code
has been ifdefed for special behavior of OpenGL ES 2.0 and to remove
fixed functionality calls which are not available in OpenGL ES 2.0.

With this build flag the fixed functionality calls which are only used in
the OpenGL1 Compositor can be removed and keeping the KWIN_HAVE_OPENGLES
for the real differences between OpenGL 2.x and OpenGL ES 2.0.

E.g. a call like glColor4f should be in an
glColor4f(1.0, 1.0, 1.0, 1.0);

while a call like glPolygonMode should be in an
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

Building for OpenGL ES 2.0 of course implies that KWIN_HAVE_OPENGL_1 is
not defined.
2012-10-25 11:34:12 +02:00
Martin Gräßlin b2922f6675 Remove compile flag KWIN_HAVE_OPENGL
KWIN_HAVE_OPENGL is not used anymore inside KWin, so no need to pass it
as a compile flag to the binaries.
2012-10-25 11:34:12 +02:00
Martin Gräßlin a401558a43 Provide OpenGL over Egl
The Egl backend is decoupled from the OpenGL ES build option which makes
it possible to use it as a replacement for glx.

To make this possible a new build flag is added when egl is available at
compile time and any egl specific code is now ifdefed with this flag
instead of the gles flag. In addition at runtime a windowing system enum
value is passed to the various detect methods to have egl/glx specific
detection for e.g. function pointer resolving.

By default egl is used if compiled with OpenGL ES, otherwise glx is used.
But in the non-gles case the windowing system can be selected through the
new environment variable KWIN_OPENGL_INTERFACE. Setting this variable to
"egl" the EglOnXBackend is used.

REVIEW: 106632
2012-10-04 17:17:01 +02:00
Martin Gräßlin 49cce8dede Build option to disable the Oxygen window decoration
This build option is added to make it easier to build just KWin without
kde-workspace. This is a common requirement by developers wanting to
contribute to KWin and only want to build KWin but use everything else
from their normal distribution.

Building KWin standalone is very often difficult due to Oxygen. If the
library has changed it is not possible to build just KWin without also
building the workspace libs and if you do so you run into ABI problems
when trying to start KWin - either the decoration or the style is
crashing due to not matching libraries.

To circumvent this common issue for new developers this build option
is introduced to just exclude the Oxygen window decoration and defaulting
to Plastik.

Of course by default this option is turned ON, so that the Oxygen
decoration gets build. By default there is no change at all.

REVIEW: 106303
2012-10-04 17:09:39 +02:00
Martin Gräßlin 6152cc4fa5 Split out the windowing system related part of SceneOpenGL
The handling for creating and managing the OpenGL context is
split out of the SceneOpenGL into the abstract OpenGLBackend
and it's two subclasses GlxBackend and EglOnXBackend.

The backends take care of creating the OpenGL context on the
windowing system, e.g. on glx an OpenGL context on the overlay
window is created and in the egl case an EGL context is created.
This means that the SceneOpenGL itself does not have to care
about the specific underlying infrastructure.

Furthermore the backend provides the Textures for the specific
texture from pixmap operations. For that in each of the backend
files an additional subclass of the TexturePrivate is defined.
These subclasses hold the EglImage and GLXPixmap respectively.

The backend is able to create such a private texture and for
that the ctor of the Texture is changed to take the backend as
a parameter and the Scene provides a factory method for
creating Textures. To make this work inside Window the Textures
are now hold as pointers which seems a better choice anyway as
to the member functions pointers are passed.
2012-09-16 21:28:05 +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
Andreas Hartmetz 69bcd202ad Revert "Hack: Do not install kwin so that it won't clobber my kwin->kwin_gles symlink."
This reverts commit e1ff2da64635eb21b0bb82e72d3f030eef37caa0.
I accidentally pushed that commit.
2012-07-24 08:17:12 +02:00
Andreas Hartmetz fb2003fd53 Hack: Do not install kwin so that it won't clobber my kwin->kwin_gles symlink. 2012-07-23 09:31:30 +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 a65b86b5ae KConf Update script for KWin 4.9
BUG: 296775
FIXED-IN: 4.9.0
REVIEW: 104984
2012-05-24 19:02:48 +02:00
Martin Gräßlin f3443a6b07 Add CMake variable to rename kwin binaries
A CMake variable is used to specify the name of the binary.
By default this is "kwin" but building for PA changes the
name to "kwinactive". The variable adjusts all names, e.g.
kwinnvidiahack becomes kwinactivenvidiahack.

The remaining usage of kwinrc in core and libs is replaced
by a cmakedefine for the configuration name and all data
installations are moved to the defined name. Dynamic loading
for scripts & co is adjusted for loading based on defined name.

This change allows the side-by-side installation of both kwin
for desktop and kwin for Plasma Desktop without the known
issues like conflicts in config files or missing build options
if kwin desktop is used for Plasma Active.

Likewise the KCMs are not adjusted as they are not intended to
be used for kwinactive.

REVIEW: 104299
BUG: 296084
FIXED-IN: 4.9.0
CCMAIL: active@kde.org
2012-05-10 10:25:15 +02:00
Martin Gräßlin 1f97345e35 Asserts for KWin scripts
Further debugging functionality for KWin scripts. Added assert
methods validate the to be tested parameter and throw a script
error if the value is not valid.

Following methods are available:
* assert(value)
* assertTrue(boolean)
* assertFalse(boolean)
* assertEquals(expected, actual)
* assertNull(nullValue)
* assertNotNull(notNullValue)

All methods take an additional optional parameter which is used
as the error message if provided.

Methods to validate the number of arguments and types of the
parameters are added and throw syntax or type errors.

REVIEW: 104870
2012-05-10 10:00:54 +02:00
Lamarque V. Souza b40f74a3b0 Update all CMakeLists.txt to use KDeclarativeConfig.cmake.
rebuild kdelibs from KDE/4.8 branch to install KDeclarativeConfig.cmake.
2012-05-03 23:42:35 -03:00
Martin Gräßlin 561199762f Move trim malloc from KWorkspace to KWin
It is only used by KWin and KWin does not use anything else
from KWorkspace.

REVIEW: 104446
2012-04-09 11:29:46 +02:00
Martin Gräßlin 27643f5a9e Drop kephal dependency from KWin
Kephal has turned into not being more than a wrapper around
QDesktopWidget and does not even provide syntax sugar.

REVIEW: 104427
2012-04-01 08:11:57 +02:00
Thomas Lübking e89fc7333f Detect nvidia refresh rate using xvidmode
REVIEW: 104442
2012-03-30 22:56:49 +02:00
Martin Gräßlin 2fb8fb1c21 Introducing a build option for KActivities support
REVIEW: 104100
2012-03-30 09:13:46 +02:00
Marco Martin 2e576c7cdd turns out scripts are needed on PA 2012-03-13 13:48:14 +01:00
Martin Gräßlin 5592dffb48 JavaScript bindings for KWin effects
Scripted effects follow the Plamsoid package structure and the effect
loader recognizes a scripted effect at the according line in the desktop
file. If it is a scripted effect a different loader is used which
instantiates an object of the ScriptedEffect class. This class inherits
the AnimationEffect and exports the animate method and the EffectsHandler.
2012-03-12 21:37:40 +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
Martin Gräßlin 949eeedbc5 Adding a video wall script
This script allows to have video fullscreen windows span all attached
screens creating a video wall.

This replaces the removed functionality that you could disable
xinerama support inside KWin for fullscreen windows.

REVIEW: 104014
2012-02-21 22:27:35 +01:00
Martin Gräßlin db04ab7f36 KWin scripts use Plasma package structure
Scripts are found by the KServiceTypeTrader and can now be
enabled/disabled. Loading of config is currently disabled. Will
be made available again after scripted effects are merged.
2012-02-18 10:40:39 +01:00
Martin Gräßlin 9297a8a9b2 Window Switcher layouts follow Plasma Package structure
A new service type is introduced which is used by the KCM to find
all available window switcher layouts. This makes it finally possible
to have 3rd party window switchers.

Also the tabbox finds the packaged QML file through the service
definitions.

Desktop switcher is not yet in packaged version (UI to configure
is missing).

REVIEW: 103951
2012-02-16 10:08:15 +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
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
Martin Gräßlin 20d8d727ca Rename SWrapper::Workspace to KWin::WorkspaceWrapper
Resolves the problem of having two workspace.(h|cpp). The scripting
workspace is in fact just a wrapper, so having that clear is a plus.
2012-01-22 12:38:03 +01:00
Martin Gräßlin 507ff411d6 Drop the WorkspaceProxy in Scripting
Unlike stated at several places in the code it is not difficult to
setup the connections to all Clients.

It would have been nice if the failed attempts to connect the Clients
would not have made it into the code as emitted signals which are
nowhere used. Not to mention that like in all places the signals to
inform that a state changed were emitted before the state changed was
performed.
2012-01-21 10:51:22 +01:00
Martin Gräßlin bd5ad8aa6b Remove unused build-dep on QtXml from KWin
Was used to parse the tabbox layout configuration.
2012-01-14 14:25:21 +01:00
Martin Gräßlin c85452d517 Drop old (non QML) TabBox
This includes the delegates, the layout configuration for the delegates
and the custom view for the TabBox.

This can now finally be done as desktop tabbox is based on QML, too.
2012-01-14 11:51:35 +01:00
Martin Gräßlin e1cbb33631 Desktop Box support for QML based TabBox
First very simple layout just rendering icon and name.
Good enough for the start.
2012-01-14 11:51:35 +01:00
Martin Gräßlin 698eb631cd ClientGroup becomes scriptable (again)
For this properties are defined in ClientGroup and several methods
are changed to be slots (to be invokable from scripts). On Client
the clientGroup is exported as a property.

The existing wrapper around ClientGroup is dropped as it is no
longer needed. Interestingly it was wrong anyway as it allowed to
construct a new ClientGroup, which has to be done internally.

At the same time the meta declarations get cleaned up a little bit.
2012-01-01 14:43:32 +01:00
Martin Gräßlin 1953deab15 Drop "Chelate"
Whatever it was, we cannot need a "Lazy Logic (TM)" which is not
documented. And even if it were useful, KWin is not the right place
to develop language extensions to ECMAScript.
2011-12-31 14:22:22 +01:00
Martin Gräßlin f47e7bb5ef KWin scripting goes properties
Dropping the wrapper around Client and just exporting the Client's
properties. This breaks all existing scripts as it's now e.g.:
client.caption
instead of
client.caption()

But the first one is the more natural one for JavaScript and also
for everyone writing QML as well.

Setters and signals are mostly still missing in client. Other parts
like ClientGroup must be converted to properties, too.
2011-12-31 08:58:40 +01:00
Martin Gräßlin 6f9f736973 Merge branch 'kwin/tabbox-window-strip' into integration 2011-12-21 07:45:52 +01:00
Aaron Seigo a7ed191184 Merge branch 'libkactivities'
Conflicts:
	kwin/CMakeLists.txt
	libs/kworkspace/CMakeLists.txt
	libs/kworkspace/kactivityconsumer.h
	libs/kworkspace/kactivitycontroller.h
	libs/kworkspace/kactivityinfo.h
	plasma/desktop/shell/activitymanager/activityicon.cpp
2011-12-05 00:33:25 +01:00
Martin Gräßlin 12b7bdfcb1 Plasma Active needs TabBox now 2011-12-01 13:16:21 +01:00
Martin Gräßlin efe439e2bc Include WindowStrip as TabBox layout 2011-11-27 14:05:44 +01:00