Commit Graph

44 Commits (9b0c6ddef32e86c740654de04ba5ab6286828287)

Author SHA1 Message Date
Martin Gräßlin 4bd28e90af [kwin] Do not allow Qt to raise decoration widget above the Client
If the user actions menu is closed Qt looks for a QWidget at the mouse
position. If it finds one it tries to activate and raise it. If the
QWidget at the mouse position is a window decoration, it gets raised
above the Client. This makes the window unfortunately unusable.

To prevent this from happening we listen for the ZOrderChange event
in our event filter on the decoration widget and unconditionally lower
the decoration widget again - we never want the decoration widget to
be above our Client, so we can just always lower it. We have to use
the low level functionality and cannot use QWidget::lower as that would
result in a loop.
2013-10-27 09:52:45 +01:00
Martin Gräßlin 969e6b85e7 Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/client.cpp
	kwin/effects/highlightwindow/highlightwindow.cpp
	kwin/libkwineffects/kwingltexture.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/scene_opengl.cpp
	kwin/workspace.cpp
	plasma/desktop/applets/kickoff/CMakeLists.txt
	plasma/desktop/applets/taskmanager/package/contents/code/tools.js
	plasma/desktop/applets/taskmanager/package/contents/ui/Task.qml
	plasma/desktop/applets/taskmanager/package/contents/ui/main.qml
	plasma/desktop/applets/taskmanager/package/metadata.desktop
	plasma/desktop/applets/taskmanager/plugin/textlabel.h
	plasma/desktop/applets/tasks/CMakeLists.txt
	plasma/desktop/applets/tasks/package/metadata.desktop
	plasma/desktop/applets/tasks/tasks.cpp
	plasma/desktop/toolboxes/plasma-toolbox-desktoptoolbox.desktop
	plasma/generic/applets/activitybar/activitybar.cpp
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-09-24 11:28:38 +02:00
Thomas Lübking 4fd554a2e2 fix xcb CurrentInput implementation
broke on interim Wrapper() constructor change

The Constructor needs to explicitly pass
XCB_WINDOW_NONE to the inherited Constructor to
trigger a request

Thanks to Alex Leach for finding this

CCBUG: 256242
FIXED-IN: 4.11.2
REVIEW: 112595
2013-09-24 00:50:55 +02:00
Martin Gräßlin 108252194a Use Xcb::Atom in KWin::Atoms to resolve all atoms
During startup we only create the request, the reply will be fetched
once the atom is needed.

To make proper use of this async behavior the creation of Atoms is
moved directly to the claim of the manager selection, so they can be
fetched while we wait for the previous manager selection to give up
on it.
2013-09-10 15:30:11 +02:00
Martin Gräßlin c29a622be1 Introduce a wrapper class for InternAtom
Not extending Xcb::Wrapper as it does not operate on a window.
Instead it is a specified class for the specific usecase.
2013-09-10 15:30:11 +02:00
Martin Gräßlin e687c91402 Add a changeProperty method to Xcb::Window
Used from Client to directly change properties on its client.
2013-09-10 15:30:11 +02:00
Martin Gräßlin 1fd857eecb And add the grabButton() to Xcb::Window
Again most of the arguments have a default value to ease the usage
inside KWin and remove the horrific long methods.
2013-09-10 15:30:10 +02:00
Martin Gräßlin f354b41680 Add ungrabButton to Xcb::Window
The order of attributes is reversed compared to xcb_ungrab_button
to better allow for default arguments.
2013-09-10 15:30:10 +02:00
Martin Gräßlin 3ee886be2d Add setBorderWidth() method to Xcb::Window
Performs the configure window call.
2013-09-10 15:30:10 +02:00
Martin Gräßlin e3a1cc0b5d Add deleteProperty() method to Xcb::Window
Calls xcb_delete_property on the managed window with the passed in
xcb_atom_t.
2013-09-10 15:30:10 +02:00
Martin Gräßlin 49da9a8fdb Add a reparent() method to Xcb::Window
Reparents the managed window to the passed in parent window.
2013-09-10 15:30:10 +02:00
Martin Gräßlin 4215599e97 And add a lower() method to Xcb::Window
Just like ::raise().
2013-09-10 15:30:10 +02:00
Martin Gräßlin 070921f114 Add a kill() method to Xcb::Window 2013-09-10 15:30:10 +02:00
Martin Gräßlin 72c367cf2d Extend Xcb::Window wrapper to optionally not destroy window in dtor
We have windows which we don't want to destroy (e.g. the managed
clients) but still would like to be able to use the nicer API.

