Commit Graph

377 Commits (970e8765f0d0b9f321303bf0b1b2c04085cdf181)

Author SHA1 Message Date
Martin Gräßlin 970e8765f0 [kwin] Remove support for _NET_WM_TAKE_ACTIVITY protocol
As can be seen in [1] the patches to KWin were in CVS HEAD before the
protocol got standardized and it never got any adoption. It's neither in
the NETWM spec, nor implemented in Qt4 nor in Qt5. KWin did not even add
the protocol to the NET::Supported property.

Thus it doesn't make much sense to keep a protocol which nobody speaks.

Still the code around the protocol is kept and also the names are kept.
Only difference is that Client::takeActivity got removed and the code
moved to the only calling place in Workspace. Motivated by that change
the enum defined in utils.h is moved into Workspace, it's turned into
a proper QFlags class and used as a type in the method argument instead
of a generic long.

[1] https://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html

REVIEW: 116922
2014-03-25 15:03:21 +01:00
Martin Gräßlin abecbf2369 [kwin] Port away from deprecated functionality in KWindowSystem
Less warnings and more type safety.
2014-03-17 10:22:20 +01:00
Martin Gräßlin ed4a0d0319 Screenedge show support for Clients
This provides a new protocol intended to be used by auto-hiding panels
to make use of the centralized screen edges. To use it a Client can
set an X11 property of type _KDE_NET_WM_SCREEN_EDGE_SHOW to KWin.
As value it takes:
* 0: top edge
* 1: right edge
* 2: bottom edge
* 3: left edge

KWin will hide the Client (hide because unmap or minimize would break
it) and create an Edge. If that Edge gets triggered the Client is shown
again and the property gets deleted. If the Client doesn't border the
specified screen edge the Client gets shown immediately so that we
never end in a situation that we cannot unhide the auto-hidden panel
again. The exact process is described in the documentation of
ScreenEdges. The Client can request to be shown again by deleting the
property.

If KWin gets restarted the state is read from the property and it is
tried to create the edge as described.

As this is a KWin specific extension we need to discuss what it means
for Clients using this feature with other WMs: it does nothing. As
the Client gets hidden by KWin and not by the Client, it just doesn't
get hidden if the WM doesn't provide the feature. In case of an
auto-hiding panel this seems like a good solution given that we don't
want to hide it if we cannot unhide it. Of course there's the option
for the Client to provide that feature itself and if that's wanted we
would need to announce the feature in the _NET_SUPPORTED atom. At the
moment that doesn't sound like being needed as Plasma doesn't want to
provide an own implementation.

The implementation comes with a small test application showing how
the feature is intended to be used.

REVIEW: 115910
2014-02-26 12:54:00 +01:00
Martin Gräßlin 0b32e5e57d [kwin] Listen to mouse motion events in the screenedge windows
Problem description: if a window decoration is in the screenedge
(not really unlikely for maximized windows) we either did not get
mouse events to the decoration or the screenedge window. E.g. the
enter event didn't reach the approach window which means it doesn't
get unmapped and thus the motion events in that area are not passed
to the decoration below. The same happened for the screenedge window,
the enter event was just not delivered if there is a window decoration
in the edge.

To solve this problem we listen for motion events in the approach and
the edge window and pass them from the event filter to the screen edges.
If one of our windows contains that the position of the motion event
we trigger the edge just in the same way as we do with the enter event.
2014-02-01 10:03:49 +01:00
Martin Gräßlin 7c7f137832 [kwin] Drop handling for mouse motion event compression
Not needed as Qt does it for us in the xcb plugin - see
QXcbConnection::processXcbEvents().
2014-02-01 09:34:40 +01:00
Martin Gräßlin 2fbc8414a7 Allow windows to specify that they should not get animated on window close
By setting the X property _KDE_NET_WM_SKIP_CLOSE_ANIMATION to 1 a window
can request to be excluded from any close animation. This property is
read in Toplevel, so that it is available to both Client and Unmanaged.

