We are the 1 % Porting KWin to Qt 5 Martin Gräßlin Bilbao Akademy

Similar documents
KWin went XCB. Blue Systems. October X.Org Developer s Conference

QtWayland. Creating Window Compositors with the QtWayland module

Why you should be excited about Qt 5

Guile-GNOME: Clutter-GLX

X11, X12, What next. And its companion: the ROOT GUI

Welcome to Wayland. Martin Gra ßlin BlueSystems Akademy 2015

Vulkan: Architecture positive How Vulkan maps to PowerVR GPUs Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics.

UI, Graphics & EFL. Carsten Haitzler Principal Engineer Samsung Electronics Korea Founder/Leader Enlightenment / EFL

The Linux graphics stack, Optimus and the Nouveau driver

Designing Interactive Systems II

The Wayland Display Server

Swapchains Unchained!

GUI Basics and Windowing Systems

HTML5 Evolution and Development. Matt Spencer UI & Browser Marketing Manager

Merits of QT for developing Imaging Applications UI

Qt Essentials - Graphics View Module

Creating outstanding digital cockpits with Qt Automotive Suite

EFL on Wayland. Rafael Antognolli October, 22th

The following article is about how to develop a high quality plugin.

SERIOUS ABOUT SOFTWARE. Qt Core features. Timo Strömmer, May 26,

Bringing Vulkan to VR. Cass Everitt, Oculus

Low Level X Window Programming

Volume Shadows Tutorial Nuclear / the Lab

Lecture 13: OpenGL Shading Language (GLSL)

What s New (and better) in Qt

Task Switcher. Martin Gräßlin

ADF Mobile Code Corner

Qt in Education. The Graphics View Canvas

Adding VST Support to Linux Audio Applications

GUI Basics and Windowing Systems. Using X Windows as a case study

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09

Leow Wee Kheng CS3249 User Interface Development. Windowing Systems CS3249

GTK+ 4 Status Update. Matthias Clasen

Glamor Status Report. Keith Packard Open Source Technology Center Intel

Can t Believe It s Linux. a totally different and hypothetical linux distribution

CS427 Multicore Architecture and Parallel Computing

LibreOffice's Android port By Miklos Vajna. Software Engineer at Collabora Productivity

Advances in Qt 3D. Kévin Ottens, Software Craftsman at KDAB

Building X 2D rendering acceleration with OpenGL. Eric Anholt Intel Open Source Technology Center

Glass V4, More Info For Your Solution

Reboot: Tizen Widget Framework. Hyun Ho, Kang Engineer Samsung Electronics. Copyright 2017 Samsung. All Rights Reserved.

Presentation to the Linux Supporters Group Adelaide. on Wednesday 6/5/2009 by Hayden Tremethick.

The Past, Present, and Future of SWT

Experiences Developing a Wayland-Based Tizen IVI HMI. Ossama Othman

GUI Basics and Windowing Systems. Using X Windows as a case study

file:///home/qt/dev/private/gramakri/presos/final%20logo%20files/tt_devdays07_finallogo.tif Qt Styles and Style Sheets Girish Ramakrishnan

Understanding Undefined Behavior

X only supports one mouse and one keyboard.

Metal for OpenGL Developers

EFL at ELC 2016 A toolkit for developping efficient and attractive Uis on embedded devices

From Separated ECUs to a Display Cluster April 18, 2018

ArcGIS Enterprise: Sharing Imagery. Zikang Zhou Imagery and Raster team

ArcGIS Runtime: Building Cross-Platform Apps. Rex Hansen Mark Baird Michael Tims Morten Nielsen

OPENCL TM APPLICATION ANALYSIS AND OPTIMIZATION MADE EASY WITH AMD APP PROFILER AND KERNELANALYZER

QGIS Application - Bug report #83 Strange polygon fill rendering

Dynamic Event Handling

Exercises Lecture 6 The Graphics View Canvas

Point based Rendering

Vitesse (Stand alone)

EFL. Enlightenment Foundation Libraries Architecture & Usage

Themes, shells and other animals

NVIDIA nfinitefx Engine: Programmable Pixel Shaders

SQLAlchemy-ORM-tree Documentation

Direct Rendering of Trimmed NURBS Surfaces

Review. Designing Interactive Systems II. Review. Base Window System. Apps UITK BWS GEL. 4-Layer Model Graphics and Event Library BWS GEL

Software Development & Education Center ANDROID. Application Development

NSIGHT ECLIPSE EDITION

X.org security. Recap, vulnerabilities, attacks and discussions on the graphic stack s security. Martin Peres & Timothée Ravier

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

i.mx 6 Yocto Project Patch Release Notes

Getting Started with Java Using Alice. 1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.

EXPLICIT SYNCHRONIZATION

Bringing X.org's GLX Support Into the Modern Age

Index. A Aim of book, 3 Approach options taken here, 1 toolkits, 1 Approaches to options selection, 56

ROOT on ios and RootBrowser app

Defect Detection at Microsoft Where the Rubber Meets the Road

JavaFX.Next. Kevin Rushforth Oracle Johan Vos Gluon October Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Implementing Perl 6 Jonathan Worthington Dutch Perl Workshop 2008

Computer Fundamentals: Operating Systems, Concurrency. Dr Robert Harle

Semantic Web in a Constrained Environment

Designing Interactive Systems II

Review. Designing Interactive Systems II. Introduction. Web 2.0 in keywords GWT Cappuccino HTML5. Cross platform GUI Toolkit

SYMMETRY v.1 (square)

Wayland IVI Extension

JavaScript Specialist v2.0 Exam 1D0-735

Experiences Developing a Wayland Based IVI HMI. Ossama Othman 28 May 2013

Project Thesis. Extending the Window Manager for Novel Interaction Techniques. Alexander Lang LMU Media Informatics Group

QGIS Application - Bug report #5475 Problem to insert splitted geometries in postgis

Gerald Carter Samba Team/HP

Xcode and Swift CS 4720 Mobile Application Development

Microsoft Excel is a spreadsheet tool capable of performing calculations, analyzing data and integrating information from different programs.

lecture 21 Input / Output (I/O) 3 - system bus and memory (lectures revisited) - system bus and interrupts - exceptions (lecture 12 revisited)

NSIGHT ECLIPSE EDITION

Interface evolution via public defender methods

QCon - Mobile Maps HTML5 Team Andrea

Understanding Performance in Large-scale Framework-based Systems

Dave Shreiner, ARM March 2009

202 Comics and Graphic Novels for Learning Cisco Success Story

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

User Guide. GLExpert NVIDIA Performance Toolkit

Transcription:

We are the 1 % Porting KWin to Qt 5 Martin Gräßlin 2013-07-13 Bilbao Akademy Be Free. KDE

About me Martin Gräßlin mgraesslin@kde.org http://blog.martin-graesslin.com KWin Maintainer Focus on Porting to Qt 5 and Wayland 2/34 Be Free. KDE

Disclaimer I think all changes in the Qt API presented in this presentation are an improvement! Using the abstraction over X11 in previous versions of KWin was the correct decision by the developers back then! 3/34 Be Free. KDE

And there be cake Compatible with Qt 4 99% Source compatible (Qt 5 Roadmap, Keynote at Qt Developer Days 2012 by Lars Knoll, slide 19) 4/34 Be Free. KDE

5/34 Be Free. KDE