Therefore the not creating ctor and reset method have a second bool
arg to whether destroy the window or not. Default is to keep the
RAII functionality.
2013-09-10 15:30:10 +02:00
Martin Gräßlin b9e39f0d95 Use delete ctor in KWin::Xcb::Window
That's just nicer than not implementing the private ctor.
2013-09-10 15:30:10 +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 d973194c36 Use an XCB replacement for XSelectInput
Wrapped in xcbutils.

In addition the check whether another WM is running in main.cpp is
improved by doing a checked request and directly checking for the
error. If there is an error, KWin puts out an error message and
quits.
2013-08-19 10:52:22 +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
Martin Gräßlin c16c0c3753 Port invert screen from XLib xrandr to xcb randr
With this we can drop the linking to xrandr in KWin core.
2013-08-01 10:26:39 +02:00
Martin Gräßlin becb5c2dc1 Port detection of screen rate to XCB
New wrapper class added to xcbutils in a new RandR namespace.
2013-08-01 08:38:05 +02:00
Martin Gräßlin d164e16b56 Use own Xcb::sync() method in main.cpp
QApplication::syncX() is a no-op in Qt 5 so we need a replacement.
2013-07-31 07:28:15 +02:00
Fredrik Höglund a87e8f5e8e kwin: Drop the xcb_icccm dependency
This dependency is causing build problems on a number of systems,
and it doesn't make much sense to bring in a whole library for three
one-line convenience functions.
2013-07-02 00:21:32 +02:00
Allen Winter ecb9c1cf5a Add a hack for compiling xcb/xcb_icccm.h with C++.
xcb/xcb_iccm.h isn't C++ safe (some versions) because it has
a variable called "class" in function signatures. The hack
is to define "class" to something else before that header is
included, and then undef "class" immediately afterwards.

CCMAIL: mgraesslin@kde.org, fredrik@kde.org
2013-05-28 19:02:58 -04:00
Martin Gräßlin 5afe5f810e Port Client::transient_for handling to XCB
The type of the transient_for related variables are changed to
xcb_window_t. They cannot be Xcb::Window as we don't take ownership over
the transient for window.

Variables are renamed to m_camelCase to follow naming scheme.

A wrapper for retrieving the TransientFor hint is added to the Xcb
Wrappers.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 8b2a5f9936 Support for cursor change tracking in KWin::Cursor
KWin::Cursor can track changes to the cursor image. It supports a
start/stop tracking to not handle these events if nobody is interested in
them. When enabled and the cursor image changes a signal is emitted with
the serial number of the new cursor image.

To track cursor image changes xcb_xfixes_select_cursor_input is used (see
XFixes Version 5.0 protocol, section 7).

This could be useful for the zoom effect when it replaces the cursor.

REVIEW: 110519
2013-05-28 08:02:59 +02:00
Martin Gräßlin 9ed3307467 Port Decoration related XLib code to XCB
REVIEW: 110341
2013-05-07 16:55:09 +02:00
Martin Gräßlin 49e734f743 Change the way how effects can get mouse events
With the removal of BoxSwitch all effects which want mouse events use the
fullscreen input window. The available functionality is too complex both
in EffectsHandler and in the Effects.

With this change only fullscreen input windows are supported and all
effects share the input window. This means there is at maximum one input
window. This simplifies the code in the Effects as they don't have to
keep track of the window they created any more. In EffectsHandler it
means that only one window needs to be created, destroyed and raised.
Also it means that we can properly react on screen size changes which had
been ignored in the past. Also quite some roundtrips to X are no longer
needed as we do not need to query the window geometry when creating the
input window.

