<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px"><div id="yui_3_16_0_ym19_1_1467290010420_36182"><span></span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212">Hello,</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr">I am back with my transparent pixels "click-through" and I really want to make weston redirect the touch inputs to a foreground surface in case the top one has transparent pixels.</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr">pq made me understand more on how I should use wl_region but this won't work for me(currently).</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr">Anyway I am not familiar with weston code but I know I it works so I did some "reading" on it and stopped in compositor.c/weston_compositor_pick_view... For me this looks like a good place to redirect inputs and I thought I can add weston_surface_copy_content call for one pixel, check it and send the focus to the surface I want.</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr">Since I still setting up my wayland "build" environment and can't compile/test I thought to get some thoughts from you.</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr">I don't want to achieve great rendering performance and I know that even copying 4 bytes from GPU is slow but I do this only when I get touch events and I need to stop rendering anyway(stop and render something else depending on what the user does with its fingers).</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212" dir="ltr"><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36716">diff --git a/libweston/compositor.c b/libweston/compositor.c</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36717">index 37d94ec..268595c 100644</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36718">--- a/libweston/compositor.c</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36719">+++ b/libweston/compositor.c</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36720">@@ -1702,6 +1702,20 @@ weston_compositor_pick_view(struct weston_compositor *compositor,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36721"> <span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36722"> </span> view_ix, view_iy, NULL))</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36723"> <span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36724"> </span>continue;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36725"> </div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36726">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36727"> </span>//alpha picking</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36728">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36729"> </span>unsigned char buffer[4];<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36730"> </span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36731">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36732"> </span>if(!weston_surface_copy_content(struct weston_surface *surface,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36733">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36734"> </span>(void)buffer, 4, view_ix, view_iy, 1, 1)) {</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36735">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36736"> </span>printf("ALPHA %x, B %x, G %x, R %x\n",buffer[0], buffer[1], buffer[2], buffer[3]);</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36737">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36738"> </span>//IGNORE this surface if the pixel has alpha 0(transparent)</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36739">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36740"> </span>if(0 == buffer[0])</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36741">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36742"> </span>continue;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36743">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36744"> </span>}</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36745">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36746"> </span>else</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36747">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36748"> </span>{</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36749">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36750"> </span>printf("Error reading pixels.\n");</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36751">+<span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36752"> </span>}</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36753">+</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36754"> <span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36755"> </span>*vx = view_x;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36756"> <span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36757"> </span>*vy = view_y;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36758"> <span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1467290010420_36759"> </span>return view;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36760"><br id="yui_3_16_0_ym19_1_1467290010420_36761"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36760"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36760">Thanks,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36760">Claudiu</div></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1467290010420_36212"><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1467290010420_36189" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10px;" id="yui_3_16_0_ym19_1_1467290010420_36188"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1467290010420_36187"> <div dir="ltr" id="yui_3_16_0_ym19_1_1467290010420_36186"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1467290010420_36185"> <hr size="1" id="yui_3_16_0_ym19_1_1467290010420_36328"> <b id="yui_3_16_0_ym19_1_1467290010420_36184"><span style="font-weight:bold;" id="yui_3_16_0_ym19_1_1467290010420_36183">From:</span></b> Pekka Paalanen <ppaalanen@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Claudiu Lupu <lupuu.claudiu@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Wayland Mailing List <wayland-devel@lists.freedesktop.org><br> <b id="yui_3_16_0_ym19_1_1467290010420_36193"><span style="font-weight: bold;" id="yui_3_16_0_ym19_1_1467290010420_36192">Sent:</span></b> Tuesday, June 21, 2016 4:47 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Surface autofocus<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1467290010420_36190"><br>On Tue, 21 Jun 2016 14:23:31 +0000 (UTC)<br clear="none">Claudiu Lupu <<a shape="rect" ymailto="mailto:lupuu.claudiu@yahoo.com" href="mailto:lupuu.claudiu@yahoo.com" id="yui_3_16_0_ym19_1_1467290010420_36191">lupuu.claudiu@yahoo.com</a>> wrote:<br clear="none"><br clear="none">> Hello,<br clear="none">> I got weston 1.11.90 installed on Ubuntu desktop. If I start a<br clear="none">> terminal window and weston-flower the focus is not being redirected<br clear="none">> to the terminal in case I click on a transparent zone from flower<br clear="none"><br clear="none">Hi,<br clear="none"><br clear="none">The transparent parts of the flower are not marked as "click-through"<br clear="none">by the demo, so this is expected.<br clear="none"><br clear="none">> demo.Another odd thing is that if I click on the terminal window, the<br clear="none">> terminal gets focus but the flower changes even if I don't click on<br clear="none">> the flower zone, looks like both surfaces receive mouse down.Same<br clear="none">> thing happens with the touch. This doesn't look like the behavior I<br clear="none">> was used to on older version of compositors.<br clear="none"><br clear="none">The flower does not change as a response to a click per se. The flower<br clear="none">changes every time the window is redrawn by the demo (this goes to show<br clear="none">how rarely the window needs redrawing). When window focus changes, a<br clear="none">message gets sent to both the old and new active windows for them to<br clear="none">redraw their decorations as active/inactive. Flower does not have such<br clear="none">decorations, but it redraws anyway.<br clear="none"><br clear="none">You can also see it by pressing Mod+Tab to switch between windows.<br clear="none"><br clear="none">There was a time when flower was redrawn practically never, but that<br clear="none">has since changed, with the migration to xdg-shell, IIRC.<br clear="none"><br clear="none">> Is this intended, can I<br clear="none">> change something in weston.ini and enable the "autofocus".<br clear="none">> Thanks,Claudiu<br clear="none"><br clear="none">I'm not sure what you mean by "autofocus".<div class="yqt7209999103" id="yqtfd85642"><br clear="none"><br clear="none"><br clear="none">Thanks,</div><br clear="none">pq<br><br></div> </div> </div> </div></div></body></html>