Commit Graph

326 Commits (958e47b36c491adfcd7cec08d5e5e63d3962cd0a)

Author SHA1 Message Date
Martin Gräßlin 958e47b36c Enable unmap notify event handling in Client
Interestingly the attribute send_event from XUnmapEvent does not exist in
xcb_unmap_notify_event_t and also the X protocol doesn't know anything
about send event.
2013-07-29 09:00:43 +02:00
Martin Gräßlin df4b43ea78 Enable property notify event handling in Client and Unmanaged 2013-07-29 09:00:43 +02:00
Martin Gräßlin 94f23c1877 Enable X extension event handling in Unmanaged 2013-07-29 09:00:43 +02:00
Martin Gräßlin 188d01567d Enable configure notify event handling in Unmanaged 2013-07-29 09:00:43 +02:00
Martin Gräßlin 62c044601b Enable (un)map notify event filtering in Unmanaged
The specific methods are dropped as UnmapNotify event is not used at all
and just delegates to another method and map notify was noop.
2013-07-29 09:00:42 +02:00
Martin Gräßlin ce10105dfc Enable event handling for the X extension events
* Randr still needs XCB adjustments
* Client::syncEvent needs porting to XCB
2013-07-29 09:00:42 +02:00
Martin Gräßlin 59a2da3b1e Enable visibility notify event handling 2013-07-29 09:00:42 +02:00
Martin Gräßlin 2ec9be5731 Enable expose event handling 2013-07-29 09:00:42 +02:00
Martin Gräßlin eb17d9b518 Enable client message event handling 2013-07-29 09:00:42 +02:00
Martin Gräßlin 50113e0560 Enable focus in/out event handling
Focus in has XLib code which needs to be ported to XCB.
2013-07-29 09:00:42 +02:00
Martin Gräßlin 8a93690216 Enable configure request event handling
Still uses XLib configure window, this should be ported but not at
the same time as the event handling.
2013-07-29 09:00:42 +02:00
Martin Gräßlin 70f93c12a8 Enable enter/leave notify event handling 2013-07-29 09:00:42 +02:00
Martin Gräßlin 939c2d14c1 Enable map notify event handling
As part of it Unmanaged::windowEvent() takes an xcb_generic_event_t*
instead of XEvent* as argument. Method of course still needs porting.
2013-07-29 09:00:41 +02:00
Martin Gräßlin c863029b8d Enable map request event processing
Also replaces XMapRaised by xcb equivalent.
2013-07-29 09:00:41 +02:00
Martin Gräßlin f70208c7c4 Enable unmap, reparent and destroy notify event handling 2013-07-29 09:00:41 +02:00
Martin Gräßlin 69655199cd Enable create notify event handling
Also port from XChangeProperty to xcb_change_property.
2013-07-29 09:00:41 +02:00
Martin Gräßlin e4415d370c Enable the event filtering for the movingClient
This requires to have the Client::windowEvent() take an
xcb_generic_event_t* instead of XEvent*. Currently functionality is
ifdefed.
2013-07-29 09:00:41 +02:00
Martin Gräßlin e378cb6dba Enable configure notify event handling 2013-07-29 09:00:41 +02:00
Martin Gräßlin 334cf10d7d Enable Key Press/Release events
Requires review 373d812a636da898a0f1cc017fa2c9dd4ff50381 on
kdelibs frameworks.
2013-07-29 09:00:20 +02:00
Martin Gräßlin 485f0a3e06 Process mouse events
Button Press/Release do no longer fall through to motion notify as
there is no shared mouse event in xcb. Also the methods in Effects and
TabBox are adjusted to process only button press/release or motion
notify.

ScreenEdges are no longer checked for button press/release. They don't
interact on button press/release so there is no need to check it.
2013-07-29 08:58:05 +02:00
Martin Gräßlin d81c45a810 Disable updating rootInfo for property notify or client message
This needs porting in KWindowSystem first.
2013-07-29 08:58:05 +02:00
Martin Gräßlin 206fd10ea8 Pass events through an active window killer 2013-07-29 08:58:05 +02:00
Martin Gräßlin 1c3e0de31d Stop keyboard event processing if effects have a grab 2013-07-29 08:58:05 +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
Thomas Lübking 516ea86341 block quick tiling unless actually moved
REVIEW: 109485
BUG: 289494
FIXED-IN: 4.11
2013-06-05 14:11:00 +02:00
Martin Gräßlin 5632285b1e Client's button(Press|Release)Event and motionNotifyEvent accept xcb_window_t 2013-05-28 11:55:39 +02:00
Martin Gräßlin b4d2129a3f Port Client::client to XCB
Unfortunately the Xcb::Window wrapper cannot be used for the client
window as the client should not be destroyed by KWin.

All the API calls except XSelectInput are changed to xcb and the name is
adjusted to m_client to follow the naming scheme.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 424589ab4a Use an Xcb::Window for Client::wrapper
The Xcb::Window nicely encapsulates the created wrapper window. As
almost all code is adjusted, the variable is also renamed to
m_wrapper to follow the normal naming scheme.
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 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 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 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 eb6ce2b7c4 Remove XDamageNotifyEvent* argument from Toplevel::damageNotifyEvent
It's not used...

REVIEW: 110201
2013-04-26 12:31:07 +02:00
Martin Gräßlin 5b56cff520 Remove demands attention notification 2013-04-23 16:21:30 +02:00
Thomas Lübking 8cf6e39eab general tabbox support for screenedges
REVIEW: 109362
BUG: 316288
FIXED-IN: 4.11
2013-04-16 22:07:07 +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 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 76c6f75d80 Remove colormap handling from Client::windowEvent
This code never worked (git blame ends at 05507ee2). The event type is
ColormapNotify (32) and not ColormapChangeMask (1<<23).

Nobody noticed for years so it seems like unneeded to be fixed.

REVIEW: 109912
2013-04-15 09:46:15 +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
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 32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
2013-03-06 10:26:56 +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 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
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
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 334b4bf622 Move handling of Virtual Desktops into a VirtualDesktopManager
The ownership for virtual desktops is moved from Workspace into a new
VirtualDesktopManager. The manager is responsible for providing the count
of virtual desktops and keeping track of the currently used virtual
desktop.

All methods related to moving between desktops are also moved from
Workspace to the new manager, though all methods related to Clients on
Virtual Desktops remain in Workspace for the time being. This is to have
the new manager as independent from KWin core as possible.

An rather important change for the handling of virtual desktops is that
the count and the id of a desktop is now an unsinged integer instead of
an integer. The reason for that is that we cannot have a negative count
of desktops as well as it is not possible to be on a desktop with a
negative identifier.

In that regard it is important to remember that a Client can be on a
desktop with a negative identifier. The special value for a Client being
on all desktops is handled by using -1 as a desktop. For the time being
this is not adjusted but instead of comparing the virtual desktop ids one
should prefer to use the convenient methods like isOnDesktop and
isOnAllDesktops. This would allow in future to internally change the
representation for on all desktops.
2013-01-07 09:47:51 +01:00
Thomas Lübking d6d82b2a08 unlink ExtendedBorderRegion from unstable API
also fix initial mapping state

BUG: 307721
BUG: 308994
FOXED-IN: 4.10
REVIEW: 106715
2012-11-14 21:11:36 +01:00