[gtk+] [broadway] Store surface, not id in stackingOrder list



commit c839f2910c34f82344c42ee96ddbad5dc54297d0
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Apr 11 10:53:11 2011 +0200

    [broadway] Store surface, not id in stackingOrder list

 gdk/broadway/broadway.js |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 3494c78..95b1572 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -375,7 +375,7 @@ function cmdCreateSurface(id, x, y, width, height, isTemp)
     surface.document = document;
     surface.transientToplevel = null;
     surface.frame = null;
-    stackingOrder.push(id);
+    stackingOrder.push(surface);
 
     var canvas = document.createElement("canvas");
     canvas.width = width;
@@ -535,8 +535,7 @@ function restackWindows() {
 	return;
 
     for (var i = 0; i < stackingOrder.length; i++) {
-	var id = stackingOrder[i];
-	var surface = surfaces[id];
+	var surface = stackingOrder[i];
 	if (surface.frame)
 	    surface.frame.style.zIndex = i;
 	else
@@ -545,9 +544,9 @@ function restackWindows() {
 }
 
 function moveToTopHelper(surface) {
-    var i = stackingOrder.indexOf(surface.id);
+    var i = stackingOrder.indexOf(surface);
     stackingOrder.splice(i, 1);
-    stackingOrder.push(surface.id);
+    stackingOrder.push(surface);
 
     for (var cid in surfaces) {
 	var child = surfaces[cid];
@@ -565,7 +564,7 @@ function moveToTop(surface) {
 function cmdDeleteSurface(id)
 {
     var surface = surfaces[id];
-    var i = stackingOrder.indexOf(id);
+    var i = stackingOrder.indexOf(surface);
     if (i >= 0)
 	stackingOrder.splice(i, 1);
     var canvas = surface.canvas;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]