REVIEW: 110156
2013-05-03 08:15:42 +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 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
Thomas Lübking 9a3a7c8824 don't release clients reparented somewhere else
this broke re-embedding clients

XReparentWindow causes an unmap of mapped clients, currently leading into releaseClient()
This will (among other) eg. reparent the client to the root and this is (usually?) executed after the original XReparentWindow, so the client does not end up where it's supposed to be.

REVIEW: 109484
2013-03-28 19:47:30 +01:00
Martin Gräßlin be4c76ede1 Port Client::updateCursor to XCB and new Cursor class
The Client::cursor property is changed from QCursor to Qt::CursorShape
and renamed to m_cursor (as all usages are adjusted).

This property is mostly used to define the cursor on e.g. the extended
deco border window. To make this easier a XDefineCursor replacement is
added to xcbutils.h both as a static method and as a member function to
Xcb::Window.
2013-02-25 13:35:15 +01:00
Martin Gräßlin 0348a14a7d Port Client's shape handling to XCB
REVIEW: 108772
2013-02-21 18:04:40 +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 74097e7d29 Port Client's decoration resize extend input window to XCB
Using Xcb::Window to manage the xcb_window_t and simplify the code - no
longer need to check whether the input_window is valid before calling e.g.
map, as that's handled in Xcb::Window.

One XLib usage for setting cursor is still present. This will be ported
once all the QCursor::handle() get removed.

REVIEW: 108771
2013-02-18 09:44:50 +01:00
Martin Gräßlin 2dcbbd6a3a Move detection for defaultDepth to xcbutils 2013-02-14 14:20:27 +01:00
Martin Gräßlin 97943019db Use Xcb::Window in WindowBasedEdge
REVIEW: 108513
2013-02-07 10:00:32 +01:00
Martin Gräßlin 2a2d85672f Adding some convenient functions to wrap xcb calls
Commonly needed functionality, like
* move/resize windows
* restack windows
* restack to top of stack
2013-02-07 09:46:51 +01:00
Martin Gräßlin f238cbc3f5 Light-weight wrapper class for an xcb_window_t
The idea behind this class is to relieve the developer from having to
call xcb_destroy_window once it is no longer needed. That is having a
RAII approach to windows.

In addition the class provides some simple method wrappers for the most
common use cases inside KWin:
* map
* unmap
* setGeometry - basically a moveResizeWindow
* ...
2013-02-04 08:47:46 +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
Martin Gräßlin 2d4b67d361 Do not use a shared pointer for the Xcb::Wrapper
It's not really needed, the required functionality can be achieved in a
more implicit way. The reply pointer is managed by the Wrapper class as
long as the method take() is not invoked. This method follows the
semantics of QScopedPointer::take(). That is the pointer is set to null
and the responsibility to free the pointer is passed to the callee.

By this change we do not have the overhead of creating a QSharedPointer.

In addition the Wrapper provides a copy ctor and assignment operator also
using the semantics of take().
2013-01-25 08:51:38 +01:00
Martin Gräßlin 1e47911ab0 Discard reply in ~Wraper if not yet retrieved
Ensures that we don't leak replies.
2013-01-25 08:51:37 +01:00
Martin Gräßlin c2943c63a5 Port KWin::errorMessage to new Xcb::Extensions
Code section had been in an #ifndef NDEBUG which is the reason why I did
not find the usage of Extensions there and why it always compiled
successfully.

Some data elements which got dropped needed to be added again like a name
for the extension and errorBase, etc.

Sorry for the inconvenience of a semi-broken master.
2013-01-22 13:17:07 +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 dce1817d8e Introduce helper classes to perform common xcb requests
Two helper classes WindowGeometry and WindowAttributes which can be
used to request the geometry and attributes more easily. This is based on
a templated class, taking cookieType, replyType and function pointers to
the request and reply functions as template parameters.

The ctor performs the async request and the reply is stored in a
QSharedPointer. Whenever the reply is needed it is checked whether it
has already been retrieved and if not will block by calling the reply
method. The class provides operator bool() to check whether the reply
succeeded (pointer is not null) and operator->() to directly access the
reply pointer.
2013-01-07 10:00:43 +01:00