本文整理汇总了C++中kwin::WindowInfo::desktop方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowInfo::desktop方法的具体用法?C++ WindowInfo::desktop怎么用?C++ WindowInfo::desktop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kwin::WindowInfo
的用法示例。
在下文中一共展示了WindowInfo::desktop方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: info
KWin::WindowInfo* KPager::info( WId win )
{
KWin::WindowInfo* info = m_windows[win];
if (!info )
{
info = new KWin::WindowInfo( KWin::windowInfo( win ) );
if( !info->valid() || info->desktop() == 0 )
{
delete info;
return NULL; // window no longer valid
}
m_windows.insert( (long) win, info );
}
return info;
}
示例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: 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();
}