If the window has this property set the Scene suppresses the paintWindow
loop of the Deleted. Thus no effect needs to be adjusted. But an effect
using drawWindow directly would still be able to render the Deleted as
there is no suppression.

Furthermore the property is passed to the EffectWindow so that an
Effect can make use of this functionality and not start the animation
in the first place.

REVIEW: 115288
2014-01-28 07:43:35 +01:00
Martin Gräßlin 302271ce97 [kwin] Client supports an X property for color scheme
The X property _KDE_NET_WM_COLOR_SCHEME can be set on a window and
specifies the absolute path to a .color file describing the color
scheme of the managed client.

The Client reads this property and creates a QPalette from it. If
the property is not set or the value is incorrect, the Client uses
KWin's default palette.

The idea behind this property is to allow an application with a
custom color scheme to tell KWin which color scheme the window
decoration should use. So that the window looks as a solid pattern
again.
2013-11-25 09:41:24 +01:00
Martin Gräßlin ba66fd9ef6 [kwin] NETWinInfo2 becomes NETWinInfo
And takes a xcb_connection_t instead of Display. Also our own class
is adjusted to no longer need the connection being passed in.
2013-11-18 13:56:28 +01:00
Martin Gräßlin b6f9bd988b [kwin] Do not filter out button release events for moving clients
The QWidget of the window decoration is otherwise still thinking that
the button is pressed and waits for a release. Thus the next click on
the decoration doesn't trigger the move mode.
2013-11-13 14:40:57 +01:00
Bhushan Shah 935851a2b5 kDebug -> qDebug in kwin 2013-11-01 17:00:41 +05:30
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
Casian Andrei b0ba49cbdf Fix check for no button pressed in Client::buttonReleaseEvent()
There is a check in Client::buttonReleaseEvent() for the state of the
mouse buttons compared to the button masks for button 1, 2, 3 (X11
button indices).

The check was:
if ((state & (Button1Mask & Button2Mask & Button3Mask)) == 0) { ... }
<=> if (state & 0 == 0) <=> if (true)

This change assumes what the check was supposed to be and fixes the problem. The correct fix was proposed by Thomas.

REVIEW: 113359
2013-10-23 13:23:20 +03: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 67cb571f86 fix two damage artifact causes
1. when adding a full damange, that must not replace existing (larger) repaints
2. emit geometryChanged before invoking and to update shadowGeometry through addRepaintFull

BUG: 324560
FIXED-IN: 4.11.2
2013-09-24 00:50:54 +02:00
Martin Gräßlin 5eb69aba9c Switch to XCB_BUTTON_INDEX* for Pointer Button constants 2013-09-13 09:12:26 +02:00
Martin Gräßlin 85152773fc Fix wrong enum
Why do they have to sound so similar?
2013-09-13 09:11:10 +02:00
Martin Gräßlin a90072d753 Merge KDecorationUnstable into KDecoration
Also KCommonDecorationUnstable is merged into KCommonDecoration.
2013-09-12 09:27:38 +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 439122e2bc Use Xcb::CurrentInput in the focus in event handler 2013-09-10 15:30:11 +02:00
Martin Gräßlin 77edf8eb69 Port all XAllowEvents to xcb_allow_events in kwin 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 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin 16df417cc6 XCB variant for displayWidth/Height and update after RandR event
DisplayWidth and height provide proper values though internally
things are wrong as QDesktopWidget seems to not emit the signal.
2013-09-02 10:23:30 +02:00
Martin Gräßlin 7ed07e45c7 Do not pass events with no window to the findClient - windowEvent cascade
If the eventWindow is none the check for InputIdMatchPredicate will find
a matching Client and pass the even through the windowEvent filter which
returns true for all not handled events and thus filters out all events
processed later on in KWin.

