Commit Graph

461 Commits (f74df284508b403ceed676a9e626e1a666e693b6)

Author SHA1 Message Date
Martin Gräßlin aee20b4a5a Hide the OnAllDesktops button if there is only one virtual desktop
In KCommonDecoration the OnAllDesktops button gets hidden or shown
depending on the number of desktops. For that KDecoration is extended
by a new property which delegates to the bridge to return whether
onAllDesktops is available. In KWin Core this is implemented using
the number of desktops.

FEATURE: 321611
FIXED-IN: 5.0.0
REVIEW: 116076
2014-03-05 13:02:32 +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 fdee4ea8c8 Adjust kde-workspace to introduction of flags in NET classes 2014-02-05 17:40:19 +01:00
Thomas Lübking 4bb88df714 Merge branch 'KDE/4.11' 2014-01-14 22:51:24 +01:00
Thomas Lübking 3d389961ff preserve offsets when sending client to screen
for that purpose, move sendToScreen and updateLayer
functions from Workspace to Client, keep wrappers

BUG: 327361
FIXED-IN: 4.11.6
REVIEW: 114078
2014-01-14 22:28:46 +01:00
Thomas Lübking c378bf4f7c emit desktopPresenceChanged from Client:setDesktop
and forward it to scripted effects

CCBUG: 326903
REVIEW: 114080
2014-01-14 22:23:49 +01:00
Martin Gräßlin 2372e02752 [kwin] Use a QIcon in Client for the icons instead of Pixmaps
Client used to have dedicated methods for different icon sizes instead
of combining all pixmaps into one QIcon. This resulted in various parts
of KWin having different access to the icons:
* effects only got one pixmap of size 32x32
* decorations only got the 16x16 and 32x32 pixmaps combined into a QIcon
* tabbox could request all icon sizes, but only as pixmap

Now all sizes are available in one QIcon allowing to easily access the
best fitting icon in a given UI.
2013-12-06 14:41:23 +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 4a4ec0decd [kwin] Add XLib includes where still needed
No longer included through netwm.
2013-11-18 13:52:38 +01:00
Martin Gräßlin 8ecb69cd8c [decorations] Add a KDecoration::window() returning the QWindow
KWin core can access the QWindow of the decoration instead of the
QWidget. This is a preparation step to allow QWidget based window
decorations without any QWidgets at all.

KWin core makes already use of this new accessor to get the window Id
which is also on QWidgets provided through the QWindow.
2013-11-14 09:41:50 +01:00
Thomas Lübking 3594550b14 Merge branch 'KDE/4.11'
Conflicts:
	kwin/eglonxbackend.cpp
	kwin/glxbackend.cpp
2013-09-25 23:21:36 +02:00
Thomas Lübking 06b482f725 pack to client, not deco
this makes packing following the snapping behavior

REVIEW: 112807
2013-09-25 23:09:08 +02:00
Martin Gräßlin cfd93246b3 Toplevel::frameId() becomes virtual
The frameId only makes sense for a Client, in case of Unmanaged the
same window id is used as for the window() handle. Client creates the
frame and destroys it.

Given that it makes sense to let Client manage the frame properly.
The ::frameId() is therefore virtual and as base implementation it
returns the client id. Client reimplements it and returns the proper
frame id.

Method is also implemented in Deleted as it used to be passed to
deleted.
2013-09-10 15:30:10 +02:00
Martin Gräßlin c1483f41d4 Use Xcb::Window wrapper class for Client::m_client
Now we can use the wrapper for the client which we manage.
2013-09-10 15:30:10 +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 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
Martin Gräßlin 94e4a31370 Port from XLib XSync to xcb sync 2013-07-31 14:05:24 +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 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
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 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 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 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 3f69bb0e7f Change Client's clormap to xcb_colormap_t
At same time also renaming variable to follow naming scheme and have a
sensible name. Also moved default value initialization into initializer
list.

REVIEW: 110283
2013-05-28 11:55:39 +02:00
Martin Gräßlin 41b37afa96 Use xcb_timestamp_t for ping window functionality
At same time rename the variable to follow m_camelCase naming scheme and
initialise the variable with default value in ctor.
2013-05-28 11:55:39 +02:00
Martin Gräßlin b39965ec27 Client's userTime related code ported over to XCB
At same time variable user_time renamed to m_userTime to follow naming
scheme.
2013-05-28 11:55:39 +02:00
Martin Gräßlin dc1496f731 Client::killProcess takes xcb_timestamp_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin 48f08bca83 Client::embedClient() takes an xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin edefd5f3d2 Port Client::sendClientMessage to XCB 2013-05-28 11:55:39 +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 7cf461b154 Client::readIcons accepts xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin 1b7d2e5ca4 Client::restackWindow() accepts xcb_(window|timestamp)_t as argument
At the same time X define usage is changed to XCB enums.
2013-05-28 11:55:39 +02:00
Martin Gräßlin 2f718bd4fb Client::manager() takes an xcb_window_t as argument 2013-05-28 11:55:39 +02:00
Martin Gräßlin a616d1fe57 Client::decorationId() returns an xcb_window_t 2013-05-28 11:55:39 +02:00
Martin Gräßlin 5dae0cb010 Change Client::window_group to xcb_window_t
At the same time adjust name to m_camelCase to follow naming scheme.
2013-05-28 11:55:38 +02:00
Martin Gräßlin 5afe5f810e Port Client::transient_for handling to XCB
The type of the transient_for related variables are changed to
xcb_window_t. They cannot be Xcb::Window as we don't take ownership over
the transient for window.

Variables are renamed to m_camelCase to follow naming scheme.

A wrapper for retrieving the TransientFor hint is added to the Xcb
Wrappers.
2013-05-28 11:55:38 +02:00
Martin Gräßlin aa55cf98ae Port Client's move resize grab window to XCB
Using Xcb::Window to wrap this helper window and port all the used XLib
calls to XCB.

Also renaming the variable to m_ and camel case to follow general naming
scheme.
2013-05-28 11:55:38 +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 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 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 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