[haiku-commits] r38168 - haiku/trunk/src/servers/app

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 17 Aug 2010 08:23:06 +0200 (CEST)

Author: czeidler
Date: 2010-08-17 08:23:06 +0200 (Tue, 17 Aug 2010)
New Revision: 38168
Changeset: http://dev.haiku-os.org/changeset/38168

Modified:
   haiku/trunk/src/servers/app/Desktop.cpp
   haiku/trunk/src/servers/app/Desktop.h
Log:
Add function to find a window in the app server by the client looper port id. 
Need this for the stacking api e.g. to stack window x on window y.



Modified: haiku/trunk/src/servers/app/Desktop.cpp
===================================================================
--- haiku/trunk/src/servers/app/Desktop.cpp     2010-08-17 06:12:30 UTC (rev 
38167)
+++ haiku/trunk/src/servers/app/Desktop.cpp     2010-08-17 06:23:06 UTC (rev 
38168)
@@ -2484,6 +2484,18 @@
 }
 
 
+Window*
+Desktop::WindowForClientLooperPort(port_id port)
+{
+       for (Window* window = fAllWindows.FirstWindow(); window != NULL;
+                       window = window->NextWindow(kAllWindowList)) {
+               if (window->ServerWindow()->ClientLooperPort() == port)
+                       return window;
+       }
+       return NULL;
+}
+
+
 WindowList&
 Desktop::_Windows(int32 index)
 {

Modified: haiku/trunk/src/servers/app/Desktop.h
===================================================================
--- haiku/trunk/src/servers/app/Desktop.h       2010-08-17 06:12:30 UTC (rev 
38167)
+++ haiku/trunk/src/servers/app/Desktop.h       2010-08-17 06:23:06 UTC (rev 
38168)
@@ -260,6 +260,8 @@
                        WindowList&                     CurrentWindows();
                        WindowList&                     AllWindows();
 
+                       Window*                         
WindowForClientLooperPort(port_id port);
+
 private:
                        WindowList&                     _Windows(int32 index);
 


Other related posts: