Commit Graph

645 Commits (31dcf51c88438ca85a053cab0ddbf78124078b39)

Author SHA1 Message Date
Martin Gräßlin af48d38d22 Workspace::should_get_focus becomes QList<AbstractClient*> 2015-05-08 12:43:46 +02:00
Martin Gräßlin 94ce47ef7b Workspace::mostRecentlyActivatedClient returns an AbstractClient
Implementation temporarily moved to cpp. Needs to be moved back once
should_get_focus and active_client are AbstractClient.
2015-05-08 12:43:46 +02:00
Martin Gräßlin b1026aa162 Workspace::allowFullClientRaising operates on AbstractCliet 2015-05-08 12:43:46 +02:00
Martin Gräßlin 1d7d1787a8 Workspace::last_active_client becomes an AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin f28d759352 Workspace::allowClientActivation operates on AbstractClient
Still requires a dynamic_cast for check on should_get_focus. To be
removed once Workspace::should_get_focus is a list of AbstractClients.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 683fc0613f Workspace::packPosition* operates on AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin 138c1b2ff0 Workspace::sendClientToDesktop operates on AbstractClient
Unfortunately transient handling is still on Client, thus it's
still in a cast-if block.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 4f1c98773e Workspace::showWindowMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin c357ac01fe Workspace::restackClientUnderActive operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin ddcd4dab59 Workspace::slotWindowTo(Previous|Next)Desktop operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 1d4701d67e Workspace::takeActivity operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 484f9b6e65 Workspace::activateClient and ::requestFocus changed to AbstractClient
requestFocus delegates to takeActivity which is not yet adjusted but
performs a nullptr check, thus we pass a casted Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 8cfe0a9316 Workspace::clientActivated signal changed to AbstractClient
connections changed to new connect syntax to ensure they are correct.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 3ad117ac28 Workspace::activeClient returns an AbstractClient
Still a few casts in some areas as setting activeClient still takes
a Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 4b41c33268 Workspace::movingClient changed to AbstractClient
In events.cpp it's casted to Client as it's X11 specific.
In InputRedirections it's kind of broken, but window movement is
anyway broken.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 519006ffa4 Workspace::performWindowOperation operates on AbstractClient
Only exception is the call to ::takeActivity which still expects a
Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin bfa4e1cec1 Workspace::cascadeOffset operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 942b49e2c4 Workspace::setupWindowShortcut operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin aa1e9161d5 Workspace::clientArea takes AbstractClient instead of Client 2015-05-08 12:43:44 +02:00
Martin Gräßlin 7c187359a7 Workspace::sendClientToScreen operates on AbstractClient 2015-05-08 12:43:44 +02:00
Martin Gräßlin f800477be5 Use AbstractClient for raise/lowerClient
Not a 100 % port. Transient handling is still bound to Client and
does a static cast back to Client.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 1b02837d0b Add overload Workspace::hasClient(const AbstractClient*)
Delegates to hasClient(const Client*) if the AbstractClient is a
Client. Needs to be extended for other AbstractClient subclasses.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 792745c963 Change Workspace::restack to operate on AbstractClient 2015-05-08 12:43:44 +02:00
Thomas Lübking c2a120019b emit signal when showingDesktop changes 2015-04-07 23:59:17 +02:00
Thomas Lübking cbfcd3b096 implement showingDesktop by raising desktop window
This is an alternative approach suggested by the
NETWM spec.
The advantage is, that windows are not minimized
at all what apparently lead to some confusion
about the nature of the mode (which was abused
to tidy up) and a secret config key to allow for
that unrelated behavior.
Instead the ShowDesktopIsMinimizeAll key is removed
and replaced by a dedicated script + shortcut.

Bonus: less code to remember "minimized" windows =)
2015-04-07 23:59:17 +02:00
Mika Allan Rauhala 2217c1038f Add Quick Tile Window to the Top and Bottom shortcuts
This adds "Quick Tile Window to the Top" and "Quick Title Window to the Bottom" shortcuts. These are
useful for those using displays that are in portrait orientation.

