X client wrapper for Win apps?

David Fraser davidf@sjsoft.com
Mon Sep 16 13:34:00 GMT 2002


Exactly my fiendish plot! Basically I've looked into it and these are my 
conclusions,
if you find anything else please add it as it would be a useful body of 
knowledge to build up!

Keith D. Tyler wrote:

>Hello,
>
>I don't know if this has been asked before, but I can't find a great
>search string that would help me find answers to my question.
>
>I'm dreaming of the possibility of using Xwin as my Windows shell. I've
>seen the recent post from D.F. about using KDE as his Windows
>desktop. I've tried basically this already, but it has two flaws that IMO
>make the solution very clunky:
>
>Running Windows apps makes the Xwin minimize.
>
I've discovered that rather than using -fullscreen, if you simply use 
-nodecoration
and set the X server to run at the same size as fullscreen, it doesn't 
minimize when
you switch tasks, but still stays the same size as the full screen in 
the background.
The advantage being you can still see it behind your other apps (if 
they're not maximized),
although they're still not actually inside X windows.

>Win apps are independent of the X Windowing environment; for example, I
>can't use a virtual desktop that will affect my Win apps.
>
>
>(Right now I am using two virtual desktops: JSPager for my Windows
>environment, and then FvwmPager in my Xwin. This means I have a weird
>nested virtual desktop, which is fine but awkward -- I have to have two
>sets of desktop-switching keys, etc.)
>  
>
Could we modify them to send messages between them for certain desktops?
So say you have Ctrl-F1, Ctrl-F2 switching to Linux Desktop 1 and 2, then
Ctrl-F3, Ctrl-F4 switch back to the Windows one and tell it to activate 
a certain
desktop. That way we'd be writing glue code rather than a whole new system.

>D.F. noted that Cygwin/Xfree doesn't or can't run in the same sort of
>rootless manner as Windows Explorer. I was thinking of an alternate
>solution. Is there an app that can wrap MS apps (running on real
>Win32) into X windows clients? I.e. I could start iexplore.exe and it
>would appear within my X environment like an X app, not indifferent to it.
>
>Is this even possible? Feasible/practical?
>
Basically this is what Wine does: they translate all the GDI functions 
of Windows
into X client library calls, so that the Windows program displays in the 
X server.
However, Wine currently compiles on Unix, and we want to actually do this
inside Windows, so that we effectively replace the GDI with this system.
I investigated compiling the Wine GDI dll under Cygwin, but it's complex.
Stephen Edwards has done quite a bit of porting Wine to MinGW/Cygwin for
the purpose of ReactOS (an open source NT clone) but the lower level stuff
like GDI and NTDLL etc is more difficult to port than the higher level 
stuff.
If you look on the Wine development mailing list you can find some stuff 
about
that if you're interested.
I found that Wine is so interlinked that it's hard to pull apart 
(although actually
a lot of the functions the GDI dll requires are win32 functions, so it 
might be possible).
My next thought is to create a native windows dll which does a basic job 
of translating
GDI to X. Then if any of the stuff from Wine is applicable we can bring 
it into that,
rather than trying to port the whole thing.
There's also a way you can hook any function call in any dll, so I 
thought a good way to
start would be to hook the GDI calls and replicate them as X client 
calls / log them,
get the simple ones going and then move onto the complex ones before 
actually replacing the dll.
Since cygwin Xfree86 actually uses the GDI to display itself, it would 
then make sense
to replace this with a native display like that used in Linux where X 
controls the whole video card
(or maybe use the DirectDraw mode?)
Other related things that might be interesting are:
the open source implementation of the Windows Terminal Server protocol, 
www.rdesktop.org
other replacement shells for windows: LiteStep, GeoShell, BlackBox for 
Windows
The Raptor shell platform, an architecture for building shells for Windows.
What I did try out as a simple experiment is ssh to my Linux machine, 
then run apps through
Wine but display them in cygwin X, just to see what it will look like 
... but it's quite a lot of work.
It would be nice to know how much interest there is out there for this 
kind of thing, particularly
other people willing to code...

>
>Another alternate solution would be if there was a native Win32 version of
>fvwm, that could manage Win32 windows as well as accept X client connects,
>but thats a question for someone else I'm sure... At very least, some
>native Win32 WM, fvwm or not, that could handle both types of apps.
>
The difficulty here is the windows in X aren't individual 
Windows-GDI-type windows...
so maybe if we can find a window manager that's been ported from X to 
Windows GDI,
we can combine the port and the original version to manage both?
Otherwise you could actually run multiple X servers, and flip between 
them... there's
obviously a performance loss here ...

>
>This is, I realize, all probably very unrealistic dreaming, but any leads
>or tips are welcome.
>
Probably but I don't see why it should remain so. Although there's 
probably a lot of work,
almost all of this has been done before in another context and this 
would be a major addition
to the Windows-UNIX interoperability area.

>
>TIA,
>
>==================================================================
>Keith D. Tyler                                keith@keithtyler.com
>Federal Way, WA                          http://www.keithtyler.com
>------------------------------------------------------------------
> Terrorists can attack freedom, but only Congress can destroy it.
>==================================================================
>
>  
>



More information about the Cygwin-xfree mailing list