本文整理汇总了C++中kwin::WindowInfo::onAllDesktops方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowInfo::onAllDesktops方法的具体用法?C++ WindowInfo::onAllDesktops怎么用?C++ WindowInfo::onAllDesktops使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kwin::WindowInfo
的用法示例。
在下文中一共展示了WindowInfo::onAllDesktops方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: minimizeRestore
void KSystemTray::minimizeRestore(bool restore)
{
QWidget *pw = parentWidget();
if(!pw)
return;
#ifdef Q_WS_X11
KWin::WindowInfo info = KWin::windowInfo(pw->winId(), NET::WMGeometry | NET::WMDesktop);
if(restore)
{
if(d->on_all_desktops)
KWin::setOnAllDesktops(pw->winId(), true);
else
KWin::setCurrentDesktop(info.desktop());
pw->move(info.geometry().topLeft()); // avoid placement policies
pw->show();
pw->raise();
KWin::activateWindow(pw->winId());
}
else
{
d->on_all_desktops = info.onAllDesktops();
pw->hide();
}
#endif
}
示例2: saveGeometry
EXPORT void saveGeometry(QWidget *w, Data geo[5])
{
if (w == NULL)
return;
QPoint pos = w->pos();
QSize size = w->size();
geo[0].value = pos.x();
geo[1].value = pos.y();
geo[2].value = size.width();
geo[3].value = size.height();
#ifdef WIN32
if (GetWindowLongA(w->winId(), GWL_EXSTYLE) & WS_EX_TOOLWINDOW){
int dc = GetSystemMetrics(SM_CYCAPTION);
int ds = GetSystemMetrics(SM_CYSMCAPTION);
geo[1].value += dc - ds;
geo[3].value -= (dc - ds) * 2;
}
#endif
#ifdef USE_KDE
#if KDE_IS_VERSION(3,1,94)
KWin::WindowInfo info = KWin::windowInfo(w->winId());
geo[4].value = info.desktop();
if (info.onAllDesktops())
geo[4].value = (unsigned)(-1);
#else
KWin::Info info = KWin::info(w->winId());
geo[4].value = info.desktop;
if (info.onAllDesktops)
geo[4].value = (unsigned)(-1);
#endif
#endif
}
示例3: raiseWindow
bool raiseWindow(QWidget *w, unsigned)
#endif
{
Event e(EventRaiseWindow, w);
if (e.process())
return false;
#ifdef USE_KDE
/* info.currentDesktop is 0 when iconified :(
also onAllDesktops is 0 when Objekt isn't
shown already */
#if KDE_IS_VERSION(3,2,0)
KWin::WindowInfo info = KWin::windowInfo(w->winId());
if ((!info.onAllDesktops()) || (desk == 0)) {
if (desk == 0) desk = KWin::currentDesktop();
KWin::setOnDesktop(w->winId(), desk);
}
#else
KWin::Info info = KWin::info(w->winId());
if ((!info.onAllDesktops) || (desk == 0)) {
if (desk == 0) desk = KWin::currentDesktop();
KWin::setOnDesktop(w->winId(), desk);
}
#endif
#endif
w->show();
w->showNormal();
w->raise();
return true;
}
示例4: slotWindowRemoved
void KPager::slotWindowRemoved( WId win )
{
KWin::WindowInfo* inf = m_windows[win];
if (inf)
{
bool onAllDesktops = inf->onAllDesktops();
int desktop = inf->desktop();
m_windows.remove( (long)win );
Desktop::removeCachedPixmap(win);
for (int i = 1; i <= (int) m_desktops.count(); ++i)
{
if (onAllDesktops || desktop == i)
m_desktops[i-1]->repaint(false);
}
}
}
示例5: KAction
KSystemTray::KSystemTray(QWidget *parent, const char *name) : QLabel(parent, name, WType_TopLevel)
{
#ifdef Q_WS_X11
QXEmbed::initialize();
#endif
d = new KSystemTrayPrivate;
d->actionCollection = new KActionCollection(this);
#ifdef Q_WS_X11
KWin::setSystemTrayWindowFor(winId(), parent ? parent->topLevelWidget()->winId() : qt_xrootwin());
#endif
setBackgroundMode(X11ParentRelative);
setBackgroundOrigin(WindowOrigin);
hasQuit = 0;
menu = new KPopupMenu(this);
menu->insertTitle(kapp->miniIcon(), kapp->caption());
move(-1000, -1000);
KStdAction::quit(this, SLOT(maybeQuit()), d->actionCollection);
if(parentWidget())
{
new KAction(i18n("Minimize"), KShortcut(), this, SLOT(minimizeRestoreAction()), d->actionCollection, "minimizeRestore");
#ifdef Q_WS_X11
KWin::WindowInfo info = KWin::windowInfo(parentWidget()->winId());
d->on_all_desktops = info.onAllDesktops();
#else
d->on_all_desktops = false;
#endif
}
else
{
d->on_all_desktops = false;
}
setCaption(KGlobal::instance()->aboutData()->programName());
setAlignment(alignment() | Qt::AlignVCenter | Qt::AlignHCenter);
}
示例6: slotWindowChanged
void KPager::slotWindowChanged( WId win , unsigned int prop)
{
bool repaint=false;
KWin::WindowInfo* inf = m_windows[win];
if (!inf)
{
inf=info(win);
prop=0; // info already calls KWin::info, so there's no need
// to update anything else.
repaint=true;
};
bool onAllDesktops = inf ? inf->onAllDesktops() : false;
int desktop = inf ? inf->desktop() : 0;
if (prop)
{
m_windows.remove( (long) win );
inf = info( win );
}
if((prop & ~( NET::WMName | NET::WMVisibleName )) != 0 )
repaint = true;
if (repaint)
for ( int i=1; i <= (int) m_desktops.count(); ++i)
{
if ((inf && (inf->isOnDesktop(i)))
|| onAllDesktops || desktop == i )
{
m_desktops[i-1]->repaint(false);
}
}
// redrawDesktops();
}