This explains why some events were eaten...
2013-08-30 13:34:29 +02:00
Martin Gräßlin 37334f400a Drop no longer needed XLib includes from KWin 2013-08-20 10:29:20 +02:00
Martin Gräßlin e21225fa47 Use XCB Shape instead of XLib Shape in KWin core 2013-08-20 09:48:14 +02:00
Martin Gräßlin 9c225200bf Fix typo 2013-08-13 11:24:07 +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 46f57221e4 Mouse motion event compression
Using a QTimer to move the resize/move related code to the end of the
event queue. In case there is another motion event in the queue it will
cancel the timer.
2013-08-06 11:20:27 +02:00
Martin Gräßlin 330003cdee Replacement for XEvent queue inspection in FocusOut event case
Instead of inspecting the XEvent queue we create a Timer with a
singleshot of 0 msec to move the setActive(false) call to the end of the
event handling. In case there is a matching FocusIn event this will be
handled before the timer fired and can cancel the timer.
2013-08-05 09:48:14 +02:00
Thomas Lübking 6c420f2b11 don't require geometry changes for quick max/tile
the present check can break quick everything depending
on screen snapping settings.
It so far. only worked for quick maximization due to horizontal
"judder" and failed whenever that judder was not possible
(due to screen snapping on left and/or right edge)

BUG: 322852
FIXED-IN: 4.11
REVIEW: 111740
2013-08-02 22:04:28 +02:00
Martin Gräßlin 4b97fb542e Enable passing xcb events through NETRootInfo and NETWinInfo
Requires ab8f4532f5f12db19bcc09c1f297f1b7d55efb48 from frameworks.
2013-08-02 13:53:21 +02:00
Martin Gräßlin 41bb797919 Fix Client unmapNotify event handling
We get the missing send event attribute from anding the event's
response type with 0x80.

This fixes the issue that all open windows got unmapped. The reason for
this was that the existing new Client got reparented to the wrapper which
caused the UnmapNotify event which we used to release the Client and by
that unmapping the window completely.
2013-08-02 10:30:25 +02:00
Martin Gräßlin d90d0f5c8e Improve event handling for screen edge activation on XCB
It still doesn't trigger properly - might be fixed if KDE/4.11 gets
merged into this branch again.
2013-08-01 11:36:38 +02:00
Martin Gräßlin b96d16e63d Disable mouse motion event compression
We cannot inspect the event loop - this needs proper porting.
2013-07-31 14:05:52 +02:00
Martin Gräßlin 94e4a31370 Port from XLib XSync to xcb sync 2013-07-31 14:05:24 +02:00
Martin Gräßlin 7408e36340 Drop X event handling from Group
Dead code
2013-07-30 10:11:51 +02:00
Martin Gräßlin 075b0602e9 Get proper event window from xcb event
Find the event window and try to get a Client or Unmanaged from it
to pass it through the filter.
2013-07-29 09:00:44 +02:00
Martin Gräßlin 36984d69be Enable shape and damage notify event handling in Client 2013-07-29 09:00:44 +02:00
Martin Gräßlin c3760cbe3d Enable reparent notify and client message event handling in Client 2013-07-29 09:00:44 +02:00
Martin Gräßlin d47d0b2eb8 Enable focus out event handling in Client
Focus out handling used to check the event queue for a matching focus in
event to prevent short flickers when no window is active. This is not
possible with XCB and needs a replacement. Maybe a short timer event.
2013-07-29 09:00:44 +02:00
Martin Gräßlin 6af74b86f4 Enable focus in event handling in Client 2013-07-29 09:00:44 +02:00
Martin Gräßlin bf775b1c0e Enable leave notify event handling in Client
Still has an XQueryPointer which needs to be ported.
2013-07-29 09:00:44 +02:00
Martin Gräßlin ed24ac86d2 Enable enter notify event handling in Client 2013-07-29 09:00:44 +02:00
Martin Gräßlin 4e154bdd87 Enable key press/release and mouse event handling in Client 2013-07-29 09:00:43 +02:00
Martin Gräßlin 302c94f280 Enable configure request event handling in Client
Still needs to port an XConfigureWindow to XCB.
2013-07-29 09:00:43 +02:00
Martin Gräßlin 58c7617928 Enable map request event handling in Client 2013-07-29 09:00:43 +02:00
Martin Gräßlin 7acfb339b1 Enable destroy notify event handling in Client 2013-07-29 09:00:43 +02:00