[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kpager
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2003-07-28 15:48:56
[Download RAW message or body]

CVS commit by lunakl: 

Better error detection from KWin::WindowInfo. I removed the check
for desktop == 0, as now it really really shouldn't happen. I left
an assert() there though, just in case I'm wrong.
CCMAIL: neundorf@kde.org


  M +8 -15     kpager.cpp   1.58


--- kdebase/kpager/kpager.cpp  #1.57:1.58
@@ -59,4 +59,5 @@
 #include <qpopupmenu.h>
 #include <kpopupmenu.h>
+#include <assert.h>
 
 KPagerMainWindow::KPagerMainWindow(QWidget *parent, const char *name)
@@ -380,20 +381,12 @@ KWin::WindowInfo* KPager::info( WId win 
     if (!info )
     {
-        // check if window is valid or not
-        XWindowAttributes attr;
-        bool bIsValid = XGetWindowAttributes(qt_xdisplay(), win, &attr);
-
-        if (bIsValid)
-        {
             info = new KWin::WindowInfo( KWin::windowInfo( win ) );
-            if (info->desktop() ==0)
+        if( !info->valid())
             {
-               kdDebug()<<"KPager::info("<<win<<") KWin::Info() returned desktop==0 !"<<endl;
                delete info;
-               info=0;
+            return NULL; // window no longer valid
             }
-            else
+        assert( info->desktop() !=0 );
                m_windows.insert( (long) win, info );
-        }
     }
     return info;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic