<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jan Arne Petersen&#039;s Blog</title>
	<atom:link href="http://blog.jpetersen.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jpetersen.org</link>
	<description></description>
	<lastBuildDate>Thu, 10 Jan 2013 11:29:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Maliit running under wayland</title>
		<link>http://blog.jpetersen.org/2013/01/10/maliit-running-under-wayland/</link>
		<comments>http://blog.jpetersen.org/2013/01/10/maliit-running-under-wayland/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 11:29:25 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Openismus]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Wayland]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=139</guid>
		<description><![CDATA[We at Openismus combined our experiences in the Maliit input method framework and Wayland input methods and added support for Wayland input methods to Maliit. This allows using Maliit as a virtual keyboard under Weston/Wayland beside the demo weston-keyboard. To try it out use maliit-framework from master and Weston from our github repository and compile [...]]]></description>
				<content:encoded><![CDATA[<p>We at <a href="http://www.openismus.com">Openismus</a> combined our experiences in the <a href="https://wiki.maliit.org/Main_Page">Maliit input method framework</a> and <a href="http://wayland.freedesktop.org/">Wayland</a> <a href="http://blog.jpetersen.org/2012/09/18/text-input-method-support-in-wayland-update/">input methods</a> and added support for Wayland input methods to Maliit. This allows using Maliit as a virtual keyboard under Weston/Wayland beside the demo weston-keyboard. To try it out use maliit-framework from <a href="https://gitorious.org/maliit/maliit-framework">master</a> and Weston from our <a href="https://github.com/openismus/weston">github repository</a> and compile it with Qt 5 and <code>qmake CONFIG+=wayland</code>, maliit-plugins (from <a href="https://gitorious.org/maliit/maliit-plugins">master</a>) needs to be build with <code>qmake CONFIG+=disable-nemo-keyboard</code>.</p>
<p><video width="512" height="336" poster="http://jpetersen.org/videos/maliit-wayland.png" controls="controls"><source src="http://jpetersen.org/videos/maliit-wayland.webm" type='video/webm; codecs="vp8.0, vorbis"' /><source src="http://jpetersen.org/videos/maliit-wayland.mp4" type="video/mp4" /><a href="http://jpetersen.org/videos/maliit-wayland.mp4">screen cast</a></video></p>
<p>There is no <a href="http://trac.enlightenment.org/e/wiki/EFLOverview">EFL</a> support in Maliit (and no Maliit support in EFL) but since there is <a href="http://blog.jpetersen.org/2012/10/25/efl-integration-for-wayland-input-methods/">wayland input method support for EFL</a> available one can just use Maliit with EFL applications under Wayland. This shows one of the advantages of the Wayland input methods, that input method frameworks do not need explicit support for all kind of UI toolkits anymore.</p>
<p>The current plan is to get input method support into <a href="http://lists.freedesktop.org/archives/wayland-devel/2012-December/006767.html">Wayland 1.2</a>. Adding support for Wayland input method to Maliit allowed us to discover some <a href="https://gitorious.org/maliit/maliit-framework/blobs/master/connection/README.weston">missing features</a> which we will work on next together with some more <a href="http://lists.freedesktop.org/archives/wayland-devel/2012-October/005645.html">improvement suggestions</a> to get the input methods really ready for Wayland 1.2.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2013/01/10/maliit-running-under-wayland/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://jpetersen.org/videos/maliit-wayland.webm" length="6046905" type="application/wordperfect" />
<enclosure url="http://jpetersen.org/videos/maliit-wayland.mp4" length="11903844" type="video/mp4" />
		</item>
		<item>
		<title>EFL integration for Wayland input methods</title>
		<link>http://blog.jpetersen.org/2012/10/25/efl-integration-for-wayland-input-methods/</link>
		<comments>http://blog.jpetersen.org/2012/10/25/efl-integration-for-wayland-input-methods/#comments</comments>
		<pubDate>Thu, 25 Oct 2012 18:15:56 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=133</guid>
		<description><![CDATA[3 days ago Wayland and Weston 1.0 were released. We at Openismus are working on input method support for Wayland (see here and here). To show the input methods working we have an editor and keyboard example client in Weston. But we also want to demo input methods in real world applications. As a start [...]]]></description>
				<content:encoded><![CDATA[<p>3 days ago <a href="http://wayland.freedesktop.org/">Wayland</a> and Weston 1.0 were <a href="http://lists.freedesktop.org/archives/wayland-devel/2012-October/005967.html">released</a>. We at <a href="http://www.openismus.com">Openismus</a> are working on input method support for Wayland (see <a href="http://blog.jpetersen.org/2012/06/20/text-input-method-support-in-wayland/">here</a> and <a href="http://blog.jpetersen.org/2012/09/18/text-input-method-support-in-wayland-update/">here</a>).</p>
<p>To show the input methods working we have an <a href="http://cgit.freedesktop.org/wayland/weston/tree/clients/editor.c">editor</a> and <a href="http://cgit.freedesktop.org/wayland/weston/tree/clients/keyboard.c">keyboard</a> example client in Weston. But we also want to demo input methods in real world applications. As a start we implemented an input method module for the <a href="http://trac.enlightenment.org/e/wiki/EFLOverview">EFL (Enlightenment Foundation Libraries)</a> toolkit.</p>
<p>The EFL input method module is available at <a href="https://github.com/openismus/ecore-imf-wayland">github</a>.</p>
<p><video width="512" height="320" poster="http://jpetersen.org/videos/wayland-input-methods-efl.png" controls="controls"><source src="http://jpetersen.org/videos/wayland-input-methods-efl.webm" type='video/webm; codecs="vp8.0, vorbis"' /><source src="http://jpetersen.org/videos/wayland-input-methods-efl.mp4" type="video/mp4" /><a href="http://jpetersen.org/videos/wayland-input-methods-efl.mp4">screen cast</a></video></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2012/10/25/efl-integration-for-wayland-input-methods/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://jpetersen.org/videos/wayland-input-methods-efl.webm" length="4647920" type="application/wordperfect" />
<enclosure url="http://jpetersen.org/videos/wayland-input-methods-efl.mp4" length="7669487" type="video/mp4" />
		</item>
		<item>
		<title>Text Input Method Support in Wayland ‒ Update</title>
		<link>http://blog.jpetersen.org/2012/09/18/text-input-method-support-in-wayland-update/</link>
		<comments>http://blog.jpetersen.org/2012/09/18/text-input-method-support-in-wayland-update/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 13:47:38 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=124</guid>
		<description><![CDATA[In my last post about Text Input Method Support in Wayland I wrote about a input methods technical demo which I created for Weston (the Wayland reference compositor). That work got merged into Weston and got improved allot since: The text_model and input_method interfaces got all the basic requests and events, which are required to [...]]]></description>
				<content:encoded><![CDATA[<p>In my last <a href="http://blog.jpetersen.org/2012/06/20/text-input-method-support-in-wayland" title="Text Input Method Support in Wayland">post about Text Input Method Support in Wayland</a> I wrote about a input methods technical demo which I created for <a href="http://wayland.freedesktop.org/">Weston</a> (the Wayland reference compositor). That work got merged into Weston and got improved allot since: The <a href="http://cgit.freedesktop.org/wayland/weston/tree/protocol/text.xml">text_model</a> and <a href="http://cgit.freedesktop.org/wayland/weston/tree/protocol/input-method.xml">input_method</a> interfaces got all the basic requests and events, which are required to get a simple virtual keyboard working. Focus handling to track focus via wl_seat was implemented. The example keyboard and editor clients got also improved to better showcase the available features. There is a screencast for demo:</p>
<p><video width="512" height="320" poster="http://jpetersen.org/videos/input-methods2.png" controls="controls"><source src="http://jpetersen.org/videos/input-methods2.webm" type='video/webm; codecs="vp8.0, vorbis"' /><a href="http://jpetersen.org/videos/wayland-ims-prototype.mp4">screen cast</a></video></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2012/09/18/text-input-method-support-in-wayland-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://jpetersen.org/videos/input-methods2.webm" length="3532255" type="application/wordperfect" />
<enclosure url="http://jpetersen.org/videos/wayland-ims-prototype.mp4" length="349490" type="video/mp4" />
		</item>
		<item>
		<title>Text Input Method Support in Wayland</title>
		<link>http://blog.jpetersen.org/2012/06/20/text-input-method-support-in-wayland/</link>
		<comments>http://blog.jpetersen.org/2012/06/20/text-input-method-support-in-wayland/#comments</comments>
		<pubDate>Wed, 20 Jun 2012 15:31:26 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[GTK+]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Openismus]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Wayland]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=108</guid>
		<description><![CDATA[Over the last years, we at Openismus have worked on input methods for mobile devices (see for example the Maliit input method framework). During that work we noticed that there are several problems caused by the toolkit-level interface between the input method system and the applications (beside having to implement interfaces for every toolkit, like [...]]]></description>
				<content:encoded><![CDATA[<p>Over the last years, we at <a href="http://www.openismus.com/">Openismus</a> have worked on input methods for mobile devices (see for example <a href="http://www.maliit.org/">the Maliit input method framework</a>). During that work we noticed that there are several problems caused by the toolkit-level interface between the input method system and the applications (beside having to implement interfaces for every toolkit, like <a href="http://developer.gnome.org/gtk3/stable/GtkIMContext.html">GtkIMContext</a> and <a href="http://qt-project.org/doc/qt-4.8/qinputcontext.html">QInputContext</a>). One of this problems is synchronizing events happening to the focus window and the virtual keyboard window. Therefore good platform integration of input methods such as virtual keyboards requires additional window management policies, as the window manager has to gain knowledge about input methods. The compositing window manager on Nokia&#8217;s N9 serves as an example for the amount of required integration. It also taught us about what can go wrong and that Xorg induced latency is a hard problem to solve (see <a href="http://blog.jpetersen.org/2012/01/25/compositing-in-maliit/">Compositing in Maliit</a>). There is also the <a href="http://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html">XIM</a> X extension which integrated input methods on the X level, but its limitations and complexity puts it as a second choice compared to the toolkit interfaces mentioned above (especially since it does not manage to solve there problems).</p>
<p>The move from Xorg to <a href="http://wayland.freedesktop.org">Wayland</a> offers the possibility to move the input method system from the toolkit level down to the display server, as discussed in our <a href="https://wiki.maliit.org/Wayland_Input_Method_System_Proposal">Wayland Input Method System Proposal</a>. Last week, Openismus let me work on a small <a href="https://gitorious.org/openismus-playground/weston-text-protocol">prototype technical demo</a> for Weston (the Wayland reference compositor) which implements some of the ideas in that proposal. This should be useful for testing the idea of having the input method system integrated in Wayland.</p>
<h3>New Wayland interfaces</h3>
<div id="attachment_112" class="wp-caption alignleft" style="width: 310px"><a href="http://www.jpetersen.org/blog/wp-content/uploads/2012/06/3-process-solution-with-text-and-input-method-protocol.png"><img class="size-medium wp-image-112" title="Standalone input method system with text and input method protocols" src="http://www.jpetersen.org/blog/wp-content/uploads/2012/06/3-process-solution-with-text-and-input-method-protocol-300x197.png" alt="" width="300" height="197" /></a><p class="wp-caption-text">Standalone input method system with text and input method protocols</p></div>
<p>The prototype defines three interfaces. The first is the <a href="https://gitorious.org/openismus-playground/weston-text-protocol/blobs/master/protocol/text.xml">text_model</a>, which is used to communicate from the application/toolkit side with the input method system. It provides the input method system with all required information about the active text, such as selection, surrounding text and cursor index. The application receives events over this interface, such as preedit and commit, from the input method system. For the prototype, I implemented an <a href="https://gitorious.org/openismus-playground/weston-text-protocol/blobs/master/clients/editor.c">example editor client</a>, which uses the text model to send the surrounding text to the input method system and receives commit events.</p>
<p>The second interface is the <a href="https://gitorious.org/openismus-playground/weston-text-protocol/blobs/master/protocol/text.xml">input_method interface</a> which is used to communicate between the input method and Wayland. For the prototype we use a really simple <a href="https://gitorious.org/openismus-playground/weston-text-protocol/blobs/master/clients/keyboard.c">keyboard client </a>which just sends commit events when pressing one of the keys.</p>
<p>The third interface is used to register the keyboard surface as an input panel on the shell. I added the input_panel interface to the <a href="https://gitorious.org/openismus-playground/weston-text-protocol/blobs/master/protocol/desktop-shell.xml">desktop shell protocol</a>. This allows the shell to stack the keyboard surface into the right layer (for the prototype I used the panel layer). Additionally, the prototype adds support to the shell to show the keyboard only when a text model is active.</p>
<h3>Demos</h3>
<p><video width="512" height="320" poster="http://jpetersen.org/videos/wayland-ims-prototype.png" controls="controls"><source src="http://jpetersen.org/videos/wayland-ims-prototype.webm" type='video/webm; codecs="vp8.0, vorbis"' /><source src="http://jpetersen.org/videos/wayland-ims-prototype.mp4" type="video/mp4" /><a href="http://jpetersen.org/videos/wayland-ims-prototype.mp4">screen cast</a></video><br />
The <a href="http://jpetersen.org/videos/wayland-ims-prototype.mp4">screen cast</a> shows the prototype in action, but for those with a working <a href="http://wayland.freedesktop.org/building.html">Wayland installation</a>, it should also be possible to just compile and run the <a href="https://gitorious.org/openismus-playground/weston-text-protocol">prototype</a>.</p>
<h3>Outlook</h3>
<p>The prototype is the outcome of less than a week of coding, but it already uses some of the concepts we learned while working on Maliit. It should serve as a baseline for further Wayland input method system integration, even if many basic items are missing. For instance, there is no integration with hardware keyboard events, nor keyboard focus (which is handled by wl_seat in Wayland). Nevertheless I will polish my patches a bit and send them to the Wayland mailing list for integration into Weston, so that they can be used for more work on input methods in Wayland/Weston. My colleague Michael <a href="http://akademy2012.kde.org/program/sessions/wayland-choosing-better-input-method-architecture">will present this work</a> at aKademy in two weeks, which will be a good opportunity to discuss the possibilities of such an input method system in Wayland.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2012/06/20/text-input-method-support-in-wayland/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://jpetersen.org/videos/wayland-ims-prototype.mp4" length="349490" type="video/mp4" />
		</item>
		<item>
		<title>Compositing in Maliit</title>
		<link>http://blog.jpetersen.org/2012/01/25/compositing-in-maliit/</link>
		<comments>http://blog.jpetersen.org/2012/01/25/compositing-in-maliit/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 14:07:00 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Meego]]></category>
		<category><![CDATA[Openismus]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=102</guid>
		<description><![CDATA[Introduction The development for Maliit, a cross-platform text input method framework for mobile devices, until 0.8 was mainly based on requirements for MeeGo Harmattan, the operating system on the Nokia N9. Harmattan applications are fullscreen. Animation of orientation changes is, together with other animations, done by the application. This is in contrast to Maemo Fremantle [...]]]></description>
				<content:encoded><![CDATA[<h3>Introduction</h3>
<p>The development for <a href="http://maliit.org">Maliit</a>, a cross-platform text input method framework for mobile devices, until 0.8 was mainly based on requirements for <a href="http://en.wikipedia.org/wiki/MeeGo#MeeGo.2FHarmattan">MeeGo Harmattan</a>, the operating system on the <a href="http://swipe.nokia.com/">Nokia N9</a>. Harmattan applications are fullscreen. Animation of orientation changes is, together with other animations, done by the application. This is in contrast to <a href="http://en.wikipedia.org/wiki/Maemo#Maemo_5_.28Fremantle.29">Maemo Fremantle</a> on the <a href="http://en.wikipedia.org/wiki/Nokia_N900">Nokia N900</a>, were such animations were done by the X window manager.<br />
When the virtual keyboard is up, the application remains fully interactive. Instead of using a proxy text entry, the text input goes directly to the application&#8217;s focused text entry. Showing the virtual keyboard should not change the layout, nor can it affect the application&#8217;s stability. The virtual keyboard runs in a separate process (maliit-server). But it requires animations showing, hiding and switching between different language layouts. In addition it should be possible to display overlays for word candidates or extended keys.<br />
To satisfy these requirements the virtual keyboard window is shown in fullscreen mode. The visible parts of the virtual keyboard cover the bottom area of the application and screen, whereas the remaining area of the toplevel window is seemingly translucent. This keeps most of the application visible, including the focused text entry, which will render any text input immediately. It is also possible to pan the application&#8217;s page contents and to switch focus to another text entry, or remove focus altogether.</p>
<h3>Shaped input region</h3>
<p>To pass input events through to the application we use the <a href="http://www.x.org/releases/X11R7.6/doc/libXext/shapelib.html">shape extension</a> of the X server and <a href="http://cgit.freedesktop.org/xorg/proto/fixesproto/tree/fixesproto.txt">XFixesSetWindowShapeRegion</a> to set the input shape of the <a href="https://gitorious.org/maliit/maliit-framework/blobs/master/src/mpassthruwindow.h">MPassThruWindow</a> to the region which the virtual keyboard and overlays really occupy. The X server will deliver events inside this region to the input method, and the rest to the application window.</p>
<pre lang="c++">void MPassThruWindow::updateInputRegion()
{
	XRectangle * const xrects = convertQRectanglesToXRectangles(region.rects());
	const XserverRegion shapeRegion =
		XFixesCreateRegion(display, rects, region.rects().size());
    	XFixesSetWindowShapeRegion(display, winid, ShapeInput, 0, 0, shapeRegion); 	XFixesDestroyRegion(display, shapeRegion);
	delete[] xrects;
}</pre>
<h3>Compositing Window Manager</h3>
<div id="attachment_84" class="wp-caption alignleft" style="width: 154px"><a href="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/translucent.png"><img class="size-medium wp-image-84" title="RGBA window with translucent background" src="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/translucent-144x300.png" alt="" width="144" height="300" /></a><p class="wp-caption-text">RGBA window with translucent background</p></div>
<p>When the window manager supports compositing, it is possible to use 32 bit translucent RGBA windows for the overlay. <a href="https://meego.gitorious.org/meegotouch/meegotouch-compositor">Mcompositor</a>, Harmattan&#8217;s window manager, supports this feature. That is why we turned the background of the top level virtual keyboard window translucent. In Qt this can be done like:</p>
<pre lang="c++">MPassThruWindow::MPassthruWindow()
{
	setAttribute(Qt::WA_TranslucentBackground);
}</pre>
<p>Since compositing window managers are widely available for Linux desktops and the performance is acceptable it has been the default for Maliit 0.8.</p>
<h3>Direct rendering</h3>
<div id="attachment_85" class="wp-caption alignleft" style="width: 266px"><a href="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/redirection.png"><img class="size-medium wp-image-85" title="Compositing Window Manager" src="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/redirection-256x300.png" alt="" width="256" height="300" /></a><p class="wp-caption-text">Compositing Window Manager</p></div>
<p>When the active application window is fullscreen and the application features a non-translucent background (which is the case on Harmattan), then the redirection of the active window into an off-screen window and additional compositing is unnecessary. Under circumstances, this redirection cuts the frame rate in half, which was unacceptable for animations and scrolling. For that <a href="https://meego.gitorious.org/meegotouch/meegotouch-compositor/blobs/master/src/mcompositemanager.h#line174">mcompositor supports direct rendering </a>of the active window into the frame buffer.<br />
Since in this mode the keyboard window is transparent mcompositor cannot use the direct rendering optimization. Additional the context switches between the three processes, application, keyboard and compositor results in increased latency for text input, which affects the user experience. To reduce latency we wanted to further optimize performance for Harmattan and the N9 by using direct rendering with a 16 bit window for the keyboard.</p>
<h3>Compositing using shaped output region</h3>
<p>Our first approach used the same technique for the in- also for the output, with the help of XFixesSetWindowShapeRegion:</p>
<pre lang="c++">void MPassThruWindow::updateInputRegion()
{
	...
    	XFixesSetWindowShapeRegion(display, winid, ShapeBounding, 0, 0, shapeRegion);
	...
}</pre>
<p>This solution does not require a compositing window manager but made it difficult to use shadows and overlays. It also was not performing as well as expected, since there is no support for direct rendering of shaped window. A better solution had to be found.</p>
<h3>Compositing in Maliit</h3>
<div id="attachment_86" class="wp-caption alignleft" style="width: 185px"><a href="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/direct.png"><img class="size-medium wp-image-86" title="Compositing in Maliit" src="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/direct-175x300.png" alt="" width="175" height="300" /></a><p class="wp-caption-text">Compositing in Maliit</p></div>
<p>We were able to try another approach for using direct rendering. A 16bit RGB window together with the <a href="http://cgit.freedesktop.org/xorg/proto/compositeproto/tree/compositeproto.txt">composite</a> and <a href="http://cgit.freedesktop.org/xorg/proto/damageproto/plain/damageproto.txt">damage</a> X extensions is used to compose the content of the application window into the background of the virtual keyboard window. Instead of using the window manager for the compositing, Maliit handles the compositing itself.<br />
The application window is represented through <a href="https://gitorious.org/maliit/maliit-framework/blobs/master/src/mimremotewindow.h">MImRemoteWindow</a> in Maliit. XCompositeNameWindowPixmap is used to get a pixmap of the application&#8217;s window content:</p>
<pre lang="c++">void MImRemoteWindow::setupPixmap()
{
	xpixmap = XCompositeNameWindowPixmap(display, winId);
	pixmap = QPixmap::fromX11Pixmap(xpixmap, QPixmap::ExplicitlyShared);
}</pre>
<p>This pixmap is blitted into the background of a <a href="http://developer.qt.nokia.com/doc/qt-4.8/qgraphicsview.html">QGraphicsView</a>:</p>
<pre lang="c++">void GraphicsView::drawBackground(QPainter *painter, const QRectF &amp;rect)
{
        painter-&gt;drawPixmap(rect.toRect(), remoteWindow-&gt;pixmap(), rect.toRect());
}</pre>
<p>To get notified about updates in the application window the damage extension is used:</p>
<pre lang="c++">void MImRemoteWindow::setupDamage()
{
    damage = XDamageCreate(display, winId, XDamageReportNonEmpty); 

}</pre>
<p>On damage events there is a signal emitted, which is used to trigger a repaint.</p>
<pre lang="c++">void MImRemoteWindow::handleDamageEvent(XDamageNotifyEvent *e)
{
    XserverRegion parts = XFixesCreateRegion(display, 0, 0);
    XDamageSubtract(display, e-&gt;damage, None, parts); 

    QRegion region(convertXRegionToQRegion(parts)); 

    XFixesDestroyRegion(display, parts); 

    Q_EMIT contentUpdated(region);
}</pre>
<div id="attachment_83" class="wp-caption alignleft" style="width: 154px"><a href="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/compositing.png"><img class="size-medium wp-image-83" title="RGB window with application content composited into the background" src="http://www.jpetersen.org/blog/wp-content/uploads/2012/01/compositing-144x300.png" alt="" width="144" height="300" /></a><p class="wp-caption-text">RGB window with application content composited into the background</p></div>
<p>When handing over compositing from the the window manager to the input method process brief flicker can occur. To suppress it, mcompositor had to be patched to only map the virtual keyboard window after the application window has gotten redirected for compositing in Maliit. Additional <a href="http://developer.qt.nokia.com/doc/qt-4.8/qt.html#WidgetAttribute-enum">QWidget attributes</a> need to be set for all <a href="http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html">QWidgets</a> in the virtual keyboard:</p>
<pre lang="c++">MPassThruWindow::MPassthruWindow()
{
	setAttribute(Qt::WA_OpaquePaintEvent);
	setAttribute(Qt::WA_NoSystemBackground);
}</pre>
<p>In addition to improving the performance this approach also allowed to synchronize the rotation animation of the application and keyboard.<br />
This mode is used on Harmattan and the Nokia N9 and can be activated by starting maliit-server with the -use-self-composition flag.</p>
<h3>Plugins</h3>
<p>Since plugins up until Maliit 0.8 are using fullscreen sized children widgets of the MPassThruWindow, their sizing and positioning depends on the toplevel window being a fullscreen window.<br />
For compositing in Maliit to work, those widgets have to blit the application window content into their background. A QGraphicsView for example can use MAbstractInputMethodHost::background to paint the application window content as its background in QGraphicsView::drawBackground.</p>
<h3>Conclusion</h3>
<p>The fullscreen keyboard window approach was the proper choice for the Nokia N9 device. But on other devices, where orientation change animations are done by the compositor, or on a desktop system without a compositing window manager a non-fullscreen keyboard window could be a better choice. Unfortunately input method plugins based on Maliit 0.8 releases are tied to the fullscreen keyboard window concept and even need to take care for implementation details like the compositing in Maliit. The Maliit 0.9 series, which provide the basis for a first stable 1.0 release, should be used to find a better solution for plugins which allows different window modes and makes it easier for plugin developers by not burden them with any implementation details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2012/01/25/compositing-in-maliit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maliit and Qt 5</title>
		<link>http://blog.jpetersen.org/2011/12/07/maliit-and-qt5/</link>
		<comments>http://blog.jpetersen.org/2011/12/07/maliit-and-qt5/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 19:28:05 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Openismus]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=76</guid>
		<description><![CDATA[Qt 5 has a complete new interface for input methods. Instead of the old QInputContext (which is just a wrapper around the new system now) there is now QInputPanel and QPlatformInputContext (no documentation yet, see source), for the reasoning see QTBUG-20088 &#8211; Create proper input method abstraction and expose it through a public API in [...]]]></description>
				<content:encoded><![CDATA[<p>Qt 5 has a complete new interface for input methods. Instead of the old <a href="http://doc.qt.nokia.com/5.0-snapshot/qinputcontext.html">QInputContext</a> (which is just a wrapper around the new system now) there is now <a href="http://doc.qt.nokia.com/5.0-snapshot/qinputpanel.html">QInputPanel</a> and QPlatformInputContext (no documentation yet, see <a href="https://qt.gitorious.org/qt/qtbase/blobs/master/src/gui/kernel/qplatforminputcontext_qpa.h">source</a>), for the reasoning see <a href="https://bugreports.qt.nokia.com//browse/QTBUG-20088">QTBUG-20088 &#8211; Create proper input method abstraction and expose it through a public API in QTGui</a>.</p>
<p>Luckily there is already a simple platform input context for the <a href="http://www.maliit.org/">Maliit input method framework</a> in the Qt code base <a href="https://qt.gitorious.org/qt/qtbase/trees/master/src/plugins/platforminputcontexts/meego">available</a>. There are some smaller <a href="https://bugreports.qt.nokia.com/browse/QTBUG-22982">bugs</a> <a href="https://bugreports.qt.nokia.com/browse/QTBUG-22994">open</a>, but they should be easy to fix. So it should be already possible to use Maliit with Qt 5 applications.</p>
<p>Additionally we would of course like to compile Maliit itself against Qt 5 too. Based on the previous work <a href="http://blog.jpetersen.org/2011/09/19/maliit-running-under-wayland-with-qt-lighthouse/">eliminating the X requirement</a> in Maliit it was a quite easy task to compile it with Qt 5 and required just <a href="https://gitorious.org/maliit/maliit-framework/merge_requests/109">fixing some smaller bugs and updating some build system files</a>.</p>
<p>After that I tried to run Maliit with the <a href="http://xcb.freedesktop.org/">XCB</a> platform. This showed an ugly bug, the virtual keyboard stole the focus from the application. On Qt 4 we used the <em>WA_X11DoNotAcceptFocus</em> <a href="http://doc.qt.nokia.com/latest/qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a> which does not work for the XCB (and Xlib) platforms in Qt 5. I filed a <a href="https://bugreports.qt.nokia.com/browse/QTBUG-22981">bug</a> about this issue and created a <a href="http://codereview.qt-project.org/#change,10381">patch</a> (which is sadly only visible when one has a <a href="http://wiki.qt-project.org/Code_Reviews#Checklist_for_contributing">gerrit account registered</a>). With that patch applied to Qt 5 Maliit was basically working.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2011/12/07/maliit-and-qt5/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Maliit running under Wayland with Qt Lighthouse</title>
		<link>http://blog.jpetersen.org/2011/09/19/maliit-running-under-wayland-with-qt-lighthouse/</link>
		<comments>http://blog.jpetersen.org/2011/09/19/maliit-running-under-wayland-with-qt-lighthouse/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 19:53:39 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Meego]]></category>
		<category><![CDATA[Openismus]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Wayland]]></category>

		<guid isPermaLink="false">http://www.jpetersen.org/blog/?p=63</guid>
		<description><![CDATA[Currently Maliit depends heavily on X for core functionality (for example assigning the virtual keyboard to the application via transient for window hint) but also for some optional features like self compositing, which was implemented to dramatically improve the performance on Harmattan by doing the compositing inside Maliit itself instead of inside the X compositor. [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.jpetersen.org/blog/wp-content/uploads/2011/09/MaliitInWayland.png"><img class="alignleft size-medium wp-image-64" title="Maliit running under Wayland" src="http://www.jpetersen.org/blog/wp-content/uploads/2011/09/MaliitInWayland-300x197.png" alt="Maliit running under Wayland" width="300" height="197" /></a>Currently <a href="http://wiki.maliit.org">Maliit</a> depends heavily on X for core functionality (for example assigning the virtual keyboard to the application via transient for window hint) but also for some optional features like self compositing, which was implemented to dramatically improve the performance on Harmattan by doing the compositing inside Maliit itself instead of inside the X compositor.</p>
<p>Still <a href="http://wiki.maliit.org/Ideas/Supporting_Non_X11_Platforms">our target</a> is to support also non X platforms like <a href="http://wayland.freedesktop.org/">Wayland</a>, which is currently planned to be used in Meego in future (see <a href="http://wiki.meego.com/Wayland_in_MeeGo">Wayland in Meego 1.3</a>). As a first step in this direction <a href="https://gitorious.org/maliit/maliit-framework/merge_requests/54">we made X optional in Maliit</a>. Than as a second step <a href="https://gitorious.org/maliit/maliit-framework/merge_requests/56">we implemented basic support</a> for <a href="http://labs.qt.nokia.com/category/labs/lighthouse/">Qt 4.8 Lighthouse</a>. Qt Lighthouse provides support for different backends like for example Android, xcb and Wayland. Compiling Maliit with that Qt version allows it now to run Maliit on Wayland. Next step is to implement better support for Maliit in Wayland like a <a href="http://taschenorakel.de/michael/2011/06/18/input-methods-and-wayland-qt5/">window management policy</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2011/09/19/maliit-running-under-wayland-with-qt-lighthouse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Maliit packages for Fedora</title>
		<link>http://blog.jpetersen.org/2011/05/29/maliit-packages-for-fedora/</link>
		<comments>http://blog.jpetersen.org/2011/05/29/maliit-packages-for-fedora/#comments</comments>
		<pubDate>Sun, 29 May 2011 15:34:53 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Meego]]></category>
		<category><![CDATA[Openismus]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=60</guid>
		<description><![CDATA[I used the Open Build Service (OBS) to build Maliit (Meego Input Method) packages for Fedora 15. To install the packages: Download the .repo file and save it as /etc/yum.repos.d/maliit.repo. Install the packages meego-inputmethodkeyboard and meego-inputmethodbridges with the Add/Remove Software application (or with yum) To try it out, run as a user meego-im-uiserver GTK_IM_MODULE=meego-im gedit This [...]]]></description>
				<content:encoded><![CDATA[<p>I used the <a href="http://openbuildservice.org/">Open Build Service (OBS)</a> to build <a href="http://wiki.meego.com/Maliit">Maliit</a> (Meego Input Method) packages for <a href="http://fedoraproject.org/">Fedora 15</a>.</p>
<p>To install the packages:</p>
<ol>
<li> Download the <a rel="nofollow" href="http://download.opensuse.org/repositories/home:/janarnepetersen/Fedora_15/home:janarnepetersen.repo">.repo file</a> and save it as <em>/etc/yum.repos.d/maliit.repo</em>.</li>
<li>Install the packages <em>meego-inputmethodkeyboard</em> and  <em>meego-inputmethodbridges</em> with the <em>Add/Remove Software application</em> (or with yum)</li>
</ol>
<p><a href="http://www.jpetersen.org/blog/wp-content/uploads/2011/05/Screenshot11.png"><img class="alignleft size-medium wp-image-61" title="Maliit with gedit in GNOME 3" src="http://www.jpetersen.org/blog/wp-content/uploads/2011/05/Screenshot1-300x187.png" alt="" width="300" height="187" /></a><br />
To try it out, run as a user</p>
<ol>
<li><em>meego-im-uiserver</em></li>
<li><em>GTK_IM_MODULE=meego-im gedit</em></li>
</ol>
<p>This packages contains the vanilla versions of Maliit and the default theme (Meego). The custom GNOME 3 theme (see <a href="http://taschenorakel.de/michael/2011/04/10/customizing-meego-keyboard/">Customizing the MeeGo Keyboard</a>) as it was shown by <a href="http://www.jonnor.com/2011/04/introducing-maliit-on-screen-keyboard-in-gnome-3/">Jon Nordby on a tablet</a> needs to be still packaged.</p>
<p>For more information see the <a href="http://wiki.meego.com/Maliit">Maliit Wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2011/05/29/maliit-packages-for-fedora/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Maliit running in GNOME 3</title>
		<link>http://blog.jpetersen.org/2011/04/29/45/</link>
		<comments>http://blog.jpetersen.org/2011/04/29/45/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 21:45:45 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Maliit]]></category>
		<category><![CDATA[Meego]]></category>
		<category><![CDATA[Openismus]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=45</guid>
		<description><![CDATA[Jon Nordby shows the Maliit (Meego Input Methods) virtual keyboard on a WeTab tablet running Fedora 15:]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.jonnor.com/2011/04/introducing-maliit-on-screen-keyboard-in-gnome-3/">Jon Nordby</a> shows the <a href="http://wiki.meego.com/Maliit">Maliit</a> (Meego Input Methods) virtual keyboard on a WeTab tablet running Fedora 15:</p>
<p><iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/l_7f3Lxd4_I" frameborder="0"><br />
</iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2011/04/29/45/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mountain View CA</title>
		<link>http://blog.jpetersen.org/2010/07/24/mountain-view-ca/</link>
		<comments>http://blog.jpetersen.org/2010/07/24/mountain-view-ca/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 05:41:09 +0000</pubDate>
		<dc:creator>jpetersen</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Mountain View CA]]></category>
		<category><![CDATA[Openismus]]></category>

		<guid isPermaLink="false">http://blog.jpetersen.org/?p=27</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a title="El Camino Real and Santa Cruz Mountains by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4820439858/"><img src="http://farm5.static.flickr.com/4123/4820439858_dec26b252c.jpg" alt="El Camino Real and Santa Cruz Mountains" width="500" height="375" /></a></p>
<p><a title="Palm in front of an empty office building by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4823159656/"><img src="http://farm5.static.flickr.com/4080/4823159656_0ae740b6b7.jpg" alt="Palm in front of an empty office building" width="335" height="500" /></a></p>
<p><a title="Fountain by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4822256669/"><img src="http://farm5.static.flickr.com/4102/4822256669_435f021619.jpg" alt="Fountain" width="500" height="380" /></a></p>
<p><a title="Clarke's Charcoal Broiler (El Camino Real) by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4819830469/"><img src="http://farm5.static.flickr.com/4078/4819830469_368ca44c6e.jpg" alt="Clarke's Charcoal Broiler (El Camino Real)" width="500" height="375" /></a></p>
<p><a title="Castro Street by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4820420092/"><img src="http://farm5.static.flickr.com/4116/4820420092_2a511eb5ba.jpg" alt="Castro Street" width="375" height="500" /></a></p>
<p><a title="El Camino Real by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4819835921/"><img src="http://farm5.static.flickr.com/4117/4819835921_34ef7d9d4f.jpg" alt="El Camino Real" width="500" height="375" /></a></p>
<p><a title="Office by Jan Arne Petersen, on Flickr" href="http://www.flickr.com/photos/48894993@N00/4822870396/"><img src="http://farm5.static.flickr.com/4116/4822870396_9906d8ff58.jpg" alt="Office building" width="380" height="500" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jpetersen.org/2010/07/24/mountain-view-ca/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
