soc.2008.finch: df619a29: Partially fixed instance where window th...

queueram at soc.pidgin.im queueram at soc.pidgin.im
Fri Sep 12 01:00:29 EDT 2008


-----------------------------------------------------------------
Revision: df619a2980a528cd192c2234c7e2a7930ec1df06
Ancestor: 38f358c3dd5820d208950ef215dcc4b00c5d9e3e
Author: queueram at soc.pidgin.im
Date: 2008-09-12T04:55:12
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/df619a2980a528cd192c2234c7e2a7930ec1df06

Modified files:
        finch/libgnt/wms/tiling.c

ChangeLog: 

Partially fixed instance where window that wasn't in current frame is closed.

-------------- next part --------------
============================================================
--- finch/libgnt/wms/tiling.c	ccaf4ecc079deeb0ccd103329794f9cb263a7633
+++ finch/libgnt/wms/tiling.c	c98478839b9e9d2a1302f891e5fe2d5c1b465894
@@ -328,23 +328,25 @@ tiling_wm_close_window(GntWM *wm, GntWid
 tiling_wm_close_window(GntWM *wm, GntWidget *win)
 {
 	TilingWM *twm = (TilingWM*)wm;
-	GntWidget *w, *wid;
+	GntWidget *wid;
 
-	w = wm->cws->ordered->data;
-	wid = get_next_window(wm, w, 1);
+	/* TODO: if it isn't current->window, need to search the tree for it */
+	if (win == twm->current->window) {
+		wid = get_next_window(wm, win, 1);
 
-	if (wid != twm->current->window) {
-		/* hide previous window */
-		if (twm->current->window) {
-			twm_hide_window(wm, twm->current->window);
-		}
+		if (wid != twm->current->window) {
+			/* hide previous window */
+			if (twm->current->window) {
+				twm_hide_window(wm, twm->current->window);
+			}
 
-		/* show new window */
-		twm->current->window = wid;
-		if (wid) {
-			twm_show_window_in_frame(wm, wid, twm->current);
-			window_reverse(wid, TRUE, wm);
-			gnt_wm_raise_window(wm, wid);
+			/* show new window */
+			twm->current->window = wid;
+			if (wid) {
+				twm_show_window_in_frame(wm, wid, twm->current);
+				window_reverse(wid, TRUE, wm);
+				gnt_wm_raise_window(wm, wid);
+			}
 		}
 	}
 
@@ -470,8 +472,11 @@ twm_split(GntBindable *bindable, GList *
 		twm_show_window_in_frame(wm, rgt_bot->window, rgt_bot);
 	}
 
-	twm_move_window_to_frame(twm->current->window, twm->current);
-	window_reverse(twm->current->window, TRUE, wm);
+	if (twm->current->window) {
+		twm_move_window_to_frame(twm->current->window, twm->current);
+		window_reverse(twm->current->window, TRUE, wm);
+		gnt_wm_raise_window(wm, twm->current->window);
+	}
 
 	return TRUE;
 }


More information about the Commits mailing list