<div dir="ltr">Hi,<br><div><br></div><div>Did some progress on the xlib backend.</div><div><br></div><div><a href="https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib" target="_blank">https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib</a><br></div><div><br></div><div>- Transparent Stages</div><div>java @build/run.args -cp apps/toys/Hello/dist/Hello.jar hello.HelloTranspStageAnim<br></div><div><br></div><div>- On top stages</div><div>java @build/run.args -cp apps/toys/Hello/dist/Hello.jar hello.HelloStageOnTop<br></div><div><br></div><div>gtk is not initialized anymore (still links because there is porting to do).</div><div><br></div><div>-- Thiago.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 17 de mai. de 2022 às 18:17, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div>Did some improvements on my "pure x11" branch:</div><div><br></div><div>- Bitmaps are now handled by cairo which will use Xrender if available (will be beneficial if there's an alpha channel).</div><div>- Configuration using Xsettings (such as double click time)</div><div>- Setting the app icon now works</div><div>- Custom cursor works</div><div>- Mouse button works </div><div>- Able to launch Ensemble8 (with random crashes).</div><div><br></div><div>Interesting thing is that there's no need to convert BGRA -> RGBA. Not sure if it's a big performance improvement.</div><div><br></div><div>It seems the only thing that will be missing to completely ditch gtk are the "common dialogs" such as file open, etc.</div><div><br></div><div>I'm also investigating Wayland. It's somewhat similar to Xorg when it comes to events and the use of XDG specs. Probably will replace cairo with egl.</div><div><br></div><div>-- Thiago.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em dom., 24 de abr. de 2022 às 17:40, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>Xlib port at:<br></div><div><a href="https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib" target="_blank">https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib</a></div><div><br></div><div>Is able to very poorly run Ensemble8:<br></div><div>java @build/run.args -jar apps/samples/Ensemble8/dist/Ensemble8.jar <br></div><div><br></div><div>Keyboard events still do not work, mouse clicks are still buggy.<br></div><div>There will be crashes, but it's progress.</div><div>Window size & positioning is better now.<br></div><div><br></div><div>I am painting directly like this:</div><div><pre style="background-color:rgb(29,29,38);color:rgb(201,201,209);font-family:"JetBrains Mono",monospace"><span style="color:rgb(217,123,69)">void </span>WindowContextBase::paint(<span style="color:rgb(217,123,69)">void</span>* data, jint width, jint height) {<br>    Pixmap pixmap = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), (<span style="color:rgb(217,123,69)">char </span>*) data, width, height, <span style="color:rgb(77,172,240)">0</span>, <span style="color:rgb(77,172,240)">0</span>, depth);<br>    XCopyPlane(display, pixmap, xwindow, DefaultGC(display, DefaultScreen(display)), <span style="color:rgb(77,172,240)">0</span>, <span style="color:rgb(77,172,240)">0</span>, width, height, <span style="color:rgb(77,172,240)">0</span>, <span style="color:rgb(77,172,240)">0</span>, <span style="color:rgb(77,172,240)">1</span>);<br><br>    XFlush(display);<br>    XFreePixmap(display, pixmap);<br>}<br></pre></div><div>It does flicker a little, maybe it needs XSync extension to draw together with WM, maybe some kind of buffering. <br></div><div>Using cairo is possible, but it's a final render, not sure if there will be advantages.<br></div><div><br></div><div>I am accepting opinions.</div><div></div><div><br></div><div><br></div><div>-- Thiago.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 12 de abr. de 2022 às 03:22, <<a href="mailto:Gregor.Schmid@qfs.de" target="_blank">Gregor.Schmid@qfs.de</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi Thiago,<br>
<br>
I wholly agree.<br>
<br>
If gtk can be taken out of the equation it will reduce dependencies<br>
significantly. Like we had with gtk2 vs. 3 in JavaFX/Swing<br>
cross-embedding. Moving to gtk3 would start this all over again<br>
whereas plain Xlib should remain fully compatible regardless of the<br>
gtk version used by Swing (or SWT or whatever).<br>
<br>
I'll gladly help with testing - just ping me when you've got a<br>
version that is reasonably stable.<br>
<br>
Best regards,<br>
    Greg<br>
