Example #1
0
bool LxQtTaskBar::windowOnActiveDesktop(WId window) const
{
    if (!mShowOnlyCurrentDesktopTasks)
        return true;

    XfitMan xf = xfitMan();
    int desktop = xf.getWindowDesktop(window);
    if (desktop == -1) // Show on all desktops
        return true;

    if (desktop == xf.getActiveDesktop())
        return true;

    return false;
}
Example #2
0
bool window_list::windowOnActiveDesktop(Window window) const
{
    if (!onlyShowCurrentDesktop)
        return true;

    XfitMan xf = xfitMan();
    int desktop = xf.getWindowDesktop(window);
    if (desktop == -1) // Show on all desktops
        return true;

    if (desktop == xf.getActiveDesktop())
        return true;

    return false;
}
Example #3
0
void RazorTaskButton::contextMenuEvent(QContextMenuEvent* event)
{
    XfitMan xf = xfitMan();

    WindowAllowedActions allow = xf.getAllowedActions(mWindow);
    WindowState state = xf.getWindowState(mWindow);

//    qDebug() << "Context menu " << xfitMan().getName(mWindow);
//    qDebug() << "  Allowed Actions:";
//    qDebug() << "    * Move          " << allow.Move;
//    qDebug() << "    * Resize        " << allow.Resize;
//    qDebug() << "    * Minimize      " << allow.Minimize;
//    qDebug() << "    * Shade         " << allow.Shade;
//    qDebug() << "    * Stick         " << allow.Stick;
//    qDebug() << "    * MaximizeHoriz " << allow.MaximizeHoriz;
//    qDebug() << "    * MaximizeVert  " << allow.MaximizeVert;
//    qDebug() << "    * FullScreen    " << allow.FullScreen;
//    qDebug() << "    * ChangeDesktop " << allow.ChangeDesktop;
//    qDebug() << "    * Close         " << allow.Close;
//    qDebug() << "    * AboveLayer    " << allow.AboveLayer;
//    qDebug() << "    * BelowLayer    " << allow.BelowLayer;
//    qDebug();
//    qDebug() << "  Window State:";
//    qDebug() << "    * Modal         " << state.Modal;
//    qDebug() << "    * Sticky        " << state.Sticky;
//    qDebug() << "    * MaximizedVert " << state.MaximizedVert;
//    qDebug() << "    * MaximizedHoriz" << state.MaximizedHoriz;
//    qDebug() << "    * Shaded        " << state.Shaded;
//    qDebug() << "    * SkipTaskBar   " << state.SkipTaskBar;
//    qDebug() << "    * SkipPager     " << state.SkipPager;
//    qDebug() << "    * Hidden        " << state.Hidden;
//    qDebug() << "    * FullScreen    " << state.FullScreen;
//    qDebug() << "    * AboveLayer    " << state.AboveLayer;
//    qDebug() << "    * BelowLayer    " << state.BelowLayer;
//    qDebug() << "    * Attention     " << state.Attention;

    QMenu menu(tr("Application"));
    QAction* a;

    /* KDE menu *******

      + To &Desktop >
      +     &All Desktops
      +     ---
      +     &1 Desktop 1
      +     &2 Desktop 2
      + &To Current Desktop
        &Move
        Re&size
      + Mi&nimize
      + Ma&ximize
      + &Shade
        Ad&vanced >
            Keep &Above Others
            Keep &Below Others
            Fill screen
        &Layer >
            Always on &top
            &Normal
            Always on &bottom
      ---
      + &Close
    */

    // ** Desktop menu **************************
    int deskNum = xf.getNumDesktop();
    if (deskNum > 1)
    {
        int winDesk = xf.getWindowDesktop(mWindow);
        QMenu* deskMenu = menu.addMenu(tr("To &Desktop"));

        a = deskMenu->addAction(tr("&All Desktops"));
        a->setData(-1);
        connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop()));
        deskMenu->addSeparator();

        for (int i=0; i<deskNum; ++i)
        {
            a = deskMenu->addAction(tr("Desktop &%1").arg(i+1));
            a->setData(i);
            a->setEnabled( i != winDesk );
            connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop()));
        }

        int curDesk = xf.getActiveDesktop();
        a = menu.addAction(tr("&To Current Desktop"));
        a->setData(curDesk);
        a->setEnabled( curDesk != winDesk );
        connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop()));
    }