[PATCH] Move panel to different screens on multihead

Marco Martin notmart at gmail.com
Tue Jun 3 22:57:24 CEST 2008


On Sunday 01 June 2008, Tony Murray wrote:
> This is my first KDE patch so please let me know if coding style/methods
> need to be changed.
> Aaron poked me into looking into this and I was able to come up with a
> patch that moves the panel from one screen to the other.  This patch worked
> surprisingly well and I was unable to make it behave badly in testing with
> my two screens.

just to not make it to stale:
if you don't have an account if it's ok if i commit it?
somebody objections?

Cheers,
Marco Martin

> Another bug right now is the panelcontroller doesn't always come up on the
> same screen as the panel (when I connect a screen with xrandr, the panel
> doens't move to it but the panelcontroller thinks it is on the 2nd screen).
> End result, I push the cashew on screen 1 and config bar comes up on screen
> 2.  After I move the panel to either screen (after applying my patch) it
> works ok.  Just the inital attach causes issues.
>
> --- trunk/KDE/kdebase/workspace/plasma/plasma/panelcontroller.cpp.orig
> 2008-06-01 02:32:00.000000000 -0500
> +++ trunk/KDE/kdebase/workspace/plasma/plasma/panelcontroller.cpp
> 2008-06-01 02:32:26.000000000 -0500
> @@ -670,6 +670,14 @@
>              return;
>          }
>
> +        if (!screenGeom.contains(event->globalPos())) {
> +            //move panel to new screen if dragged there
> +            QDesktopWidget *desktop = QApplication::desktop();
> +            int newScreen = desktop->screenNumber(event->globalPos());
> +            kDebug() << "Mouse drag left panel's screen" <<
> d->containment->screen() << "to screen" << newScreen;
> +            d->containment->setScreen(newScreen);
> +        }
> +
>          Plasma::FormFactor oldFormFactor = d->containment->formFactor();
>          Plasma::FormFactor newFormFactor = d->containment->formFactor();
>          const Plasma::Location oldLocation = d->containment->location();




More information about the Panel-devel mailing list