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

Thread: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

  1. #1
    Join Date
    Apr 2007
    Location
    Texas, USA
    Beans
    809
    Distro
    Kubuntu 12.10 Quantal Quetzal

    HOW-TO: Unity with 'Dodge Windows' and minimize/unminimize behavior

    The information in this thread has been moved to https://help.ubuntu.com/community/Un...indowsBehavior

    A thread for discussion of the wiki page only can be found here
    http://ubuntuforums.org/showthread.php?t=2012412

    Thread closed.


    So, I've been running 12.04 since around Beta 1, and one thing that really bothered me was the missing 'Dodge Windows' behavior. I had gotten so particular and used to the behavior that it completely disrupted my workflow when I migrated over to 12.04.

    There has been a valiant effort to recreate this behavior: http://ubuntuforums.org/showthread.php?t=1936037. For the most part, the script works pretty well, but I wanted the "real" option back. In this bug report #930148, one user, damianatorrpm (around comment #141), has created a couple patches that will revert the Canonical changes and re-add the behavior back to the source. I applied the patch to latest release of Unity (at this time, it's 5.12.0) and it works! Not only the behavior work as expected, the option is back in CCSM and has no nasty side-effects.

    Another feature I really like is the ability to be able to click a program's icon on the Launcher and minimize/unminimize that window. Jonathan French (ojno), the developer behind this patch, has not only made this a reality, but also got this to work in conjunction with the 'Spread Windows' functionality. He's even set up a PPA which contains the latest Unity and his patch to make it easier for end-users to get it.

    To make things easier, I've gone ahead and patched the vanilla Unity source to incorporate both of these behaviors. Furthermore, I've uploaded the changes to my Github. You can see this here: https://github.com/isaacj87/unity

    The relevant commits are here:



    So, without futher ado, let's get started. Open up a Terminal window and follow the steps below.

    UPDATED: New PPA installation method! Choose one method or the other, but NOT both.

    PPA Method (Recommended):

    Alright, guys...

    Now, I realize that for novice users (or even those who abhor the terminal), building Unity just for a couple features seems kind of silly. So, I decided to sit down last night and try to figure out packaging and PPAs...

    So, if you were hesitant about trying this before, you can now add my PPA if you feel more comfortable doing that.

    NOTE: Since I'm running 32-bit, I've only tested the i386 packages. I'll need someone running 64-bit to let me know if it works okay.

    NOTE: If you followed the tutorial originally, please remove ~/.compiz-1 and the 'staging' folder before you do this.

    Add my PPA by doing this:

    Code:
    sudo apt-add-repository ppa:ikarosdev/unity-revamped
    ...then, simply run an update:

    Code:
    sudo apt-get update && sudo apt-get dist-upgrade
    ...That's it!

    Removal:

    If you'd like to revert back to the offical Ubuntu packages, simply use PPA-purge. First, ensure it is installed:

    Code:
    sudo apt-get install ppa-purge
    ...then, remove my PPA:

    Code:
    sudo ppa-purge ppa:ikarosdev/unity-revamped
    I attempted my best to make "proper" packages, but I'm no expert. Use my PPA at your own peril!

    I'll try my best to keep these builds up-to-date with the official Unity packages, but I can't make any promises. Good luck, guys!

    Alternative Method (Compile from Source):

    NOTE: I tried this on a fresh installed of Ubuntu 12.04 32-bit. I can't say for sure if it'll work on older or other versions.

    The first thing to do is to install all the dependencies needed to grab the source (from my Github) and build Unity:

    Code:
    sudo apt-get install git git-core
    Code:
    sudo apt-get build-dep unity
    Now, we'll need a place to compile Unity. I usually like to create a folder called 'staging' and dump everything in there. You're welcome to put the source wherever you like, but just remember to change it accordingly for the tutorial:

    Code:
    mkdir ~/staging
    ...Now, we move into the directory:

    Code:
    cd ~/staging
    Okay, the next step is to grab the modified source from my Github. While still in the 'staging' directory, run this command:

    Code:
    git clone git://github.com/isaacj87/unity.git
    Once it's done pulling the source, we'll need to prepare our environment to build. We'll create a simple bash script and make it executable:

    Code:
    gedit unity.sh
    ...When the blank gedit window opens, copy and paste the following text into the file:

    Code:
    #!/bin/bash
    
    PREFIX=/home/YOURUSERNAMEHERE/staging
    
    export XDG_DATA_DIRS="$PREFIX/share:$XDG_DATA_DIRS"
    export LD_LIBRARY_PATH="$PREFIX/lib/"
    export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig/"
    Notice the bolded text? You'll need to change that to your username (remove any forum syntax!). Once you've done that, save the file and close the window. Let's make the file executable and run it:

    Code:
    chmod +x unity.sh
    Code:
    ./unity.sh
    Okay, now let's build Unity! We'll need to create a build folder for the compile. Let's move into the Unity source directory and create that folder and move into it:
    Code:
    cd unity
    Code:
    mkdir build && cd build
    Now, we'll prepare the build, compile and install:
    Code:
    cmake .. -DCMAKE_INSTALL_PREFIX=/home/YOURUSERNAME/staging/ -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DGSETTINGS_LOCALINSTALL=ON
    (Remember to change the bolded text to your username! Also, remove any forum syntax!)
    Code:
    make -j4
    Code:
    make install
    All done? Once that's finished, go ahead and log out and back in. Ensure that CCSM is installed and go into the Unity plugin configuration. Turn on the 'Dodge Windows' effect and it should work. Minimize an application to the launcher and click its icon again to unminimize it. If multiple windows of the same program are opened, the spread function should work as usual.

    Warning!: When using this, do not delete anything in the staging folder. More specifically, do not delete the bin, include, lib, and share folders. You will have unwanted side-effects (i.e. Compiz/Unity will keep crashing)!

    Removal:

    If you'd like to revert back to "stock" Unity, simply remove ~/.compiz-1 folder and you should be back to normal.

    Feel free to leave any questions, comments or concerns.

    Credits: damianatorrpm for the patch and Jonathan French (ojno) for the wonderful minimize behavior code.
    Last edited by Elfy; June 29th, 2012 at 09:22 AM.
    Laptop: [AMD Vision A4-3300M | 8GB RAM | ATI Radeon 6480G | Ubuntu 12.04 64-bit]

    Studio Box: [AMD Athlon 64 X2 5000+ | 4GB RAM | Nvidia 210 | M-Audio FastTrackPro | KXStudio 11.04 64-bit | 2.6.31-rt14-custom | KDE 4.6.5]

  2. #2
    Join Date
    Apr 2007
    Location
    Texas, USA
    Beans
    809
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    With the help of our friendly UbuntuForums admins and moderators, I've gone ahead an added this to the Ubuntu Help Wiki.

    Link: https://help.ubuntu.com/community/Un...indowsBehavior

    I've had a Launchpad account for years now, but I haven't done much with it. Later on, I'll see if I can figure out how to get a PPA up and running to make this an easier process.
    Laptop: [AMD Vision A4-3300M | 8GB RAM | ATI Radeon 6480G | Ubuntu 12.04 64-bit]

    Studio Box: [AMD Athlon 64 X2 5000+ | 4GB RAM | Nvidia 210 | M-Audio FastTrackPro | KXStudio 11.04 64-bit | 2.6.31-rt14-custom | KDE 4.6.5]

  3. #3
    Join Date
    Oct 2005
    Location
    U.S.A.
    Beans
    4,164
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    You, my friend, are full of awesome! The loss of the dodge function also threw my workflow into a tailspin and you just pulled me out of it. Thank you so much for this!

    Linux User #355330 | Ubuntu User #15618 | Last.FM

  4. #4
    Join Date
    Jul 2011
    Beans
    42

    Talking Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    You are greeeeeeeeeeeeeeeeat, Thaaaaaaaaaaanks

  5. #5
    Join Date
    Apr 2007
    Location
    Texas, USA
    Beans
    809
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    Glad I could help, guys!

    I need to put a warning on the thread and wiki that anything in the staging folder (specifically the bin, include, lib, and share folders) should not be removed! I deleted them and was wondering why Compiz kept crashing!
    Laptop: [AMD Vision A4-3300M | 8GB RAM | ATI Radeon 6480G | Ubuntu 12.04 64-bit]

    Studio Box: [AMD Athlon 64 X2 5000+ | 4GB RAM | Nvidia 210 | M-Audio FastTrackPro | KXStudio 11.04 64-bit | 2.6.31-rt14-custom | KDE 4.6.5]

  6. #6
    Join Date
    Jun 2007
    Beans
    17,337

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    nice job putting together, always liked the min. on launcher icon from back in natty when it was available from the rejected branch

    probably there will be another decent upgrade or 2 to unity in 12.04, expect one when compiz-0.9.8.X releases

    (converted your changes here to patches so i could build as packages but the method you've described is certainly easier for users to revert back if need be.

  7. #7
    Join Date
    Apr 2007
    Location
    Texas, USA
    Beans
    809
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    Quote Originally Posted by mc4man View Post
    nice job putting together, always liked the min. on launcher icon from back in natty when it was available from the rejected branch

    probably there will be another decent upgrade or 2 to unity in 12.04, expect one when compiz-0.9.8.X releases

    (converted your changes here to patches so i could build as packages but the method you've described is certainly easier for users to revert back if need be.
    Thanks for the kind words. I'm actually in the process of building and testing some packages. Hopefully, I can get them working as updating would be kind of cumbersome for new users...
    Laptop: [AMD Vision A4-3300M | 8GB RAM | ATI Radeon 6480G | Ubuntu 12.04 64-bit]

    Studio Box: [AMD Athlon 64 X2 5000+ | 4GB RAM | Nvidia 210 | M-Audio FastTrackPro | KXStudio 11.04 64-bit | 2.6.31-rt14-custom | KDE 4.6.5]

  8. #8
    Join Date
    Jun 2007
    Beans
    17,337

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    I've noticed one little anomaly here, not that important & could be just here as I have a patched compiz to fix flashing & a patched scale to allow spread from all workspaces, either all windows or all from a window group

    To check -
    open 3 different windows on 1 workspace, say Firefox, nautilus, a terminal.
    Minimize all 3 by clicking on the their icons
    Go to spread (Super+W), pick one window
    Back on desktop expose the remaining min'ed windows by clicking on icon.

    Here they come up empty, re-minimizing & opening fixes.
    Again may be just here, doesn't bother me

  9. #9
    Join Date
    Apr 2007
    Location
    Texas, USA
    Beans
    809
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    Quote Originally Posted by mc4man View Post
    I've noticed one little anomaly here, not that important & could be just here as I have a patched compiz to fix flashing & a patched scale to allow spread from all workspaces, either all windows or all from a window group

    To check -
    open 3 different windows on 1 workspace, say Firefox, nautilus, a terminal.
    Minimize all 3 by clicking on the their icons
    Go to spread (Super+W), pick one window
    Back on desktop expose the remaining min'ed windows by clicking on icon.

    Here they come up empty, re-minimizing & opening fixes.
    Again may be just here, doesn't bother me
    I noticed something like this too, but I'm pretty I was experiencing 'blank' windows before I applied these patches. I think this is an upstream Compiz problem. I think the minimize/unminimize behavior might be aggravating the issue further though...
    Laptop: [AMD Vision A4-3300M | 8GB RAM | ATI Radeon 6480G | Ubuntu 12.04 64-bit]

    Studio Box: [AMD Athlon 64 X2 5000+ | 4GB RAM | Nvidia 210 | M-Audio FastTrackPro | KXStudio 11.04 64-bit | 2.6.31-rt14-custom | KDE 4.6.5]

  10. #10
    Join Date
    Jun 2007
    Beans
    17,337

    Re: HOW-TO: Build Unity with 'Dodge Windows' and minimize/unminimize behavior

    Yeah - i just went to another install & see it there so not because of the min patch.
    Hadn't noticed before, going to check against unity-5.10
    edit: happens in 5.10 so something I hadn't noticed before - sorry to bring up here...
    Last edited by mc4man; April 29th, 2012 at 03:03 AM.

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
  •