[Xquartz-dev] starting xquartz within a java process

Lorinc Hever lorinc.hever at gmail.com
Mon Dec 8 20:37:37 PST 2008


Thanks for the reply Pelle, Jeremy!

Yes if I both the target and the parent Window is an X window then
controlling a window of an other process is easy, you just need
XReparentWindow, which will take care of the show/hide, move and
XResizeWindow which going to take care of the resize (ConfigRequest) I
have working code for this under Linux.

However a Java window doesn't have any X11 context on Mac the xwininfo
won't return anything, also OS X doesn't have Window Manager API
(HIView applies only for Aqua windows in the same process).

Let's say I'm implementing the quartz-wm functionality on native side
of my java app (which makes me a regular Cocoa app essentially) then I
still cannot reparent (NSView::addSubview?) a window since the X
Window itself is created in the X server process.

So could please how can quartz-wm can help me?

Thanks in advance!

Lorinc
On Mon, Dec 8, 2008 at 1:57 PM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
>
>>>> I'm working on a feasibility to start xquartz from a java process with
>>>> JNI. My goal would be to keep the X server in the same process as my
>>>> java application so this way I can manipulate the X windows itself
>>>> (mainly reparent, resize and show/hide). To able to do the window
>>>> manipulation I have to keep X and java in the same process.
>>>
>>> That's not really possible... I think what you want to do is write a
>>> window manager in java (in which case you don't actually need the server to
>>> be in the same process).
>>
>> Actually, CrossOver seems to do this, though not in Java... I'm pretty
>> sure they have a heavily customised X server though, they probably started
>> with X11.app and built their interfaces around it (don't take my word for
>> it, I'm just guessing).
>>
>> Maybe if you really want this you can take the same approach. Instead of
>> embedding X11 in your app, customize X11.app to load your java code. It's
>> probably quite a bit of work though...
>
> It's not that much of a mystery.  They use quartz-wm, just like X11.app does
> ;)
>
> Like I said, what you're looking for is the functionality of a window
> manager, not the X server itself.
>
> --Jeremy
>
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev
>


More information about the Xquartz-dev mailing list