Review Request: trying to reloacate the "add activity" action

Marco Martin notmart at gmail.com
Wed Mar 11 13:50:26 CET 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/270/#review454
-----------------------------------------------------------


review board don't have the diffs but for one wondering they are also at http://chani.ccdevnet.org/plasma/relocate-addactivity2-libs.diff and http://chani.ccdevnet.org/plasma/relocate-addactivity2.diff

for the issue of finding the current containment, i think if you put the following addContainment() in plasmaapp it's quite reliable:

void PlasmaApp::addContainment()
{
    //try to find the "active" containment to get a plugin name

    int currentScreen = Kephal::ScreenUtils::screenId(QCursor::pos());

    //FIXME: necessary to use KWindowSystem::currentDesktop() when per virtual desktop views is on?
    Plasma::Containment *fromContainment=m_corona->containmentForScreen(currentScreen, -1);

    QString plugin = fromContainment ? fromContainment->pluginName() : QString();
    Plasma::Containment *c = m_corona->addContainment(plugin);

    if (c && fromContainment) {
        foreach (DesktopView *view, m_desktops) {
            if (view->containment() == c){ //FIXME this can't be true...
                view->setContainment(c);
                return;
            }
        }

        // if we reach here, the containment isn't going to be taken over by the view,
        // so we're going to resize it ourselves!
        c->resize(fromContainment->size());
    }
}

- Marco


On 2009-03-11 03:24:35, Chani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/270/
> -----------------------------------------------------------
> 
> (Updated 2009-03-11 03:24:35)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> ok, I'm stumped.
> I have this patch 99% working. it even happens to fix some other minor issues. (the kdelibs part isn't on here, but it's fairly straightforward.)
> 
> thing is... in hte past, the activity created was based on hte old containment. it also uses the old one to set the right size, and would switch hte view tothe new one if not for a bug in that code. I wanted to keep this behaviour, because it's useful. also, seeing an 800x600 containment that 90% of the time shows up on *top* of your first containment isn't pretty. I'm ignoring the bugs that exposes for now...
> now, my activeWindow hack below used to work. until we got that new corona toolbox. it's a window unto itself, and becomes active when you click that "add activity" button inside it. :P then I started thinking about how it would break if the add-activity keyboard shortcut was used while hte panel was active... >.<
> I need a way to ask "which desktopview was last used?" in a sensible, non-painful way. I'm not certain such a thing exists. it'd be nice to at least have *some* way, though. since it's in the desktop shell, it can make a few assuptions if need be....
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/plasma/plasmaapp.h 938045 
>   trunk/KDE/kdelibs/plasma/plasmaapp.cpp 938045 
> 
> Diff: http://reviewboard.kde.org/r/270/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Chani
> 
>



More information about the Plasma-devel mailing list