Commit Graph

828 Commits (b3d8ce904431a28530475366f68df27b0b987077)

Author SHA1 Message Date
Thomas Lübking b3d8ce9044 make minimized windows first of minimized
instead of last, causingding to  general LIFO

REVIEW: 110567
2013-05-22 22:24:35 +02:00
Aurélien Gâteau 9aea91166b Improve kwin_killer_helper dialog
Simplify dialog text, using different text for local and remote
processes.

Replace "KWin" in the dialog name with "Window Manager".

REVIEW: 110363
2013-05-16 09:39:11 +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 9ed3307467 Port Decoration related XLib code to XCB
REVIEW: 110341
2013-05-07 16:55:09 +02:00
Martin Gräßlin 4022de7075 Use signal/slots instead of deep function calls into decoration
For all the decoration updates called from Client into the decoration we
also have a signal being emitted. So turning the pure virtual public
functions into slots means we can just connect our existing signals and
get rid off the deep function calls.

The keepAbove/Below signals are changed to take a boolean argument as
needed by KDecoration and a few emitted signals are moved to a better
fitting location.

REVIEW: 110335
2013-05-07 16:53:58 +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 6dc64841a7 Cleanup and reorder includes in client.cpp
REVIEW: 110205
2013-04-29 08:42:44 +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 6d0d9cfe43 Remove KWin::Notifications
Overall all notifications except compositing suspended by DBus were
configured by default to not have any action. This means all the time we
emit a notification we keep DBus and KDED busy for nothing.

All the cases when a notification is triggered ire also exported to
KWin scripting, so if one really needs to handle something in case a
window is moved, it could be done through a KWin script with much more
context about the event.

REVIEW: 110113
BUG: 258097
FIXED-IN: 4.11
2013-04-23 16:23:55 +02:00
Martin Gräßlin 5b56cff520 Remove demands attention notification 2013-04-23 16:21:30 +02:00
Martin Gräßlin c9bfecc12b Remove dialog close notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 5db4923598 Remove (not) on all desktops notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 2a2632ee76 Remove Window Unminimize Notification
Fun fact: it was configured to play the Unmaximize sound.
2013-04-23 16:21:29 +02:00
Martin Gräßlin d6c4fc4f86 Remove Window Minimized Notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 6c0a35d0e0 Remove Shade Up/Down Notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 88c77db4b8 Remove window close notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 5d303e0fee Remove delete window notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin 15546e11c2 Rename DecorationPlugin::noDecoration property to disabled 2013-04-15 09:59: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 bac6edb269 Add Activities::nullUuid() to replace define in client.cpp
REVIEW: 109853
2013-04-11 13:01:53 +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
Martin Gräßlin 6d6b013720 Introduce a proper screen property in Toplevel
Instead of calculating the screen number each time screen() is invoked,
the screen number gets stored in a private member variable and evaluated
whenever either the screen count changes or the Toplevel's geometry
changes. During move/resize the screen property doesn't get updated. The
update is delayed till the end of the move/resize operation.

REVIEW: 109715
2013-04-02 08:21:01 +02:00
Martin Gräßlin 556d71933b Merge branch 'KDE/4.10' 2013-04-02 08:18:40 +02:00
Martin Gräßlin d12f5de4c0 Adding an activitiesChanged signal to Toplevel
Only emitted from Client.

REVIEW: 109706
BUG: 317366
FIXED-IN: 4.10.3
2013-04-02 08:17:30 +02:00
Thomas Lübking 16998db274 Merge branch 'KDE/4.10'
Conflicts:
	kwin/useractions.cpp
2013-03-24 22:29:50 +01: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
Thomas Lübking f6bad91b17 use QWidgetAction for activity setting in alt+f3
not that i really like using QWidgetAction, but it'll
prevent the popup from autoclosing.
Introduce activityUpdateBlocking to prevent users from
removing the popup under their fingertips

BUG: 283309
FIXED-IN: 4.10.2
REVIEW: 107762
2013-03-24 21:57:26 +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
Thomas Lübking eab1166dbc set / withdraw iconic state for shaded clients
Should shaded windows be iconic?
I don't know. Apparently nobody does. (google found me discussions but no conclusion)

