Page 1 of 6 123 ... LastLast
Results 1 to 10 of 56

Thread: HOWTO: Change Metacity/Twinview window placement behavior [Dapper, Edgy]

  1. #1
    Join Date
    Oct 2005
    Location
    Copenhagen
    Beans
    206

    HOWTO: Change Metacity/Twinview window placement behavior [Dapper, Edgy]

    Keywords: Metacity, Twinview, Xinerama, dual-display, dualdisplay, dual-view, dualview, window, placement, algorithm, patch, other screen, arghh, doh, dapper, edgy, 6.06, 6.10

    HOWTO: Change Metacity/(Twinview/Xinerama) window placement behavior [Dapper, Edgy]
    This HOWTO applies to 32 bit Dapper and 32 bit Edgy only

    Hey everybody
    First of all, what is this HOWTO for? This HOWTO can help solve your problem if you meet the following two criteria:
    1. You have a functional Twinview system, (no matter which graphics card) meaning that your desktop extends onto an other screen
    2. You are pulling your hair out because every time you open the second window on a desktop, this window automatically opens on the second monitor and that was NOT what you wanted it to

    If you meet the criteria above, please read on.

    The solution to this problem is a simple one line patch of the Metacity (the window management application in GNOME) source-code. This will change the behavior of the window placement algorithm so that it works like it did before EXCEPT that it will always open new windows on the same screen as the one the mouse is in.

    Be aware: This patch is neither supported or encouraged by the Metacity development team, in fact they claim that it is wrong (see comment 12 in this thread), and I don't have any c-programming experience so that I can check it out for myself. So use it at your own risk That being said, it works fine for me and I haven't experienced any side-effects, plus, the place where I found the patch in the first place is a university that supplies the patched packages to all the users of a certain piece of software they develop, soooo it HAS been tested and is still in use there.

    There are two ways to install this. The first one is to simple install the patched .deb's that I've supplied and the second, which is somewhat more "hands on", is to, download the source-code, place the patch, repackage and install the packages. Since I have now updated this for edgy also this guide now covers two different version of metacity, 2.14.5(Dapper) and 2.16.3(Edgy). Therefore the download commands are split in two and you are off course only meant to get the one that corresponds to your system. In the rest of the instructions I have just left them as they were for Dapper so here you have to replace the version with the right ones yourself. I hope this is clear. Here we go


    Installing the .deb's I have made
    If you don't want the trouble of patching yourself you can just use the packages I have made from the patched source-code. They have a slightly different version-number so they will install as an update to the current version of Metacity (2.14.5). This prevents apt to just replace them the next time you run update. But this also means that the next time there do come some new Metacity packages you will have to do this again. But no worries, it easy, it doesn't happen that often and I will keep supplying .deb's for the purpose. Enough talk already. To install simply do the following.
    Code:
    cd /to/whereever/you/keep/temporary/files
    In Dapper do:
    Code:
    wget http://www.student.dtu.dk/~s021749/metacitydebs/metacity-2.14.5-0ubuntu2_i386.tar.gz
    In Edgy do:
    Code:
    wget http://www.student.dtu.dk/~s021749/metacitydebs/metacity_2.16.3-0ubuntu3_i386.tar.gz
    Then:
    Code:
    tar -xvzf metacity*.tar.gz
    cd metacity*
    sudo dpkg -i *.deb
    That's it. Restart X, CTRL-ALT-BACKSPACE and we're done.

    Patching the source-code and repackaging
    First of all, the "apt-get install" command for dapper might be missing some packages, but for edgy it should be sufficient. Ok, download the patch and the source-code, and install the extra packages we need.
    Code:
    cd /to/whereever/you/keep/temporary/files
    Now in Dapper do:
    Code:
    wget http://www.student.dtu.dk/~s021749/metacitydebs/2.14.5_i386/021-twinview-modification.patch
    sudo apt-get install devscripts fakeroot cdbs debhelper liborbit2-dev libpopt-dev libxml2-dev libgconf2-dev libglade2-dev libstartup-notification0-dev libxml-parser-perl gnome-pkg-tools
    In Edgy do:
    Code:
    wget http://www.student.dtu.dk/~s021749/metacitydebs/2.16.3_i386/021-twinview-modification.patch
    sudo apt-get install devscripts fakeroot cdbs debhelper libgtk2.0-dev liborbit2-dev libpopt-dev libxml2-dev libgconf2-dev libglade2-dev libice-dev libsm-dev libx11-dev libxt-dev libxext-dev libxinerama-dev libxrandr-dev x-dev libxinerama-dev libstartup-notification0-dev gnome-pkg-tools
    Then:
    Code:
    apt-get source metacity
    That was the download. So now we copy the patch into it's right place and edit the change-log so the new package will work like an update.
    Code:
    cd metacity-2.14.5/
    cp ../021-twinview-modification.patch debian/patches/
    debchange -i
    Now an editor should pop up. Here you can add a change log entry. It's not necessary as it has already automatically created the one important line that describes the new version so you can just save and exit. But if you want to you can add something. This is the entry I added in the ready-made .deb's:
    Code:
    metacity (1:2.14.5-0ubuntu2) dapper-updates; urgency=low
    
      * debian/patches/021-twinview-modification.patch
        - Keeps newly opened windows on the same twinview display
          as the mouse is on
    
     -- Kenneth Nielsen <k.nielsen81@gmail.com>  Mon, 21 Aug 2006 15:29:38 +0200
    Now all we need to do is to repackage and install
    Code:
    fakeroot dpkg-buildpackage -us -uc
    sudo dpkg -i ../*.deb
    That's it.

    My story:
    Ok so if you are still not sure about the reason for installing this, here is a description of my system and the way I use, maybe it'll clear it up.
    My second monitor is the television. What I wanted from this setup is to be able to watch movies from my computer on the television, so that when I wanted to watch a movie I could open a movies player an drag it to the television and blow it up to full-screen. This also means that I NEVER want anything to open on the television per default, I'll drag whatever need to go there myself. This is however not possible because Metacity will always place a new window where there is more space, until is has all been used, then another algorithm kicks in. So after I got the Twinview setup to work, I would constantly have to drag windows from the television, which is a real pain in the.....

    Credits
    • ookami from the forum, for encouraging me to snope around to find a solution to this problem, and has also tested it
    • Christoph Willing from the University of Queensland. He supplied the patch and pointed me in direction of Klaus Reimer's website
    • Klaus Reimer. On his website there is a extensive guide about this patch and some other ATI stuff for Breezy. In fact this HOWTO is largely based on this page
    • The guys at #ubuntu-motu for answering some of all my newbie questions about repackaging


    Please give me feedback. I would very much like to know, of course, if something doesn't work, but also, please write a post, if you used it and it worked just fine, so that I can see how many has this problem.
    Last edited by TLE; January 30th, 2007 at 10:10 AM. Reason: Updating for Edgy and several other adjustments

  2. #2
    Join Date
    Jul 2006
    Beans
    22

    Re: HOWTO: Change Metacity/Twinview window placement behavior [Dapper]

    Wouldn't it be desirable for the application to just remember where you used it the last time?

    I am not a fan of cascading windows, I gather I use the panel that lists open windows the way you use the cascading of windows and I imagine that cascading windows would be more useful when you have a real big screen (or eyesight like a hawk).

    I liked the simplicity of using two screens in microsoft windows, the way you just relate the screen virtually to fit their relative physical placement in a graphical interface and how i could start firefox, move it to the other screen and close it for it to remember that it was where I wanted it.
    Last edited by ÄlveKatt; September 2nd, 2006 at 11:14 AM. Reason: Ugly writing

  3. #3
    Join Date
    Oct 2005
    Location
    Copenhagen
    Beans
    206

    Re: HOWTO: Change Metacity/Twinview window placement behavior [Dapper]

    Quote Originally Posted by ÄlveKatt View Post
    Wouldn't it be desirable for the application to just remember where you used it the last time?
    Yes....is the short answer. The desktop envoriment GNOME has after a long time of trying other system (Enlightenment and Sawfish, see this article) decided to use Metacity as its window manager tool. This was done to try and keep GNOME lightweight yet functional, and for the most part I think it works quite weel.
    For all single screen use I'm quite satisfied with the way Metacity handles windows in GNOME and in particular I don't mind the cascading window policy. But for dualscreen purposes it really sucs. But this is due to another feature in metacity. Metacity will, before the cascading window feature kicks in, try to place every new window at a position where there is enough room. And it is this feature that's responsible for placing windows at the other screen. As I indicated in the original post the Matecity deveopers are aware of this problem, but are unvilling to change it because they feel that group of people that need this feature is to small to justify complicating the code.

    So in short.
    I understand and respect the decision of the GNOME people for choosing Metacity as a part of an effort for keeping GNOME lightweight.
    I don't agree with the Metacity developers that this feature isn't worth changing.
    I would certainly prefer it IF the window manager in GNOME would either, per default keep newly opened windows on the same screen as the mouse, or remember the placement of where the applicaions where the last time.
    But untill that happens I guess we're stuck with either using this HOWTO or, changing window manager or changing desktop enviroment (which I would rather not do since I really like GNOME)

    Regards TLE

  4. #4
    Join Date
    Sep 2005
    Beans
    1,083
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: HOWTO: Change Metacity/Twinview window placement behavior [Dapper]

    Hey! This is working quite well! I am very pleased so far. No issues at all. I hope this is problem is addressed in future versions of metacity.

    Thanks!

  5. #5
    Join Date
    Apr 2006
    Location
    Stockholm/Sweden
    Beans
    115
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Change Metacity/(Twinview/Xinerama) window placement behavior [Dapper]

    I love you

    It is stupid the Gnome/Metacity team not fix this issue.
    Is REALLY annoying when you have twinview.

  6. #6
    Join Date
    Oct 2005
    Location
    Copenhagen
    Beans
    206

    Re: HOWTO: Change Metacity/(Twinview/Xinerama) window placement behavior [Dapper]

    I'm glad that it works for you

  7. #7
    Join Date
    Sep 2005
    Beans
    1,083
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: HOWTO: Change Metacity/(Twinview/Xinerama) window placement behavior [Dapper]

    Will you be updating this for Edgy?

  8. #8
    Join Date
    Oct 2005
    Location
    Copenhagen
    Beans
    206

    Re: HOWTO: Change Metacity/(Twinview/Xinerama) window placement behavior [Dapper]

    Quote Originally Posted by bluevoodoo1 View Post
    Will you be updating this for Edgy?
    Yes, as soon as I get Edgy installed. I'm having major problems. But if I don't get it to work any time soon, I can help you make the packages yourself instead.

  9. #9
    Join Date
    Oct 2005
    Location
    Copenhagen
    Beans
    206

    Re: HOWTO: Change Metacity/Twinview window placement behavior [Dapper]

    The HOWTO is now updated for Ubuntu 6.10 (Edgy)

    Let me know if you have any problems

  10. #10
    Join Date
    Nov 2006
    Beans
    67

    Re: HOWTO: Change Metacity/Twinview window placement behavior [Dapper, Edgy]

    Hi i applied the patch with the first method and after that gnome won't start, it just hangs, and i have to hit ctrl+alt+backspace to reset X. Just upgraded to Edgy (which had some problems, but that's another story).
    Any ideas, on how to remove the patch?

    Cheers

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •