Friday, October 25, 2019

How can I make the Unity 2d Shell dodge GNOME Panel when running both simultaneously?



I'm using GNOME Fallback in 12.04, and I'm running the Unity 2D Shell (WITHOUT THE UNITY 2D PANEL) and GNOME Panel. I've done this by logging in using GNOME Fallback, and then running unity-2d-shell. This is what it currently looks like:



enter image description here



The second picture is my second monitor, ignore it.




As you can see, the gnome panel is on top of the Unity 2d shell. How can I move the Unity 2d shell 28 pixels from the top of the screen (my gnome panel is 28 pixels in height)?



Edit: I'm running Compiz as well, so I can use the ccsm if anyone has any solution that would require that.



I confirm that behavior would show up only for Compiz/Dual Display combination. What I've tested so far in VBox with Ubuntu 12.04 32bit:




  • Metacity + Single Display (OK)

  • Metacity + Dual Display (OK)

  • Compiz + Single Display (OK)


  • Compiz + Dual Display (Overlapping)



One trick or work around that works for me, adding a top panel to the second display & Auto hide should be disabled for both.



In case you don't want to add a panel to 2nd display, this another hack not fully tested, it just works:




  1. Get source:




    sudo apt-get build-dep unity-2d
    apt-get source unity-2d
    cd unity-2d-5.14.0/

  2. Modify screen top



    nano shell/app/shelldeclarativeview.cpp



    void
    ShellDeclarativeView::updateShellPosition()

    {
    ...
    QRect my_screenInfo = m_screenInfo->availableGeometry();
    my_screenInfo.adjust(0,28,0,0);
    const QRect availableGeometry = my_screenInfo;
    //const QRect availableGeometry = m_screenInfo->availableGeometry();

  3. Mod Shell height



    nano shell/Shell.qml




    Item {
    id: shell
    ...
    height: declarativeView.screen.availableGeometry.height - 28

  4. Build it:



    cmake .
    make


  5. Test it



    ./shell/app/unity-2d-shell



You may like to install it then rename it to avoid mess up with official one.



    sudo make install        

sudo mv /usr/local/bin/unity-2d-shell /usr/local/bin/unity-2d-shell-mod

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...