CCBUG: 310005
REVIEW: 123153
2015-03-31 11:10:13 +02:00
Martin Gräßlin 7369a2c3a5 [kwin_wayland] Support using platform wayland for the QPA
This reorders the startup sequence quite a bit:
1. Create QAbstractEventDispatcher and install it on QCoreApplication
2. Create Application
3. Start Xwayland, use thread to get when its ready
4. Create xcb connection
5. perform startup

For using the wayland QPA it needs a patch in QtWayland which will be
part of Qt 5.4.2, otherwise it blocks.
2015-03-17 10:20:19 +01:00
Martin Gräßlin e463905f04 Add Workspace::findToplevel
Like findClient and findUnmanaged, just a little bit more generic.
Toplevel::findInList got adjusted to support it.
2015-03-17 10:08:27 +01:00
Thomas Lübking ea5a5f196d allow forcefull restacking
when restacking for shaded windows and uncomposited tabboxes
the group check should not be applied since we know better
eg. to restore a former order

CCBUG: 186206
REVIEW: 122469
2015-02-10 21:40:55 +01:00
Thomas Lübking ff700a8db5 fix e3768b4355
accidentally picked the patch from the wrong branch
just about comments
2015-02-06 00:27:31 +01:00
Martin Gräßlin d4e2f19ef0 Workspace does not need to inherit from KDecorationDefines 2014-12-02 11:17:43 +01:00
Martin Gräßlin d4bf3602ce Move WindowOperation enum to Options
With this Options no longer needs to inherit from KDecorationDefines.
2014-12-02 10:41:47 +01:00
Martin Gräßlin b7a8bb4f52 Drop build option KWIN_BUILD_SCREENEDGES
The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.

CCBUG: 340960
REVIEW: 121200
2014-11-24 10:48:49 +01:00
Fredrik Höglund 869ebdd4c0 Add an X11EventFilter class
This class provides an event filter, specific to an event type, that
can be registered with Workspace to filter events.
2014-09-18 20:21:20 +02:00
Thomas Lübking c654dd4ff1 WORKAROUND bug #335926
QXcbScreen overrides the input eventmask when
adding a screen, so we claim our stuff back

BUG: 335926
REVIEW: 118765
2014-07-03 18:39:38 +02:00
Thomas Lübking c455087248 add selectWmInputEventMask function
It sets the mask required for a WM and in addition
preserves the eventmask present on the root window for
this client (as set by any lib etc.)
2014-07-03 18:39:38 +02:00
Martin Gräßlin 97726a4b1f [TabBox] Fix forcedGlobalMouseGrab
Was incompletely moved to TabBox after splitting out from Workspace.

REVIEW: 118259
2014-05-23 07:31:00 +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 fe5f7fb2f6 [kwin] Drop Predicate based Workspace::forEachClient
Migrates the last usage to the lambda based variant.
2014-03-25 15:17:11 +01:00
Martin Gräßlin 11d0176dc9 [kwin] Drop predicate based Workspace::forEachUnmanaged
Unused code.
2014-03-25 15:17:11 +01:00
Martin Gräßlin 12a4923959 [kwin] Use std::find_if and lambda functions for Workspace::findUnmanaged
Instead of passing the macro based Predicate to findUnmanaged it now
expects a function which can be passed to std::find_if.

Existing code like:
xcb_window_t window; // our test window
Unmanaged *u = findUnmanaged(WindowMatchPredicated(window));

becomes:
Unmanaged *u = findUnmanaged([window](const Unmanaged *u) {
    return u->window() == window;
});

