Porting the NETWM classes to xcb

2012-03-25 Thread Fredrik Höglund
Hi,

I've pushed a branch to my kdelibs clone which ports all the Xlib code in
the NETWM classes to xcb.  The only exception is the event handling code;
after it's been ported, the code will no longer work with Qt 4.

This is an important step toward getting kdelibs to build and work with Qt 5.

The branch is based on KDE/4.8 since it is necessary to test these changes
with plasma and kwin.  The branch merges reasonably cleanly into the
frameworks branch however.

These changes should improve performance since all properties are now
fetched in a single roundtrip to the X server.  You will also notice that I've
found and fixed several bugs along the way.

The diffstat may look daunting, but the individual commits are small, and
in most cases it's a matter of replacing an Xlib call with a call to the
equivalent xcb function.

The branch is available at:
git://anongit.kde.org/clones/kdelibs/fredrik/kdelibs.git netwm-xcb

Please review.

Fredrik Höglund (32):
  cmake: Add FindXCB.cmake and FindX11XCB.cmake
  kdeui: Link to libxcb and libX11-xcb
  kdeui: Store a pointer to the xcb connection in NETRootInfoPrivate
  kdeui: Store a pointer to the xcb connection in NETWinInfoPrivate
  kdeui: Port create_netwm_atoms() to xcb
  kdeui: Port the first NETRootInfo functions to xcb
  kdeui: Add a helper function in netwm.cpp for sending client messages
  kdeui: Port two more NETRootInfo functions to xcb
  kdeui: Port NETRootInfo::setDesktopName() to xcb
  kdeui: Port NETRootInfo::setDesktopGeometry() to xcb
  kdeui: Port NETRootInfo::setDesktopViewport() to xcb
  kdeui: Port NETRootInfo::setSupported() to xcb
  kdeui: Port NETRootInfo::setActiveWindow() to xcb
  kdeui: Port NETRootInfo::setWorkArea() to xcb
  kdeui: Port NETRootInfo::setVirtualRoots() to xcb
  kdeui: Port NETRootInfo::setDesktopLayout() to xcb
  kdeui: Port NETRootInfo::setShowingDesktop() to xcb
  kdeui: Port more NETRootInfo functions to xcb
  kdeui: Port NETRootInfo::sendPing() to xcb
  kdeui: Port NETRootInfo::takeActivity() to xcb
  kdeui: Port NETRootInfo::update() to xcb
  kdeui: Port NETWinInfo::setIconInternal() to xcb
  kdeui: Port four more NETWinInfo functions to xcb
  kdeui: Port NETWinInfo::setState() to xcb
  kdeui: Port NETWinInfo::setWindowType() to xcb
  kdeui: Port more NETWinInfo functions to xcb
  kdeui: Port NETWinInfo::setDesktop() to xcb
  kdeui: Port more NETWinInfo functions to xcb
  kdeui: Port NETWinInfo::setAllowedActions() to xcb
  kdeui: Port more NETWinInfo functions to xcb
  kdeui: Port NETWinInfo::update() to xcb
  kdeui: Port NETWinInfo::setBlockingCompositing() to xcb

 CMakeLists.txt   |3 +
 cmake/modules/FindX11XCB.cmake   |   31 +
 cmake/modules/FindXCB.cmake  |  150 ++
 kdeui/CMakeLists.txt |9 +-
 kdeui/windowmanagement/netwm.cpp | 3457 ++
 kdeui/windowmanagement/netwm.h   |4 +
 kdeui/windowmanagement/netwm_p.h |2 +
 7 files changed, 1828 insertions(+), 1828 deletions(-)

Fredrik

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Porting the NETWM classes to xcb

2012-03-25 Thread Christoph Feck
On Sunday 25 March 2012 19:49:29 Fredrik Höglund wrote:
 I've pushed a branch to my kdelibs clone which ports all the Xlib
 code in the NETWM classes to xcb. [...]

Nice, thanks :)

 The branch is available at:
 git://anongit.kde.org/clones/kdelibs/fredrik/kdelibs.git netwm-xcb
 [...]
 kdeui/windowmanagement/netwm.h   |4 +

Is it really required to expose xcb headers to applications, that wish 
to use the netwm header file? If not, please move to netwm_p.h file.

Christoph Feck (kdepepo)
KDE Quality Team
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Porting the NETWM classes to xcb

2012-03-25 Thread Fredrik Höglund
On Sunday 25 March 2012, Christoph Feck wrote:
 Is it really required to expose xcb headers to applications, that wish 
 to use the netwm header file? If not, please move to netwm_p.h file.

The idea is to eventually replace the Xlib types used in the parameters
to the constructors and methods in these classes with their equivalent
xcb types, and then stop including the Xlib headers.  Unlike the Xlib
headers, the xcb headers don't pollute the global namespace.

But you have a point in that nothing in the public headers depends
on the xcb headers yet, so at the moment there's no need to include
them there.

Fredrik

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel