Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Dynamic GUI Window Redirection? 51

Chris Tyler asks: "Picture this: you're sitting on the couch surfing on your tablet. You find something interesting (or funny or informative), so you say, "Hey! Look at this!" and send the window to the video projector shining on one of your walls. Or you are surfing for a hotel reservation and want to show it to your spouse before you click on 'book it'. Or you're viewing a report on your PC and the captain orders, 'on viewscreen!' With viable tablet PCs inching ever so slowly towards market, 802.11b an established technology, and more programmable pixels blinking at us then ever before, redirection capability for GUI windows will become a more and more desirable feature. X11 has some great network capabilities, but doesn't easily send to multiple displays or enable a window to be switched between displays. VNC is cross-platform and does permit disconnect/reconnect, connection initiation from either end, colourdepth mapping, and multiple views of the same desktop, but it is desktop-oriented (as opposed to window-oriented) in most implementations. Are there any good solutions for dynamic window redirection? What features would a good redirection solution include?"
This discussion has been archived. No new comments can be posted.

Dynamic GUI Window Redirection?

Comments Filter:
  • Possible Solution? (Score:2, Interesting)

    by genomancer ( 588755 )
    Ok, so I suspect this isn't feasable, but I have two monitors set up with an ajoined desktop, and I can drag/send windows between different desktops.. so couldn't you map two different desktops to two different devices and just move things between them?

    • Yup, what you describe is, I believe, exactly what Xinerama does.

      I don't think it allows you to move windows between arbitrary X displays, but it's a step in the right direction.

      Perhaps someone more familiar with Xinerama could say something intelligent about it?
  • ALT-PrtScr...open up a new email in outlook, hit Ctrl-V, paste it in there....hit send...

    It's better for troubleshooting, etc
  • Indirection (Score:4, Interesting)

    by crow ( 16139 ) on Monday July 22, 2002 @01:10PM (#3931191) Homepage Journal
    This is a great idea. It would be wonderful if X were designed to allow applications to dynamically change their display setting, or even talk to more than one X server at once.

    In most cases, it would simply be a matter of hacking the X library to allow you to close the connection to the server and open a new one (presumably to a different server). There might be some issues with having your resources suddenly change (you know, the stuff in places like ~/.Xdefaults). There might be a lot of issues of font support being different on the other server. There might be issues of assumptions that the server knows what windows you already have open. And it doesn't let you display on two servers at once.

    With the current architecture of X, probably the best solution is a vnc-like virtual X server. This would be what your applications talk to, and it would open connections to zero or more real X servers. (No reason to require a real X server all the time, is there?) This is very similar to VNC, except that it's done on a per-window basis and talks X protocol to the real display server. Now we just need someone to write it.
    • X apps can talk to more than one display device at once. I used to use xemacs and have it displayed on several different computers at the same time. It was great, I could be coding in a buffer and my friend could be following along in my code, fixing bugs...all in the same buffer. I think that X probably doesn't care whether or not you are using multiple displays, and that it is just the application that has to be writting to do this.

      (I believe the xemacs command is something like "make-frame-on-display", but I don't remember it exactly.)
    • FYI: X is designed to allow applications to dynamically change display settings, AND talk to more than one X server at once.

      For changing "display settings", an application can use any visual available. Of course, common "PC" display hardware won't let you run direct color and color-map in separate windows at the same time -- that would be a hardware limitation though, and not a software limitation.

      Of course an application can talk to multiple X servers. Not many do, but this is NOT a defect of the X protocol.

      As to moving an application from one X server to another -- this requires a bit more work. It is "doable". I would use something like Xnest as a base. The local applications would connect to the local X server, that would keep track of the applications screens. The local X server would then connect with a remote X server (as a client), reproducing the applications resources on the remote X server. This would also allow X applications to be "suspended" -- in a state where they are NOT connected to any remote servers, and yet are still running, ready to be connected to.

      The local X server could also do multiplexing, allowing multiple input streams, and muxing output to a collection of remote X servers. I wouldn't implement that feature in "version 1", though.

      Maybe something like this already exists?

      Anyway, its not an issue with the X protocol itself...

      Problems: Change of visual in moving from one remote X server to another. Eg. color-map visual moving to a monochrome X-Terminal.

  • Hmmm. Interesting idea, and one I can honestly say I'd given no thought.

    Just sort of off the cuff, and in a Linux-based world, how about an extension to XFree86 (module, if you like) where you'd define additional screens and/or pointing devices for the wall viewer.

    It could be kinda kludgy because it's just an extension of existing tech, but the viewtablet could be a new sort of X device itself. Think of it like an old Wacom digitizer but with video. Maybe you'd move the window to a virtual desktop that is wall-viewer-aware. You'd maintain joint control via the tablet or another form of pointing device.

    Also, wouldn't it be more straightforward to extending X using the current device concepts (Screen, Input) for the new concepts? I'd think it would be possible to extend that to an eye-tracking mechanism and voice commands (see the Sun-produced movie "Starfire" -- http://www.asktog.com/starfire/starfireHome.html) so you could free yourself from mouse and keyboard actions as well.

    I guess it doesn't sound so daunting after all. It seems like it's just a matter of having drivers and definitions for the new devices. I think I'm oversimplifying, though. It might be the wonderful Indian food I had for lunch... too many endorphins.
  • I wonder how hard it would be to hack xnest to allow the server to open a new window on a new display and close the old one. This would solve the problem.

    For those who don't know xnest [xfree86.org]
  • It might be my imagination, but doesn't plan 9 support something like this?
  • There's always XMX - An X Protocol Multiplexor [brown.edu], but I couldn't get it to work when I tried it (though I didn't waste too much time). The only "fault" is that you must run your primary session through it if you want to later have windown appear on many desktops. Dunno about its overhead. I just use x0rfbserver [hexonet.de] when I'm in a bind.
  • Essentially all you're showing is information, and since the information will be available to all devices all that is needed is an appropiate viewer on the target device and a 'pointer' to that information.

    Enter the unifrom resource locator, a new invention of mine. All you need to send is this nifty string, and the target device will not only get the information, but it'll start an appropiate viewer for it. I'm selling them cheap, too. You can buy a hundred of these bad boys for a mere penny. There are greater discounts in quantity, but please be aware that the license requires payment for each transmitted URL (ie, it's not royalty free once you buy one URL)

    Seriously, this problem has been solved, though the actual mechanics of it needs to be smoothed over.

    For those thinking, "Duh, but it only works for web pages." slap yourself silly. A Uniform Resource Locator is exactly that, whether it's pointing to a server, a jpeg, an html file, any kind of document, or a port on your system which has a video stream coming from it. They can point to programs, current X sessions, windows, processes, etc.

    Let's not go reinventing the wheel, ok? Good.

  • If you want a cross-platform solution, you have to forget about X. Basically, the source machine from which you want to export a window to a destination machine has to become the display server, and the destination machine becomes the display client. It seems the easiest solution would be to hack a custom VNC to make it window oriented, so that the client can display multiple individual windows from the server as if they were local windows. It would also be nice to add some browsing capabilities to be able to browse for destination machines, since the current VNC is quite spartan in this respect. Then again, you have to wonder if the user experience might not become too confusing, having some remote windows intermixed with local windows, and telling which is which. Perhaps the current desktop oriented VNC is good enough?
    • The VNC server is an X-server with no monitor that redirects the pixels written to it to a VNC client. Using X directly has an advantage over VNC in that the X display knows where the windows are. Some commercial X-servers for Windows have a local windowmanager that makes the remote UNIX app windows look like local Windows windows.

      X-Window servers exist on Windows (mostly non-free for Win), Mac OS X, Java, and the various unices. X-Windows can communicate over TCP/IP. I believe there's a project trying to redirect Windows GDI calls into X client calls. If this could intercept all GDI calls, Windows could display windows on a UNIX machine or any other machine with an X-server.

      If VNC became window-oriented, wouldn't it be essentially the same thing as a stripped-down X (minus the features and bloat)?
      • > Some commercial X-servers for Windows have a local windowmanager

        Those would be X clients, not X servers. They allow you to view the remote desktop of a Unix machine running X, not the remote desktop of a Windows machine. Serving up a Windows desktop to a remote machine is a lot trickier since Windows doesn't provide much hinting regarding drawing requests of local clients. IOW, when an app requests a DC and each time it draws on it, you would like to be notified of the drawing primitives used (line, fill, text, brush etc.), so that you can echo the operation to the remote client. Alas, Windows won't tell you that. You would have to rewrite GDI32.DLL to hook yourself in at this level. What the VNC server does instead is to add a system hook dll into the process space of each running app, intercepting all incoming messages to the apps' windows and checking for certain operations (such as rectangle invalidations, PAINT, window movement and resize, etc), and using the appropriate coordinates to grab a rectangular bitmap, compress it, and send it to the remote client. The VNC server on Windows is entirely bitmap based, I believe, it mirrors no vector operations at all. The VNC server for X OTOH can intercept all X drawing operations, so it can echo a much leaner data stream. That's why viewing a remote Windows desktop is a lot slower than viewing an X desktop. And no, to my knowledge VNC does in no way use the X protocol, so your assertion that the VNC server is an X server is incorrect.
        • On Linux/UNIX, vncserver is a daemon. When I start vncserver, it becomes available as localhost:1. X-clients such as xterm, kde, etc, connect to vncserver, and vncserver sends the pixels via VNC's vfb protocol to VNC clients.

          The confusing thing when talking about X is that the whole client-server system may seem backwards depending on your point of view. A more appropriate term might be "display server" (for X server) and "application" (for X client). To make matters worse, VNC seems like the opposite (client displays graphics, server sends graphics to client)

          I would think that you could mirror a Windows display to X (client = Windows application, remote X-server = viewing screen), by copying bitmaps to a remote X server in the same way as VNC (but with explicitly defined windows and maybe even extensions like OpenGL rendering). It's probably not worth it unless there were an easier way to do this. By the way, there's a program called kvfb which mirrors a KDE desktop (running on a real X server) to VNC.

          So I think X could be used like a more powerful version of VNC with accomodations like distinguishing individual windows. If VNC sent its bitmaps with window boundries as well, wouldn't it be essentially a simpler form of X? So I think the main advantage for VNC is a practical one (namely being cleaner and easier to implement).

          A downside to X would be for non-window-oriented paradigms especially for embedded stuff, but it sounds like QNX's Photon doesn't mind (disclaimer: I have never used Photon remotely).
    • "Make VNC windows oriented" ...Good idea, and the first one to suggest a decent, workable, solution. What are the moderators thinking... giving this post a 2, but giving the weak post on 'URLs' above a 4?!
  • by kevin42 ( 161303 ) on Monday July 22, 2002 @01:46PM (#3931543) Homepage
    There is a patch out there for sharing a single window (only works with the windows server right now) for TightVNC. I believe that the maintainer of tightvnc plans to integrate this functionality in the future (based on a posting to the tightvnc mailing list).
  • How many things do you really want to share that don't have a URL? How about in a few years from now?

    Send this screen to a friend.. [mailto]
  • xmove can do this (Score:5, Informative)

    by Col. Klink (retired) ( 11632 ) on Monday July 22, 2002 @01:50PM (#3931579)
    From the man page:

    xmove - pseudoserver to support mobile X11 clients

    xmove [ -server server_name:port ] [ -port listen_port ]

    xmove starts a pseudoserver which allows its X11 clients
    to be relocated from one display to another. Upon startup
    it will create a listening port from which it accepts new
    client connections. All such clients will be displayed on
    the default server, until moved elsewhere. Several
    clients may connect through a single xmove, thus requiring
    only one per machine.
  • Emacs used to have M-x set-display (or something like that) which changed the display for that session. I don't know for sure, but I suspect it simply unmapped itself and then mapped a new window on the new display with the old documents.

    So in short, the X server doesn't seem to support it but an app can do it and maybe a window manager could fake it.

    As others have said, VNC can allows multiple (simultaneous) clients.
    • M-x make-frame-on-display ... which creates a new frame (ie, window) on an X display. You can do this and then two folks can simultaneously edit the same file! Unfortunately, there is only one minibuffer, so some commands and editing styles are troublesome. But we used to do our homework this way; it's really fun...
  • The X Resize and Rotate Extension - RandR [xfree86.org]

    See the section on Migration and Replication. Haven't looked at it lately. I wonder what the current status is.
  • I use VNC http://www.uk.research.att.com/vnc/ and x0rbfs http://www.hexonet.de/software.en/ server to export my :0 desktop out to any other computers, and all that is required is a java capable web browser. VNC is also truly cross-platform application, I can output my linux desktop to my palm over a wireless connection.

    There is also a ton of other things you can use VNC for, such as application service providing.

    Hope this is helpfule!
  • <p>
    Years and years ago (1989 or 1990? I know I was using it in 1990), some folks at HP Labs created an X server that shared and transferred windows among different hosts. It was called SharedX and became a product.
    It was basically the hypothetical solutiond described by others: a virtual X server that allowed having the windows appear on multiple desktops. They went through a lot of agony to deal with different screen depths and worried about, but never solved, issues of gamma correction.
    It was a joy to use. I could share individual windows with other people and selectively grant input control to them. Although moving windows wasn't a target feature, it was available as a side effect.
    I searched for it recently and couldn't find any interesting web references.

  • So who stole Matrox's Top Secret(tm) plans for their next video card?
  • http://www.xfree86.org/~keithp/talks/randr/randr/

    He talks about the "Resize and Rotate" extension (not yet implemented) to help with a number of issues that have plagued X for a while, including resizing of the actual resolution (rather than the way a resolution change is currently handled) and has some thoughts on how this extension could help with migrating X clients between multiple servers.
  • Netmeeting has a remote window/desktop feature. It can let people in a meeting give control of applications running on their computer to other people. So, you can show your boss an excel chart, he may change the graph types, modify values etc... All as if the application were running locally.
  • xwatchwin (Score:2, Informative)

    by BJC ( 46012 )
    xwatchwin [x.org] lets you see what is being displayed in a window on a remote X server. It doesn't let you interact or move the window, and the display isn't perfect, but it does work and it doesn't need you to set up a proxy beforehand.

"This is lemma 1.1. We start a new chapter so the numbers all go back to one." -- Prof. Seager, C&O 351