本文整理汇总了C++中kwin::WindowInfo::isOnDesktop方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowInfo::isOnDesktop方法的具体用法?C++ WindowInfo::isOnDesktop怎么用?C++ WindowInfo::isOnDesktop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kwin::WindowInfo
的用法示例。
在下文中一共展示了WindowInfo::isOnDesktop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotWindowAdded
void KPager::slotWindowAdded( WId win)
{
KWin::WindowInfo* inf = info( win );
if (!inf)
return; // never should be here
for ( int i=1; i <= (int) m_desktops.count(); ++i)
{
if ( inf->isOnDesktop( i ))
m_desktops[i-1]->repaint(false);
}
}
示例2: showHide
/**
* Show/hide playlist global shortcut and PlayerWindow PlaylistButton connect to this slot
* RULES:
* 1. hidden & iconified -> deiconify & show @n
* 2. hidden & deiconified -> show @n
* 3. shown & iconified -> deiconify @n
* 4. shown & deiconified -> hide @n
* 5. don't hide if there is no tray icon or playerWindow. todo (I can't be arsed) @n
*
* @note isMinimized() can only be true if the window isShown()
* this has taken me hours to get right, change at your peril!
* there are more contingencies than you can believe
*/
void PlaylistWindow::showHide() //SLOT
{
const KWin::WindowInfo info = KWin::windowInfo( winId() );
const uint desktop = KWin::currentDesktop();
const bool isOnThisDesktop = info.isOnDesktop( desktop );
const bool isShaded = false;
if( isShaded )
{
KWin::clearState( winId(), NET::Shaded );
setShown( true );
}
if( !isOnThisDesktop )
{
KWin::setOnDesktop( winId(), desktop );
setShown( true );
}
else if( !info.isMinimized() && !isShaded ) setShown( !isShown() );
if( isShown() ) KWin::deIconifyWindow( winId() );
}
示例3: 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();
}
示例4: isReallyShown
bool PlaylistWindow::isReallyShown() const
{
const KWin::WindowInfo info = KWin::windowInfo( winId() );
return isShown() && !info.isMinimized() && info.isOnDesktop( KWin::currentDesktop() );
}