In addition an overload is added which takes the window id to cover
the common case to search for an Unmanaged by its ID. The above example
becomes:
Unmanaged *u = findUnmanaged(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.
2014-03-25 15:17:10 +01:00
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 7d48b92e2b Redirect pointer events to the Toplevel
InputRedirection keeps track of the Toplevel which is currently the one
which should get pointer events. This is determined by checking whether
there is an Unmanaged or a Client at the pointer position. At the moment
this is still slightly incorrect, e.g. pointer grabs are ignored,
unmanaged are not checked whether they are output only and input shapes
are not yet tracked.

The pointer events are delivered to the Toplevel as:
* enter
* leave
* move
* button press
* axis event

Nevertheless move events are still generated in InputRedirection through
xcb test for simplicity. They are still send to the root window, so all
windows get mouse move.

Button press and axis are generated only in the implementations of the
event handlers and delivered directly to the window, so other windows
won't see it.
2014-03-18 09:00:50 +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 08a09d27f8 [kwin] Remove the KActionCollection for the client keys
Not needed as we can also find the action as a child of Workspace.
2013-12-10 10:15:23 +01:00
Martin Gräßlin a6f32bf3e8 [kwin] Do not use a KActionCollection for Workspace's global shortcut actions
The ActionCollection was only used for two features:
* setting the object name
* finding the action for retrieving it's shortcut

This can also be achieved by just setting the object name and searching
for the children of the Workspace singleton.
2013-12-10 10:01:13 +01:00
Martin Gräßlin 81a7a528bb [kwin] Block global shortcuts without KGlobalSettings
DBus call directly to kglobalacceld and don't wait for a signal to
come back.
2013-12-06 10:28:42 +01:00
Martin Gräßlin 9f6f0dd688 [kwin] Drop reaction on SETTINGS_SHORTCUTS changed
This looks mostly like dead code. The change got only emitted by the
KCMKeyboard on save. In ancient times this seems to have caused to
re-read the global shortcuts. Code got commented out during KDE4 times
and after several code refactors all that was left of it was discarding
the user actions menu.
2013-12-06 10:20:10 +01:00
Martin Gräßlin 1398f9ed04 Remove left-over from disable global shortcuts removal
There used to be an own action collection in KDE 3 times for the
block global shortcuts shortcut. But the code ws disabled and by
that I didn't see it during removing the global shortcuts blocking.
And it explains why the global shortcut blocking didn't work.
2013-09-09 09:53:39 +02:00
Martin Gräßlin 0e24f4ead4 Introduce an initShortcut method for kwinbindings
Method replaces the logic of the macros. The macros are still there
to not need to change all the code. Major difference is that the new
method uses the compile time checked connect syntax.
2013-09-09 09:41:37 +02:00
Martin Gräßlin f4a96da547 Client shortcuts ported to QKeySequence
Pretty straight forward, though not yet tested.
2013-09-09 06:03:35 +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 c2e0c13b7b Delay performWindowOperation to next event cycle in UserActionsMenu
In case that the window operation results in destroying the window
decoration we need to have the menu closed before the deco gets
destroyed. Otherwise Qt crashes.
2013-08-19 12:15:42 +02:00
Martin Gräßlin 3d414b908a Remove kapplication.h include from sm.h
Not needed in sm.h and pollutes the includes of most header files.
2013-08-06 11:20:28 +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 b90c2c0e6a Modern variant of forEachClient/forEachUnmanaged
Takes a std::function as argument which allows to pass a lambda function
which gets executed for each client/unmanged:

ws->forEachClient([](Client *client) {
    client->releaseWindow();
});
2013-08-05 09:42:10 +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 f11e3283d7 Introduce an XcbEventFilter and install it in the Application
Forwards all xcb events to Workspace::workspaceEvent() which got changed
to process xcb events instead of XEvents. So far all handling is
disabled. Will be re-enabled step by step in the following patches.
2013-07-29 08:58:05 +02:00
Martin Gräßlin 1d2c2d5982 Use Q_SLOTS and Q_SIGNALS instead of slots and signals
Fixes compilation with Qt5/KF5 setup.
2013-07-24 09:46:54 +02:00
Martin Gräßlin 17e38f3357 Remove "Block global shortcuts" global shortcut
This shortcut did not make any sense to me, because you could block the
global shortcuts for KWin, but not re-enable them again. So once blocked,
it was blocked for ever till kwin --replace &.

This is in opposite to the commit message which introduced it
(see BUG 108961).

REVIEW: 110364
2013-05-28 08:02:12 +02:00
Thomas Lübking f2dd6d02b1 add previous screen shortcuts
REVIEW: 110521
BUG: 303083
FIXED-IN: 4.11
2013-05-22 22:25:15 +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 c4c3eb90fb Remove outdated showWindowMenu(At) functions
Instead of wrapping for exactly one case let's just use the proper
function calls and get rid of all those methods marked as "remove KDE4"
and "backwards compatibility".

REVIEW: 110292
2013-05-04 09:58:44 +02:00
Martin Gräßlin 0811d17329 Encapsulate colormap related functionality in own class
Split out the default and installed colormap from Workspace and put them
into an own class Colormaps.

The method updateColormaps is replaced by a slot update in Colormaps and
activeClientChanged signal is connected to this slot.

At the same time the colormap related code is straight forward ported to
xcb.

REVIEW: 110248
2013-05-02 13:47:02 +02:00
Martin Gräßlin b6681ddc3a Turn RootInfo into a KWIN_SINGLETON
It's not a typical singleton as the ctor is not taking a Workspace* and
needs addtional data to be passed to NETRootInfo.

All the initialization code is moved to RootInfo::create() and the tear-
down code is moved to RootInfo::destroyed(). This includes the support
window which used to be a member of Workspace. It's only needed by
RootInfo, so there is no need to have the ownership inside Workspace.

Instead of using a QWidget we just create a normal window through xcb.
It gets destroyed again in the tear-down code after the RootInfo got
destroyed.

REVIEW: 110238
2013-05-01 19:14:38 +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 23b395059f s/Time/xcb_timestamp_t/g in workspace.h
REVIEW: 110249
2013-05-01 19:08:00 +02:00
Martin Gräßlin 28d7b3c563 s/Window/xcb_window_t/g in workspace.h 2013-05-01 19:07:56 +02:00
Martin Gräßlin db18c08dd0 Move RootInfo and WinInfo into an own header and impl file
Main motivation for this change is that it's unhandy to have the class
definition in workspace.h and client.h while the implementation is in
events.cpp although nothing in events.cpp uses it directly.

By getting it out of workspace.h we get the header a little bit smaller
which should improve compile time given that it's included almost
everywhere.

In events.cpp the enum usage is changed to NETWinInfo as that's the class
where they are defined.

RootInfo does no longer hold a workspace pointer. Where it's needed it
uses the singleton accessor of Workspace.

REVIEW: 110199
2013-04-30 08:06:12 +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 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 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
Martin Gräßlin c094c7e7cd Cleanup includes and forward declarations in workspace.h 2013-04-26 08:47:33 +02:00
Martin Gräßlin cd025c7526 Make Outline a KWIN_SINGLETON
Given that Outline is now a QObject hold by Workspace, but not used in
Workspace, it can also be a KWIN_SINGLETON.

REVIEW: 110146
2013-04-25 09:04:02 +02:00
Martin Gräßlin edb074cbc2 Split out screen handling from Workspace into own class Screens
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.

The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse

The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.

All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.

REVIEW: 109839
2013-04-15 10:25:10 +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 a27bbb9698 Forward declare KillWindow in workspace.h 2013-04-15 10:08:51 +02:00
Martin Gräßlin 2702c1930b Remove useless method Workspace::killWindow
Was just wrapping to slotKillWindow.
2013-04-15 10:08:51 +02:00
Martin Gräßlin a442bd6416 DecorationPlugin becomes a QObject
This allows to move the slot to reset the decoration when compositing
got toggled from Workspace to DecorationPlugin and the custom cleanup
is no longer needed.

REVIEW: 109909
2013-04-15 10:04: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 d8e1b1c00e Rename plugins.(h|cpp) to decorations.(h|cpp) 2013-04-15 09:59:09 +02:00
Martin Gräßlin 32be37bce3 Rename PluginMgr to DecorationPlugin
It's about the decorations not just *the* plugin.
2013-04-15 09:59:09 +02:00
Martin Gräßlin d503d9ffb6 Turn TabBox into a proper singleton
There is only one instance hold by Workspace which means it should follow
the common approach with ::self and ::create.

The hasTabBox is completely removed as it's rather useless and the same
as the ifdef around the usages any way.

REVIEW: 109851
2013-04-11 14:18:30 +02:00
Martin Gräßlin 6f113d84d3 Turn Scripting into a proper singleton
There is only one instance hold by Workspace which means it should follow
the common approach with ::self and ::create.

REVIEW: 109850
2013-04-11 14:01:39 +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
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
Martin Gräßlin 15aa42c565 Remove doNotManage hack for Java Applets
The hack used to be used to hide windows before they get embedded into
another window. This has been wrong on multiple levels:
1. it does not belong into a window manager - the window should take care
   of this by itself
2. Window title is not a proper way to identify windows
3. Using D-Bus to inform an X11 window manager about windows which should
   not get managed is rather strange
4. The hack only works with KWin, but not with any other X Window Manager
5. Windows identified with this hack still appear in Alt+Tab, that is
   they are managed after all. Only a flicker is suppressed
6. Such windows are shown in the taskbar which nicely illustrates how
   wrong a D-Bus call to the window manager is

That the hack has been introduced for Java Applets in KHTML also shows
that this is wrong. Why does Gecko and WebKit not need such a hack? Why
is KHTML tied so closely to X11 and KWin? Having a hack for a technology
which is obsoleted (Java Applets) and shouldn't be used due to security
issues is another reason to no longer support this hack. This usage has
been removed from KHTML as of 67939b1 of kdelibs git repo.

REVIEW: 109450
2013-03-22 09:54:45 +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
Martin Gräßlin f12cf0efba Replacement class for QCursor
With Qt5 QCursor does no longer provide ::handle() which was used to
set a cursor on a native XWindow for which we do not have a QWidget.

Also KWin has had for quite some time an optimized version to get the
cursor position without doing XQueryPointer each time ::pos() is called.

These two features are merged into a new class Cursor providing more or
less the same API as QCursor.

In addition the new class provides a facility to perform mouse polling
replacing the implementations in Compositor and ScreenEdges.

For more information about the new class see the documentation for the
new class in cursor.h.
2013-02-25 13:35:14 +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 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
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
Thomas Lübking 004bdee7a2 do not try to raise possible panel proxies
but drop screenedges below the supportWindow instead
that's why it exists, that's deterministic, that's faster

includes adaption to new screenedge and xcb invocation (compared to 4.10)

BUG: 314625
FIXED-IN: 4.10.1
REVIEW: 108867
2013-02-12 21:58:46 +01:00
Martin Gräßlin a8539ff54e Turn ScreenEdges into a Singleton
In fact it already used to be a Singleton as there is just one object
hold by the Singleton Workspace. So let's make it a proper Singleton
following our kind of standard approach of having a ::create factory
method called from Workspace ctor and a ::self to get to the singleton
instance.
2013-02-07 09:46:52 +01:00
Martin Gräßlin d9aedf620b Rewrite of KWin's Screen Edge Handling
This rewrite is mostly motivated by the need to handle multi screen
setups correctly. That is have edges per screen and not for the combined
geometry. Also porting from XLib to XCB has been a motivation for the
rewrite.

The design of the new ScreenEdge handling is described in the
documentation of ScreenEdges in screenedge.h.

In addition the following changes have been performed:
* move configuration from Options to ScreenEdge
* add screen edge information to Workspace::supportInformation (obviously
  replaces what had been read from Options)
* have Workspace hold a pointer to ScreenEdges instead of an object
* forward declaration of ScreenEdges in workspaces.h, this explains the
  seemingly unrelated changes of just another include in some files

BUG: 290887
FIXED-IN: 4.11
2013-02-07 09:46:52 +01:00
Thomas Lübking c158507a66 signal change of stacking order to the effects
REVIEW: 108059
2013-02-05 19:15:39 +01:00
Martin Gräßlin 5f4935fc66 Merge branch 'KDE/4.10'
Conflicts:
	kwin/workspace.cpp
2013-01-14 15:43:01 +01:00
Martin Gräßlin 412afa3dcd Remove asserts from Compositor and wrap Toplevel::compositing() around Workspace::compositing()
BUG: 312712
FIXED-IN: 4.10
REVIEW: 108321
2013-01-14 15:41:08 +01:00
Martin Gräßlin 3ee9869ba0 Move ScreenEdge configuration from Workspace to ScreenEdge
Main motivation for this change except the fact that it doesn't belong
into Workspace is that the screen edges got updated from within setting
the desktop layout which got removed with the introduction of the
VirtualDesktopManager.

The ScreenEdge now keeps some state to be able to correctly unreserve the
electric borders when changes in the configuration are performed. There
is still room for improvement as there are still some deep function calls
from within reconfiguring in Workspace.

REVIEW: 107493
2013-01-07 09:47:59 +01:00