You filter XEvents? Note: The native events that can be filtered this way depend on the QPA backend chosen at runtime. On X11, XEvents are replaced with xcb_generic_event_t due to the switch to XCB, which requires porting the application code to XCB as well. (QtDoc 5.0: C++ API changes - https://qt-project.org/doc/qt-5.0/qtdoc/sourcebreaks.html) 6/34 Be Free. KDE

QPA Platform ports got removed. 7/34 Be Free. KDE

Example: QPixmap::handle() Returns the pixmap's handle to the device context. Note that, since QPixmap make use of implicit data sharing, the detach() function must be called explicitly to ensure that only this pixmap's data is modified if the pixmap data is shared. Warning: This function is X11 specific; using it is nonportable. Warning: Since 4.8, pixmaps do not have an X11 handle unless created with fromx11pixmap(), or if the native graphics system is explicitly enabled. 8/34 Be Free. KDE

...and in Qt 5 QPlatformPixmap* handle() const; No longer listed in documentation Still referenced in the documentation Not mentioned in C++ API changes Not deprecated in Qt 4 9/34 Be Free. KDE

X11 specific We have been warned! 10/34 Be Free. KDE

For normal Developers 11/34 Be Free. KDE

For KWin Developers 12/34 Be Free. KDE

How to find the Problems? Not documented Not deprecated Compiling against Qt 5 not an option to find the issues 13/34 Be Free. KDE

Educated Guesses Search for handle() Search for fromx11() tox11() Search for XEvent http://community.kde.org/kwin/qt5 14/34 Be Free. KDE

Example for Abstraction supportwindow = new QWidget(NULL, Qt::X11BypassWindowManagerHint); XLowerWindow(display(), supportwindow->winid()); rootinfo = new RootInfo(this, display(), supportwindow->winid(), "KWin", protocols, 5, info.screen()); supportwindow is not used as a QWidget only used as an abstraction over XWindow assumes that a QWidget is an XWindow (hello Wayland!) 15/34 Be Free. KDE

How that looks in 4.11 Creates a low level xcb_window_t supportwindow no longer hold by KWin, but only in RootInfo Gotchas: Roundtrip to X-Server needed before creating the RootInfo Size of supportwindow needs to be valid 16/34 Be Free. KDE

QCursor - Usage in KWin QCursor::pos() QCursor::setPos(const QPoint &pos) QCursor::handle() 17/34 Be Free. KDE

QCursor::pos() Performs X roundtrip each time Also in Qt 5 KWin has optimized replacement In Wayland KWin controls cursor pos 18/34 Be Free. KDE

QCursor::setPos(...) XWarpPointer warping not (yet) possible in Wayland 19/34 Be Free. KDE

QCursor::handle() QCursor references an xcb_cursor_t Allows low level setting of cursor on an X Window (xcb_change_window_attributes) Who needs that? 20/34 Be Free. KDE

QCursor solution KWin::Cursor replaces QCursor Uses our optimized ::pos() version Provides mapping from Qt::CursorShape to XCursor Additional features like mouse polling 21/34 Be Free. KDE

The QPixmap story KWin composites X Pixmaps QPixmap wraps an X Pixmap QPainter is nicer API to render to XPixmaps than XRender 22/34 Be Free. KDE

QPixmap and raster Qt 4.5 (?) introduced graphics system raster QPixmap does not reference an XPixmap handle() returns 0 All assumptions break Solution: hard enforce native 23/34 Be Free. KDE

The QPixmap story native (XRender) sucks 24/34 Be Free. KDE

The QPixmap story QPixmap::fill(Qt::transparent) expensive with many drivers 25/34 Be Free. KDE

The QPixmap story Texture from Pixmap sucks 26/34 Be Free. KDE

The QPixmap story The Wonder Patch Use raster for OpenGL compositing Use QPixmap::fromX11Pixmap() if we need an XPixmap XRender forced into continue to use native 27/34 Be Free. KDE

The QPixmap story XRender compositing sucks with all modern parts of KWin 28/34 Be Free. KDE

The QPixmap story For Qt 5 two possible solutions: Drop XRender Improve XRender on Raster XRender compositor mostly rewritten in 4.11 Supports raster in window decorations No more fromx11pixmap But still used on native 29/34 Be Free. KDE

The hidden gems QRegion references an XRegion, used for window shapes QSessionManager not implemented for X11 in Qt 5 30/34 Be Free. KDE

The XEvent handler A window manager needs to process XEvents KWin implements QApplication::x11EventFilter(XEvent* e) Event filter is heart of KWin 1500 lines of huge switch statements Parts in kdelibs NETWinInfo NETRootInfo 31/34 Be Free. KDE

Obstacles for Porting Switching to XCB not possible in Qt 4 Not all features used from XLib are available in XCB Unit testing not possible 32/34 Be Free. KDE

Status of Porting Done QPixmap QCursor QRegion It compiles TODO Session Management Event filter But doesn't run 33/34 Be Free. KDE

Questions???? Be Free. KDE