[haiku-development] Re: WindowAt fix

  • From: Varadi Zsolt Gyula <karmaxxl@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 01 Aug 2007 08:55:50 +0200

2007. 07. 31, kedd keltezéssel 23.51-kor Axel Dörfler ezt írta:
> Sorry, the patch doesn't fix WindowAt() - it just breaks it in a 
> different way that happen to solve the one problem you were observing.
> I've fixed it now for real with r21777. Thanks for hinting in the right 
> direction, though :-)
> 
> Bye,
>    Axel.
> 
> 

Thanks >.<

I've updated _CountWindows() with your fix as well. And I think the not
operator is not needed in _WindowAt, so I deleted it.

Greetings,
Zsolt
Index: src/kits/app/Application.cpp
===================================================================
--- src/kits/app/Application.cpp        (revision 21778)
+++ src/kits/app/Application.cpp        (working copy)
@@ -1441,8 +1441,8 @@
        uint32 count = 0;
        for (int32 i = 0; i < gLooperList.CountLoopers(); i++) {
                BWindow* window = 
dynamic_cast<BWindow*>(gLooperList.LooperAt(i));
-               if (window != NULL && (includeMenus
-                               || dynamic_cast<BMenuWindow *>(window) == 
NULL)) {
+               if (window != NULL || (includeMenus
+                               && dynamic_cast<BMenuWindow *>(window) != 
NULL)) {
                        count++;
                }
        }
@@ -1461,7 +1461,7 @@
        uint32 count = gLooperList.CountLoopers();
        for (uint32 i = 0; i < count && index < count; i++) {
                BWindow* window = 
dynamic_cast<BWindow*>(gLooperList.LooperAt(i));
-               if (window == NULL || (!includeMenus
+               if (window == NULL || (includeMenus
                                && dynamic_cast<BMenuWindow *>(window) != 
NULL)) {
                        index++;
                        continue;

Other related posts: