Moving windows between separate X screens

I've just switched over to using separate X screens for various different reasons and the only thing I can't get sorted is to find a way to move a window from one screen to another. I've tried 'xmove' and 'wmctrl' so far but had no joy. I don't want to go back to using twinview and searching around the usual supects is turning up nothing besides what i've already mentioned.
From what i've read it's (quite easily) do-able on other platforms but does anyone know if this is possible on Linux?

I believe this can be done, at least from GTK level. Here is a short example of how this can be achieved:
#include <gtk/gtk.h>
#include <gdk/gdk.h>
GtkWindow * mainWindow;
GdkDisplay *second_display;
GdkScreen *second_screen;
static void print_hello (GtkWidget *widget, gpointer data)
g_print ("Hello World\n");
GdkScreen* screen = gtk_window_get_screen(mainWindow);
gint number = gdk_screen_get_number(screen);
g_print ("Opened in screen %d \n",number);
gtk_window_set_screen (mainWindow, second_screen);
screen = gtk_window_get_screen(mainWindow);
number = gdk_screen_get_number(screen);
g_print ("Now in screen %d \n",number);
int main (int argc, char *argv[])
GtkWidget *window;
GtkWidget *button;
gtk_init (&argc, &argv);
second_display = gdk_display_open (":0.1");
second_screen = gdk_display_get_default_screen (second_display);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
mainWindow = GTK_WINDOW(window);
gtk_window_set_title (GTK_WINDOW (window), "Hello");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
button = gtk_button_new_with_label ("Hello World");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
This is modified from hello world example of gtk. Save the code to simple.c, then it should be compiled with:
gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0`
The program will be started with a button inside, on where you start it. When button is clicked, the window will be move to the screen with display name ":0.1", you can change that value in source code to have it move to other screen.
As far as I known, Gimp and emacs utilized this ability so that you can move their windows to other screen.
I am not comfirmed but I think there is a similiar way to do so in QT. So if a program use either GTK or QT, its windows is capable to move to other screens.
I do not know whether this can be done in Xlib or Xcb, and how this is done in GTK. Maybe they re-created a new X window and re-map everything to that container. So maybe it is hard to control in Window Managers. Its upon the developer of applications to make this ability available.

Similar Messages

  • Move window between Separate X screens

    Hello
    If I would like to run an application on my secondary monitor I just run:
    env DISPLAY=:0.1 xclock
    Is there something similar to send an already open window to my secondary monitor?
    Thanks
    // Lasse

    I spent a lot of time looking for something like that. Not possible for X apps currently, there were really old programs to do that which can't be used anymore with newer versions of things like xorg-server.

  • IE11 in Windows 8.1 changes scale when moving window between screens

    Hi,
    I'm using Windows 8.1 with IE11 on a Dell Latitude E6510 with an external LG screen. I use both screens in my daily work and when I move a IE11 window from the internal screen in my laptop to the external LG screen, the scaling in IE11 changes and gets smaller.
    It happens when the windows is halfway over to the external screen. On the way back it changes again and gets bigger. I've use the "One scaling for all my screens" in the Control Panel|Display applet without success. It's only IE11 that has this
    behaviour, no other programs does this.
    Brgds Jonas

    Hi Brgds Jonas,
    I agree with  Robert Aldwinckle .
    In addition, Windows 8.1 definitely seems to be doing some automatic display scaling here, as has been rumored based on beta builds of the OS.
    The first option is for multiple monitors with different ppi. windows will choose for you based on what the ppi is. use trial and error until you get the size you want and both monitors will be about that size. if they are close in ppi it will not scale
    them differently because I am pretty sure it only chooses from the default scaling sizes.
    For more reference, you may refer to:
    Windows 8.1 DPI Scaling Enhancements
    http://blogs.windows.com/windows/b/extremewindows/archive/2013/07/15/windows-8-1-dpi-scaling-enhancements.aspx
    Hope it helps.
    Regards,
    Blair Deng
    Blair Deng
    TechNet Community Support

  • Mission Control Dual Monitors moving windows between desktops

    So far I like the new Mission Control however I am having what I beleive to be an issue.
    I have a dual monitor setup and multiple Desktops configured. If I want to move a window from Primary Monitor Desktop 1 to Primary Monitor Desktop 2 it works but if I want to move a window from Primary Monitor Desktop 1 to Secondary Monitor Desktop 2 it will not let me. I have to do the move in two steps. First I have to move it to Primary Monitor Desktop 2 and then from there I can move it to Secondary Monitor Desktop 2 ?
    Please can someone verify this ? Is this a limitation or a bug ?

    Hehe, Linux+Compiz rulezzz. You can tweak it the way YOU need and not Apple think you should do 'cause they "just knows better what market needs"
    My ideal setup on Linux workstation was: 2 Graphics Cards, 4 Monitors, 2 of them fixed, so I could put there applications and windows which should be permanently seen, for example -- Zenoss monitoring dashboard (screen 1) and stocks tickers (screen 2)
    Screen 3 and 4 respectively were part of the Compiz Cube with Xinerama activated, e.g. one extra wide desktop across 2 monitors, seen as semi-transparent Cube during transitions between 4 virtual destops, so I could almost immediately see where all my windows are.
    And now, Apple, could you tell me, If I've got Mac Pro with 2 Graphics Cards and 4 Monitors, is such a setup feasible with Mission Control?... OK, ok, you don't have such an eycandy as Transparent Compiz Cube, I could survive without, but having simultaneously 2 monitors as part of virtual desktop and 2 others fixed is absolut 'a must have', so, now's your turn... HOW?

  • Moving application windows between two monitors in Mountain Lion

    I have a Macbook Pro that sits on my desk below an external monitor that is hooked into the laptop.  I use the Displays setting to arrange my external monitor on top of my laptop monitor.  Unitl I install Mountain Lion, I used to be able to move windows between the two screens.  Now, all application windows get stuck at the menu bar.  This is not a problem if the external monitor is placed to the right, left, or the bottom of my Macbook Pro screen in the Display setting.  The problem occurs only when it located above the laptop monitor.  Has anyone else experience this and is there a quick fix?

    Hi Jerry,
    The arrangement in the displays setting does show correctly. 
    If I restart the laptop, it will let me move applications between the two displays but as soon as it wakes up from sleep, I can no longer move applications to the external display if it is positioned on top (it will work if it is postioned on either sides or bottom).
    I did a fresh reinstall of the Mountain Lion operating system (reformatted the hard drive) but this did not fix it.
    Homie

  • Moving windows in spaces has lag

    there is a very noticeable delay when moving windows between spaces. although it’s not really a problem, it is disconcerting.

    Bumping this because it's persisting for me. Has anyone figured out a fix? It's like there is a rubber band between your mouse pointer and the point on the window that you're dragging in Spaces, such that as you drag around the window follows the mouse but kind of bounces and lags as though the rubber band were stretching. And it almost like they built in some Newtonian inertial physics into to. It's not really just a lag per se. But it's definitely annoying.

  • Moving apps between screens

    I'm having trouble moving apps between screens. I can move one app but then if I try and move another, I drag it off the side of the screen but the screen doesn't change. The only workaround I have is to move an app to the dock, change the screen with a swipe, then move the app out of the dock back onto the new screen. Is anyone else having this problem?

    I thought this was broken on my iPad after upgrading to iOS 4.2. After messing around, I found that if I move an icon around on the screen and hold it at the edge of the screen for a few extra seconds, with the edge of the icon slightly off the screen. Then the screen will change.

  • Probook 4540s loops between start screen and windows 8.1 logo screen

    So my laptop is loop between mentioned two screens. I ran two diagnostic tests - start up and run in. Both passed. I took it to my university tech support and they tried to install a start up repair via flash drive. An application error popped up, x00007 something. So upset. HELP!!! Is it an hardrive issue or because of the update it tried to do before I shut it down manually?

    @snmeesala 
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar
    I Work for HP

  • Moving windows to other 'Spaces' on a Mac

    Hi everybody,
    I've found a couple of annoying little things in using CS4 compared to CS3, the main one being that I can no longer move windows between the OS Spaces like you used to.
    I click on the header, type the shortcut for the space I want to move to, and the screen goes to that space but the window doesn't go with me.
    Does anyone know how I fix this?

    I've tried that and I can move the windows across that way fine ... which is a big help, thanks.
    It still won't work the other way though, so has anyone else had problems moving them across with the shortcut?
    SJ Creative, 4 Castle Gate, Castle Street, Hertford, SG14 1HD
    Tel: 01992 678636    Mobile: 07834 632 058
    Email: [email protected]    Web: sj-creative.co.uk
    SJ creative strive to be as 'paper-free' as possible in the studio.  Therefore all quotes and invoices will be sent via email.  If you require hard copies of any documentation then please contact us and we will be happy to supply them.

  • Macbook Pro retina, Windows 8.1 dual screen, Dell E228WFP problem/blurry

    Hello brainiacs,
    I am running my Macbook Pro 2013+ edition with Retina display and an extrenal screen.
    Problem: Fonts and windows on secondary screen (Dell E228WFP), in extended display mode, appears blurry and/or large (see screenshot)
    I use a Mini Display Port to DVI for my Dell Screen, Apple original product.
    I use Windows 8.1 with latest Boot Camp, version 5.1
    My Macbook is latest Macbook Pro with retina 15'' 2560x1600 px.
    Dell Screen has a resolution of 1680 x 1050 px.
    When I view the display settings in Screen Resolution mode in Windows, I get the following warning: "Your resoltuion is lower than 2028x1440. Some items might not fit on your screen". I do not believe this warining is regarding blurryness, but rather moving windows from primary to secondary monitor.
    Here's a screenshot:
    Some of the texts look fairly sharp and crisp, for example the pop-up menu (except, this has huge fonts). Outlook is very blurry. Chrome is, - ok, but not perfect.
    Best
    /Lars

    Hello brainiacs,
    I am running my Macbook Pro 2013+ edition with Retina display and an extrenal screen.
    Problem: Fonts and windows on secondary screen (Dell E228WFP), in extended display mode, appears blurry and/or large (see screenshot)
    I use a Mini Display Port to DVI for my Dell Screen, Apple original product.
    I use Windows 8.1 with latest Boot Camp, version 5.1
    My Macbook is latest Macbook Pro with retina 15'' 2560x1600 px.
    Dell Screen has a resolution of 1680 x 1050 px.
    When I view the display settings in Screen Resolution mode in Windows, I get the following warning: "Your resoltuion is lower than 2028x1440. Some items might not fit on your screen". I do not believe this warining is regarding blurryness, but rather moving windows from primary to secondary monitor.
    Here's a screenshot:
    Some of the texts look fairly sharp and crisp, for example the pop-up menu (except, this has huge fonts). Outlook is very blurry. Chrome is, - ok, but not perfect.
    Best
    /Lars

  • Bug in moving windows?

    Has anyone else noticed a problem with moving windows around by dragging them from the title bar:
    It used to be possible to move them off screen right, left, and down. Movement off the screen to the top was prevented, however: The pointer remaining at the edge of the screen, and the window moving no higher than the system menu bar.
    Now there seems to be a bug: This upwards movement restriction seems to switch on and off randomly - sometimes, the window is kept on screen as it should be, but a second later, it can be dragged off screen towards the top.
    I've had a look and can't find a mention of this anywhere. I vaguely remember there was a preferences option "Keep windows on screen" or something along those lines, but can't find it anywhere.
    I'm running 10.8.5 completely up to date.

    Support for moving automation is pretty much horrible all around.
    If you select all in the arrange window with automation visible, it only selects regions... so if you select all and move stuff, automation not associated with a region will stay put. Selecting automation on its own is difficult because you can barely see what's selected, and using the automation selection tool can select across multiple tracks but not move automation for multiple tracks at once.
    Also, adjusting the song start will keep regions in the same place in relation to bar 0, but will move automation... or something.
    It makes puppies cry.

  • Compiz, moving windows not smooth

    Hello
    I've runned in to a little enoying problem, when moving windows on my desktop while compiz is activated the animations isn't too smooth, nothing extreme but not perfect. But when enabling the compiz Benchmark they're smooth, It feels like compiz isn't refreshing often enough when the benchmark isn't enabled.
    Is there a setting to change the update interval for compiz somewhere? Anyone who have encountered the same issue?
    Thanks
    // Lazze

    Hello again
    I've just found out how to make compiz a bit more smooth and I thought it would be best to post it here if someone else encounters the same issue.
    To make compiz more smooth just do:
    Open CompizConfig Settings Manager.
    Go to General Option and the the Display Settings tab.
    Uncheck the Detect Refresh Rate checkbox and move the Refresh Rate slider to max.
    Moving it to max may increase the usage of your gpu since it will render the screen more often, lower the Refresh Rate a bit if it seems too high.
    // Lasse

  • DIFF. BETWEEN USER EXIT & SCREEN  EXIT .

    Dear All ,
                           Kindly help me to clear the diff between user exit & screen exit , where user exit is required & where screen exit is required . Do there is a need of Abaper in both the cases ?
    Regards,
    SAP11

    Hi,
    The basic rule in SAP as far as ABAP workbench developments are concerned is "Do not modify the source code of the program"
    Since needs and requirements keep on changing from client to client and for various business scenarios, there is a need to customise the programs as per client requirement.
    For this purpose, SAP has provided numerous list of user-exits also known as enhancements, which is nothing but a program which will deal with the client additional requirement, without modifying the source code of the program. These exits are already provided by SAP. You can see the list of user-exits provided by using the transaction code SMOD.  If you cannot find an user exit which match with client requirements, then you can tell SAP to create a new user exit.
    As far as screen exit is concerned, as per the client requirement if the user wants a separate screen to appear on execution of a particular task, which deviates from the standard sap provided flow of transactions, you write a screen exit.  In such case you first prepare the screen using the screen painter and define it as to after which sap screen you want this screen to appear for processing the transaction further.
    Regards,
    Baskar

  • LR5 stopped moving files between folders

    Hi everybody,
    I've noticed today that my LR5 stopped moving files between folders, I select files I want to move and drag them over to a new location like I always did before with only difference is now nothing happends, no messages with errors, nothing... I tried to google it and couldn't find anything related to my problem.
    I'm using Windows 8 x64. I checked the permissions on all the photo folders and everything seems to be correct. I also run LR under admin rights, so there shouldn't be any OS related issues... in addition, it was working just fine till today.
    I hope you can at least point me in right direction to dig more info on the problem with my LR5.
    Thx!

    Hi everybody,
    I've noticed today that my LR5 stopped moving files between folders, I select files I want to move and drag them over to a new location like I always did before with only difference is now nothing happends, no messages with errors, nothing... I tried to google it and couldn't find anything related to my problem.
    I'm using Windows 8 x64. I checked the permissions on all the photo folders and everything seems to be correct. I also run LR under admin rights, so there shouldn't be any OS related issues... in addition, it was working just fine till today.
    I hope you can at least point me in right direction to dig more info on the problem with my LR5.
    Thx!

  • Modification dates change when moving/copying between hard-drive and flash

    I use a flash drive to store most of my work-related documents on. That way, I have them when I'm at school (on a Windows XP computer) and at home on my Mac OS 10.3.9. I
    try to occasionally back-up my flash drive by dragging it's contents to my Mac. Copying in this direction USUALLY retains the appropriate modification date.
    However, if I move things from the Mac to the USB drive (I occasionally make changes to a file on the Mac when my flashdrive isn't handy), the modification date changes to the copy/move date. Is there a way around this? It alters the information about the file and sometimes makes a version look newer than another version of a document. When in reality, it’s older--it’s just been moved/copied and the date changed.
    I often move things back and forth for backup purposes, but if it keeps changing the dates on it’s own, it’s impossible to tell which is REALLY the
    most current copy/version.
    Is there a fix so that copying and moving files between volumes does NOT change the modification date of the file?
    Powerbook G4--12 in.--1.33 GHz   Mac OS X (10.3.9)  

    Hi, teacher. When my Lexar JumpDrive Secure is formatted as a MS-DOS volume so a PC can read it, the last-mod dates of files that I copy to it are changed to the date and time of copying. When it's formatted as a Mac OS Extended volume, the original last-mod dates are copied to it unchanged. Looks like you can thank Bill Gates for the inconvenience: apparently it's a DOS file system "feature". Don't you wish you could use Windoze all the time?
    On second thought, the files really are changed when you write them to a DOS volume, because the DOS file system has no place to store the metadata about your files that a Mac pays attention to and a Windoze box doesn't. So when you write Mac files to a DOS volume, that metadata — which is part of each Mac file — is simply discarded, causing the last-mod date to change.
    Message was edited by: eww

Maybe you are looking for

  • Can I use vouchers to purchase iTunes Store music in another country?

    Someone suggested that I can buy iTunes Store vouchers from eBay and then click "REDEEM" on iTunes Store to buy music EVEN IF I live in a country which does not have iTunes Store. But Apple is trying to make life really difficult for us. In the Q&A s

  • How to replace hard drive in macbook pro?

    How to replace hard drive in macbook pro?

  • Quicktime works in IE7, but not in Firefox 2

    I made Firefox 2 my default browser, and I know I have the most up-to-date Quicktime, but I don't know how to make Firefox 2 have a Quicktime plug-in. When I view a page that is supposed to have sound, i get a message that says to click to download r

  • What is my password for mozilla thunderbird?

    I cannot find my PW for Mozilla Thunderbird. I may have set up my MT account originally with <[email protected]> and not changed it to my current address, which is <[email protected]>. Thus I am not receiving messages from MT when I request a reset.

  • Store in a array

    Hi, I have a program with this query script: public ResultSet StartQuery() {         ResultSet rs = null;         try {             rs = stmt.executeQuery("SELECT uniqueid, " +                     "clid, " +                     "src, " +