[Panel-devel] Plasma and the window manager (Re: KDE/kdebase/workspace/plasma/plasma)

Lubos Lunak l.lunak at suse.cz
Fri Nov 16 16:11:02 CET 2007


On Friday 16 of November 2007, Andre Duffeck wrote:
> SVN commit 737422 by duffeck:
>
> - use Qt:FramelessWindowHint flag in combination with Net::KeepAbove for
>   the view and the AppletBrowser instead of Qt::X11BypassWindowManagerHint
>   and Qt::WindowStaysOnTopHint flags. That fixes issues such as keyboard
>   input not working.

 I'm pretty sure I've already told Aaron, but let me repeat for everybody:

 When you get some fancy ideas about toplevel windows (and this is bound to 
happen with you Plasma people), could you, pretty please, first tell me about 
it or mail kwin at kde.org? Getting interaction with the window manager in more 
complicated cases right seems to be non-trivial for most people, so doing 
this will save you the trouble of randomly shuffling the flags until it 
seemingly works. Also, since there's a fair chance it won't work quite right 
anyway, it will save me all the work of finding out about it, guessing what 
it's actually meant to be and trying to fix it for real. Everybody wins.

 Thank you

>  DashBoardView::DashBoardView(int screen, QWidget *parent)
> -    : Plasma::View(screen, PlasmaApp::self()->corona(), parent)
> +    : Plasma::View(screen, PlasmaApp::self()->corona(), parent),
> +      m_appletBrowser( 0 )
>  {
>      setContextMenuPolicy(Qt::NoContextMenu);
> -    setWindowFlags( Qt::X11BypassWindowManagerHint |
> Qt::WindowStaysOnTopHint );
> +    setWindowFlags( Qt::FramelessWindowHint ); 
>      setWindowOpacity( 0.9 );
> +    setWindowState( Qt::WindowFullScreen );
> +    KWindowSystem::setState(winId(), NET::KeepAbove);

 The other two flags are kind of implied by fullscreen. Moreover, if I have at 
least the faintest idea about what Dashboard is[*], fullscreen is not the 
right flag for it.

[*] And I probably don't have any better idea than that.

> +void DashBoardView::showAppletBrowser()
> +{
> +    if (!m_appletBrowser) {
> +        m_appletBrowser = new
> Plasma::AppletBrowser(qobject_cast<Plasma::Corona *>(scene()), this,
> Qt::FramelessWindowHint );
> +        m_appletBrowser->setApplication(); 
> +        m_appletBrowser->setAttribute(Qt::WA_DeleteOnClose);
> +        m_appletBrowser->setWindowTitle(i18n("Add Widgets"));
> +        connect(m_appletBrowser, SIGNAL(destroyed()), this,
> SLOT(appletBrowserDestroyed()));
> +        KWindowSystem::setState(m_appletBrowser->winId(), NET::KeepAbove);

 This state is not needed at all, unless it's patching over some other 
problem.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz


More information about the Panel-devel mailing list