Commit Graph

39 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Martin Gräßlin 444ce02d8d Use OnScreenNotification in kill window
Summary: Inform how to kill a window.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3724
2016-12-21 19:45:02 +01:00
Martin Gräßlin 6bee7f4aac KillWindow support for Wayland windows
Summary:
AbstractClient gains a new pure virtual killWindow method and this gets
implemented in ShellClient.

ShellClient performs the killing by sending a term signal to the
process. This can only work if the client connected through the socket
and didn't get a socketpair fd passed. In that case the pid is KWin's
and KWin doesn't want to terminate. Thus this is special handled to
destroy the connection instead.

In case terminating the process has no effect, the connection gets
destroyed after five seconds.

The KillWindow is adjusted to operate on AbstractClient instead of
Client.

This implements T4463.

Test Plan: Killed windows and auto test

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3370
2016-11-17 14:06:42 +01:00
Martin Gräßlin 7b464cf284 Support interactive window selection through the Platform
Summary:
A new virtual method is added to Platform:
startInteractiveWindowSelection

The interactive window selection enters a mode where the user can select
a window through the pointer or keyboard device. The cursor is turned
into a crosshair cursor, unless another cursor name is provided (e.g.
pirate for kill window).

Once a window is selected the provided callback method is invoked with
the selected Toplevel as argument. In case the user cancelled the
selection a nullptr argument is passed in.

Currently it's only implemented by the X11 standalone platform using the
logic from KillWindow. Just instead of killing the window the callback
is invoked.

KillWindow loses the X11 implementation and interacts with the new
functionality in Platform by providing a lambda function for the
killing.

Test Plan: Killing of X11 windows is still possible

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3363
2016-11-17 08:08:56 +01:00
Martin Gräßlin 52cf47ff53 Port KillWindow to X11EventFilter
Summary:
Removes the special handling from events.cpp for KillWindow. The same
functionality can be provided through the X11EventFilter.

This is a preparation step for moving the interactive window selection
into the Platform and to support KillWindow also for Wayland.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3362
2016-11-16 07:49:03 +01:00
Martin Gräßlin cef03c2b9e Drop dead Xlib code from KillWindow
Still had an Xevent handler.
2016-11-15 08:30:09 +01:00
Martin Gräßlin a42a91b6a1 Use Cursor::x11Cursor from KillWindow
Removes custom usage of XCursor library.

REVIEW: 122285
2015-01-29 09:02:23 +01:00
Martin Gräßlin 9144b03688 Remove XLib include from client.h
No longer needed in the header. Client is free of XLib data types.
2015-01-27 12:48:03 +01:00
Martin Gräßlin 3204342809 Port XQueryPointer usage to XCB
Introduces new XCB::Pointer wrapper and is used in
Client::leaveNotifyEvent and in Cursor and KillWindow to simplify
the usage.

CCBUG: 333836
2014-05-05 08:09:09 +02:00
Martin Gräßlin bc0a9cb53a [kwin] Use std::find_if and lambda functions for Workspace::findClient
Instead of passing the macro based Predicate to findClient it now
expects a function which can be passed to std::find_if.

Existing code like:
xcb_window_t window; // our test window
Client *c = findClient(WindowMatchPredicated(window));

becomes:
Client *c = findClient([window](const Client *c) {
    return c->window() == window;
});

The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.

In addition there is a simplified overload for the very common case of
matching a window id against one of Client's windows. This overloaded
method takes a Predicate and the window id.

Above example becomes:
Client *c = findClient(Predicate::WindowMatch, w);

Existing code is migrated to use the simplified method taking
MatchPredicate and window id. The very few cases where a more complex
condition is tested the lambda function is used. As these are very
local tests only used in one function it's not worthwhile to add further
overloads to the findClient method in Workspace.

With this change all the Predicate macro definitions are removed from
utils.h as they are now completely unused.

REVIEW: 116916
2014-03-25 15:17:11 +01:00
Martin Gräßlin bdc1883fcf Better activation check in KillWindow
If the grab keyboard fails we better do not activate the window killer
otherwise we are in an inconsistent state.

CCBUG: 323191
REVIEW: 111903
2013-08-06 14:44:02 +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 b99e1c0a6b Reduce usage of QCursor::pos() and ::setPos()
Where possible it is changed to Cursor::pos(), where we cannot use the
Cursor class (e.g. Aurorae) we can at least try to limit the usage to
prevent roundtrips to the X server.

REVIEW: 109178
2013-02-27 11:46:30 +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 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Luboš Luňák 01bf6cbb4c License cleanup - add headers where missing, be explicit about GPL
being v2+ (right now it says just GPL, which according to GPL itself
means any GPL). Decoration clients will come later.
CCMAIL: kwin@kde.org


svn path=/trunk/KDE/kdebase/workspace/; revision=742302
2007-11-27 19:40:25 +00:00
Luboš Luňák fe3c4e286f Merging from old trunk:
r623744 | lunakl | 2007-01-15 13:19:44 +0100 (Mon, 15 Jan 2007) | 3 lines

Kill only with left or middle button.


