Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 89642 Details for
Bug 137394
Kmail's systray behaviour
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch fixing kmail systray behaviour
kmail-3.5.3-kmsystemtray.diff (text/plain), 5.55 KB, created by
Non_E
on 2006-06-20 10:21:44 UTC
(
hide
)
Description:
Patch fixing kmail systray behaviour
Filename:
MIME Type:
Creator:
Non_E
Created:
2006-06-20 10:21:44 UTC
Size:
5.55 KB
patch
obsolete
>diff -ru kdepim-3.5.0/kmail/kmsystemtray.cpp kdepim-3.5.0_new/kmail/kmsystemtray.cpp >--- kdepim-3.5.0/kmail/kmsystemtray.cpp 2005-09-10 11:24:01.000000000 +0300 >+++ kdepim-3.5.0_new/kmail/kmsystemtray.cpp 2005-11-29 15:55:08.000000000 +0200 >@@ -35,6 +35,7 @@ > #include <kiconeffect.h> > #include <kwin.h> > #include <kdebug.h> >+#include <kwinmodule.h> > #include <kpopupmenu.h> > > #include <qpainter.h> >@@ -295,14 +296,80 @@ > */ > void KMSystemTray::mousePressEvent(QMouseEvent *e) > { >- // switch to kmail on left mouse button >- if( e->button() == LeftButton ) >- { >- if( mParentVisible && mainWindowIsOnCurrentDesktop() ) >- hideKMail(); >- else >- showKMail(); >- } >+ // switch to kmail on left mouse button >+ if( e->button() == LeftButton ) >+ { >+ KMMainWidget * mainWidget = kmkernel->getKMMainWidget(); >+ if ( mainWidget ) >+ { >+ QWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget(); >+ if ( mainWin ) >+ { >+ if (mainWin->isHidden()) { >+ showKMail(); >+ } >+ else if (KWin::windowInfo( mainWin->winId(), NET::WMDesktop ).isOnCurrentDesktop()) >+ { >+ KWin::WindowInfo info1 = KWin::windowInfo( mainWin->winId(), NET::XAWMState | NET::WMState ); >+ // mapped = visible (but possibly obscured) >+ bool mapped = (info1.mappingState() == NET::Visible) && !info1.isMinimized(); >+ // - not mapped -> show, raise, focus >+ // - mapped >+ // - obscured -> raise, focus >+ // - not obscured -> hide >+ if( !mapped ) >+ showKMail(); >+ else >+ { >+ // go through all windows and check if this window is behind them >+ KWinModule module; >+ for( QValueList< WId >::ConstIterator it = module.stackingOrder().fromLast(); >+ it != module.stackingOrder().end() && (*it) != mainWin->winId(); >+ --it ) >+ { >+ KWin::WindowInfo info2 = KWin::windowInfo( *it, NET::WMGeometry | NET::XAWMState | NET::WMState | NET::WMWindowType ); >+ if( info2.mappingState() != NET::Visible ) >+ continue; // not visible on current desktop -> ignore >+ >+ if( !info2.geometry().intersects( mainWin->geometry())) >+ continue; // not obscuring the window -> ignore >+ >+ if( !info1.hasState( NET::KeepAbove ) && info2.hasState( NET::KeepAbove )) >+ continue; // obscured by window kept above -> ignore >+ >+ NET::WindowType type = info2.windowType( NET::NormalMask | NET::DesktopMask >+ | NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask >+ | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask ); >+ if( type == NET::Dock || type == NET::TopMenu ) >+ continue; // obscured by dock or topmenu -> ignore >+ >+ // this window is obscured by a normal window >+ showKMail(); >+ return; >+ } >+ hideKMail(); >+ } >+ } >+ else >+ { >+ KWin::setCurrentDesktop( KWin::windowInfo( mainWin->winId(), NET::WMDesktop ).desktop() ); >+ showKMail(); >+ } >+ } >+ else >+ { >+ /* error */ >+ kdDebug(5006) << "KMail has a KMMainWidget but not a QWidget ????" << endl; >+ showKMail(); >+ } >+ } >+ else >+ { >+ /* error */ >+ kdDebug(5006) << "KMail has NO KMMainWidget" << endl; >+ showKMail(); >+ } >+ } > > // open popup menu on right mouse button > if( e->button() == RightButton ) >@@ -370,20 +437,6 @@ > } > > >-bool KMSystemTray::mainWindowIsOnCurrentDesktop() >-{ >- KMMainWidget * mainWidget = kmkernel->getKMMainWidget(); >- if ( !mainWidget ) >- return false; >- >- QWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget(); >- if ( !mainWin ) >- return false; >- >- return KWin::windowInfo( mainWin->winId(), >- NET::WMDesktop ).isOnCurrentDesktop(); >-} >- > /** > * Shows and raises the first KMMainWidget and > * switches to the appropriate virtual desktop. >@@ -398,9 +451,6 @@ > { > KWin::WindowInfo cur = KWin::windowInfo( mainWin->winId(), NET::WMDesktop ); > if ( cur.valid() ) mDesktopOfMainWin = cur.desktop(); >- // switch to appropriate desktop >- if ( mDesktopOfMainWin != NET::OnAllDesktops ) >- KWin::setCurrentDesktop( mDesktopOfMainWin ); > if ( !mParentVisible ) { > if ( mDesktopOfMainWin == NET::OnAllDesktops ) > KWin::setOnAllDesktops( mainWin->winId(), true ); >diff -ru kdepim-3.5.0/kmail/kmsystemtray.h kdepim-3.5.0_new/kmail/kmsystemtray.h >--- kdepim-3.5.0/kmail/kmsystemtray.h 2005-09-10 11:24:02.000000000 +0300 >+++ kdepim-3.5.0_new/kmail/kmsystemtray.h 2005-11-29 15:55:13.000000000 +0200 >@@ -60,7 +60,6 @@ > > protected: > void mousePressEvent(QMouseEvent *); >- bool mainWindowIsOnCurrentDesktop(); > void showKMail(); > void buildPopupMenu(); > void updateCount();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 137394
: 89642 |
89643
|
89649