<br>
Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank">thiago.sayao@gmail.com</a>> writes:<br>
<br>
> Kevin,<br>
><br>
> Sure, I was hoping for the question.<br>
><br>
> "The focus of GTK has moved away from being a “meta toolkit” that other<br>
> toolkits can use as a “backend”."<br>
><br>
> Quoted from<br>
> <a href="https://discourse.gnome.org/t/gtk4-migration-window-management-functions-gone/7542/4" rel="noreferrer" target="_blank">https://discourse.gnome.org/t/gtk4-migration-window-management-functions-gone/7542/4</a><br>
><br>
> The first attempt I have made is the logical one, gtk4:<br>
> <a href="https://github.com/openjdk/jfx-sandbox/tree/tsayao_gtk4_playground" rel="noreferrer" target="_blank">https://github.com/openjdk/jfx-sandbox/tree/tsayao_gtk4_playground</a><br>
><br>
> Then I have discovered it's not possible to use gtk4 without Xlib and that<br>
> many window management functions are gone (see the quotation link).<br>
> In addition to this:<br>
> - Gtk4 cannot draw directly on the window or set the background without<br>
> gtk4 css;<br>
> - It cannot even move the window, just tell the compositor it started a<br>
> move.<br>
><br>
> I also have played plenty with gtk3, it breaks a lot of things thru the 3.x<br>
> release cycle, such as DND.<br>
><br>
> So, I see no reason to use Gtk if Xlib fits better as a glass backend (has<br>
> all the needed functions) and Gtk would use Xlib anyway and hide much<br>
> needed functionality.<br>
><br>
> Current glass Gtk backend already touches a lot of Xlib.<br>
><br>
> Wayland is fully compatible with Xlib, so we can work on "both worlds" with<br>
> it. Someday on the future a pure Wayland backend would be nice.<br>
><br>
> I'm happy to answer any further questions.<br>
><br>
> -- Thiago.<br>
><br>
><br>
><br>
><br>
> Em seg., 11 de abr. de 2022 às 12:41, Kevin Rushforth <<br>
> <a href="mailto:kevin.rushforth@oracle.com" target="_blank">kevin.rushforth@oracle.com</a>> escreveu:<br>
><br>
>> Can you say more about the motivation for doing this? Given the eventual<br>
>> direction for Wayland support, even in X11 compatibility mode, I would<br>
>> expect more use of gtk and less use of Xlib, not the other way around.<br>
>><br>
>> -- Kevin<br>
>><br>
>> On 4/10/2022 2:43 PM, Thiago Milczarek Sayão wrote:<br>
>> > Hi,<br>
>> ><br>
>> > I got simple samples running on the pure Xlib port of the Gtk backend.<br>
>> ><br>
>> > It still has gtk code, but mainly uses Xlib by now. Don't judge the code,<br>
>> > I'm porting it gradually.<br>
>> ><br>
>> > <a href="https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib" rel="noreferrer" target="_blank">https://github.com/openjdk/jfx-sandbox/tree/tsayao_xlib</a><br>
>> ><br>
>> > java @build/run.args -cp apps/toys/Hello/dist/Hello.jar<br>
>> hello.HelloCursors<br>
>> ><br>
>> > Window coordinates and sizes are still off a bit, so you might have to<br>
>> > resize the window to redraw.<br>
>> ><br>
>> > -- Thiago.<br>
>><br>
>><br>
<br>
-- <br>
Gregor Schmid<br>
<br>
E: <a href="mailto:gregor.schmid@qfs.de" target="_blank">gregor.schmid@qfs.de</a><br>
T: +49 8171 38648-11<br>
F: +49 8171 38648-16<br>
<br>
Quality First Software GmbH | <a href="http://www.qfs.de" rel="noreferrer" target="_blank">www.qfs.de</a><br>
Bürgermeister-Graf-Ring 10 | 82538 Geretsried | Germany<br>
GF Gregor Schmid, Karlheinz Kellerer<br>
HRB München 140833<br>
<br>
The data protection information in accordance with the EU General Data<br>
Protection Regulation applies to authorized representatives /<br>
authorized representatives of "legal persons" in accordance with Art.<br>
12 ff. DS-GVO<br>
<a href="https://www.qfs.de/fileadmin/Webdata/pdf/en/dsgvo.pdf" rel="noreferrer" target="_blank">https://www.qfs.de/fileadmin/Webdata/pdf/en/dsgvo.pdf</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>