OpenBox, Metacity and Compiz set shaded Windows iconic, Sawfish and IceWM don't.

Either way kwin presently sets shaded windows iconic when you map them (client.cpp, void Client::map(allowed_t)) so to remain consistent with ourselves and half of the other WMs i set it.
Otherwise it should not be set when unshading a window
(no justification but noteworthy: the bug reporter seems to intend to pause expensive painting when the window is iconic and in that regard it's oc better to have it for shaded windows)

BUG: 317025
FIXED-IN: 4.11
REVIEW: 109593
2013-03-20 22:23:43 +01:00
Martin Gräßlin fba7504063 Introduce dedicated PaintRedirector subclasses for OpenGL/XRender
PaintRedirector is turned into an abstract class providing a factory
method which returns either an instance of
* OpenGLPaintRedirector
* NativeXRenderPaintRedirector
* RasterXRenderPaintRedirector

OpenGLPaintRedirector is basically doing exactly the same as the parent
class used to do before. Though the idea is to extend the functionality
to have the PaintRedirector write directly into OpenGL textures to limit
copying the complete decorations.

NativeXRenderPaintRedirector is similar to OpenGLPaintRedirector by
rendering into a QPixmap and providing the pictureHandle for the QPixmap
to SceneXRender.

RasterXRenderPaintRedirector is providing the functionality for the case
that the QPixmap/XPixmap relationship is not present. From the QPixmap
containing the pending decoration paint a QImage is created and then the
relevent parts are copied directly into the decoration pixmap.

REVIEW: 109074
2013-03-11 11:19:57 +01:00
Martin Gräßlin 1f141a891e Drop QX11Info from client.cpp
Only used to get display() which is wrapped in kwinglobals.h
2013-03-07 13:59:15 +01:00
Thomas Lübking 4999b12387 fix merge... 2013-03-05 19:30:42 +01:00
Thomas Lübking 60a62b2a1a Map NULL_UUID activity to ALL activities
REVIEW: 109274
BUG: 314830
FIXED-IN: 4.10.2
2013-03-05 19:25:23 +01:00
Thomas Lübking c0f3895ba7 Map NULL_UUID activity to ALL activities
REVIEW: 109274
BUG: 314830
FIXED-IN: 4.10.2
2013-03-05 19:22:01 +01: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 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
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
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 3389d68c50 Print useful information for a Client in scripting
Reusing the debug information already specified for QDebug.

FEATURE: 314402
FIXED-IN: 4.11
REVIEW: 108959
2013-02-18 09:16:31 +01:00
Thomas Lübking fb356a8bef capture condensedTitle config change 2013-01-30 13:07:03 +01:00
Thomas Lübking e2db836def Merge branch 'KDE/4.10'
Conflicts:
	kwin/client.cpp
2013-01-30 12:43:39 +01:00
Thomas Lübking bf2776b42f capture condensedTitle config change 2013-01-30 10:45:21 +01:00
Thomas Lübking 664f06e005 re-fix resetShowingDesktop invocation
was fixed with f9e182068f380fc67b89501bf40f16aa35dd861b
broke it with 3433b31a085a6d3f9439532777cab8fdf1cdf663

REVIEW: 108452
BUG: 302248
2013-01-23 21:28:26 +01:00
Thomas Lübking e642c5cb9d Use the NULL Uuid instead of "ALL"
to indicate "on all activities"

REVIEW: 107855
2013-01-23 21:27:45 +01:00
Thomas Lübking e51e0112c4 re-fix resetShowingDesktop invocation
was fixed with f9e182068f380fc67b89501bf40f16aa35dd861b
broke it with 3433b31a085a6d3f9439532777cab8fdf1cdf663

REVIEW: 108452
BUG: 302248
2013-01-23 21:27:45 +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
Thomas Lübking d0dd23b7b7 Merge branch 'KDE/4.10' 2013-01-08 20:50:37 +01:00