svn path=/trunk/KDE/kdebase/workspace/; revision=659523
2007-04-30 11:34:41 +00:00
Luboš Luňák f52b8e48cd branches/work/kwin_composite becomes new trunk kwin.
svn path=/trunk/KDE/kdebase/workspace/; revision=659202
2007-04-29 17:35:43 +00:00
Luboš Luňák 2b7e1f4993 Remove kwin, kwin_composite will become new trunk kwin, missing merges
from trunk will be merged in.


svn path=/trunk/KDE/kdebase/workspace/; revision=659200
2007-04-29 17:34:49 +00:00
Luboš Luňák e1406c3e42 Utility function for XGrabKeyboard().
svn path=/branches/work/kwin_composite/; revision=654227
2007-04-15 14:39:10 +00:00
Luboš Luňák 2c928221a4 namespace KWinInternal -> KWin - shorter typing of names in gdb, yay
svn path=/trunk/KDE/kdebase/workspace/; revision=650773
2007-04-05 12:12:10 +00:00
Luboš Luňák e3b865cd5f namespace KWinInternal -> KWin - shorter typing of names in gdb, yay
svn path=/branches/work/kwin_composite/; revision=650770
2007-04-05 12:07:35 +00:00
Luboš Luňák 6c51fb76f4 Kill only with left or middle button.
svn path=/trunk/KDE/kdebase/workspace/; revision=623744
2007-01-15 12:19:44 +00:00
Luboš Luňák de4d1bc518 Implement cursorPos() as an optimized version of QCursor::pos()
that tries to reduce the number of X roundtrips.


svn path=/branches/work/kwin_composite/; revision=620326
2007-01-05 17:45:54 +00:00
Luboš Luňák e0dcc3ba46 Some convenience functions for QX11Info stuff.
svn path=/branches/work/kwin_composite/; revision=558154
2006-07-04 19:36:19 +00:00
Laurent Montel 5725624c8b #include <q...h> -> #include <Q...>
svn path=/trunk/KDE/kdebase/workspace/; revision=540496
2006-05-13 16:33:18 +00:00
Allen Winter ae65a40c7a TRUE->true, FALSE->false
svn path=/trunk/KDE/kdebase/workspace/; revision=511180
2006-02-19 01:33:48 +00:00
Stephan Kulow b464518b3c svn merge svn+ssh://coolo@svn.kde.org/home/kde/trunk/KDE/kdebase@438057
svn+ssh://coolo@svn.kde.org/home/kde/branches/work/kde4/kdebase
          .

I couldn't resolve one kicker conflict that results from different
development directions, so I rely on Aaron to sort it out - the file
is commited with conflicts

svn path=/trunk/KDE/kdebase/kwin/; revision=439627
2005-07-28 14:59:42 +00:00
Luboš Luňák 0ba12a0837 Perform whole new window managing with X server grab, in order to prevent
"smart" apps from doing stupid things before they get MapNotify.
This avoids the recent Java+OracleInstaller strange problem too.
The patch may look huge, but it's only adding two KWin wrappers
for X(Un)GrabServer() and uncommenting the calls in Client::manage().

svn path=/trunk/kdebase/kwin/; revision=271152
2003-12-04 13:54:10 +00:00
Luboš Luňák 10f405c73d Merging kwin core from kwin_iii back to HEAD.
svn path=/trunk/kdebase/kwin/; revision=251608
2003-09-16 19:28:03 +00:00
Luboš Luňák 35c890d029 Fix #44133. Approved by Gallium.
svn path=/trunk/kdebase/kwin/; revision=184025
2002-10-15 13:41:37 +00:00
Simon Hausmann c8f1508b36 - moved netwm.h inclusions after indirect qvariant.h inclusions
(fixes Bool clash)
- missing includes (qcursor,qstyle,qpainter,qvaluelist)
- minor qstyle api fixlet

svn path=/trunk/kdebase/kwin/; revision=110958
2001-08-18 23:06:16 +00:00
Waldo Bastian 2f90225543 Put stuff in KWinInternal namespace.
Export client.h, workspace.h and options.h so that people can write plugins.

svn path=/trunk/kdebase/kwin/; revision=83707
2001-02-20 01:20:38 +00:00
Waldo Bastian 49bb12bd95 WABA: Fix for --enable-final
svn path=/trunk/kdebase/kwin/; revision=61201
2000-08-16 04:07:16 +00:00
Matthias Ettrich ffbe75dfba some bugfixes
svn path=/trunk/kdebase/kwin/; revision=60295
2000-08-09 10:02:56 +00:00
Werner Trobin 13aebff097 Commented out some more #define QT_CLEAN_NAMESPACE statements
svn path=/trunk/kdebase/kscreensaver/; revision=59186
2000-07-29 07:59:24 +00:00
Dirk Mueller 6d0db49d84 warning -> qWarning
these warnings should be popup boxes in fact.
If only there would be no string freeze... :-(

svn path=/trunk/kdebase/kwin/; revision=59163
2000-07-29 01:55:29 +00:00
Matthias Ettrich 601d183852 another missing file
svn path=/trunk/kdebase/kwin/; revision=53659
2000-06-19 10:46:08 +00:00