soc.2008.finch: f24455dd: Reverse the window border when moving or...

queueram at soc.pidgin.im queueram at soc.pidgin.im
Mon Sep 27 14:05:43 EDT 2010


----------------------------------------------------------------------
Revision: f24455dd503dbd74c70dae84bcb583bd9fbfff0d
Parent:   6e1a62aa36297645b5635b55326bd8ce64221abc
Author:   queueram at soc.pidgin.im
Date:     09/27/10 14:01:15
Branch:   im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/f24455dd503dbd74c70dae84bcb583bd9fbfff0d

Changelog: 

Reverse the window border when moving or resizing to provide feedback to
the user as to which mode the window manager is in.

Changes against parent 6e1a62aa36297645b5635b55326bd8ce64221abc

  patched  finch/libgnt/wms/tiling.c

-------------- next part --------------
============================================================
--- finch/libgnt/wms/tiling.c	f3cddb78c23d6e85fe5892e5b73574a6428c4281
+++ finch/libgnt/wms/tiling.c	daad88502f305964388bdcc551181c439b0b2aed
@@ -103,6 +103,16 @@ static void
 static void (*org_give_focus)(GntWM *wm, GntWidget *win);
 
 static void
+twm_ensure_normal_mode(GntWM *wm)
+{
+	TilingWM *twm = (TilingWM*)wm;
+	if (wm->mode != GNT_KP_MODE_NORMAL) {
+		gnt_wm_window_reverse(wm, GNT_WIDGET(g_queue_peek_head(twm->current->windows)), FALSE);
+		wm->mode = GNT_KP_MODE_NORMAL;
+	}
+}
+
+static void
 twm_hide_window(GntWM *wm, GntWidget *win)
 {
 	gnt_ws_widget_hide(win, wm->nodes);
@@ -252,7 +262,7 @@ twm_set_next_window_in_current(GntWM *wm
 			next_win = g_queue_pop_tail(twm->current->windows);
 			g_queue_push_head(twm->current->windows, next_win);
 		}
-
+		twm_ensure_normal_mode(wm);
 		/* hide previous window */
 		twm_hide_window(wm, cur_win);
 
@@ -464,6 +474,7 @@ tiling_wm_give_focus(GntWM *wm, GntWidge
 	if (win != g_queue_peek_head(twm->current->windows) && !GNT_IS_MENU(win)) {
 		frame = find_frame_by_window(twm, win);
 		if (frame) {
+		   twm_ensure_normal_mode(wm);
 			twm->current = frame;
 			/* move the window to the front of the queue */
 			twm_front_window(frame->windows, win);
@@ -826,6 +837,7 @@ twm_move_left_up(GntBindable *bindable, 
 		} else { /* up */
 			left = find_closest_horizontal_child(left, twm->current);
 		}
+		twm_ensure_normal_mode(wm);
 		twm->current = left;
 		if ((win = g_queue_peek_head(twm->current->windows))) {
 			gnt_wm_raise_window(wm, win);
@@ -852,6 +864,7 @@ twm_move_right_down(GntBindable *bindabl
 		} else { /* down */
 			right = find_closest_horizontal_child(right, twm->current);
 		}
+		twm_ensure_normal_mode(wm);
 		twm->current = right;
 		if ((win = g_queue_peek_head(twm->current->windows))) {
 			gnt_wm_raise_window(wm, win);
@@ -933,6 +946,7 @@ twm_exchange_left_up(GntWM *wm, int type
 		} else { /* up */
 			left = find_closest_horizontal_child(left, twm->current);
 		}
+		twm_ensure_normal_mode(wm);
 		/* exchange the windows */
 		left_win = g_queue_pop_head(left->windows);
 		if (left_win) {
@@ -974,6 +988,7 @@ twm_exchange_right_down(GntWM *wm, int t
 		} else { /* down */
 			right = find_closest_horizontal_child(right, twm->current);
 		}
+		twm_ensure_normal_mode(wm);
 		/* exchange the windows */
 		right_win = g_queue_pop_head(right->windows);
 		if (right_win) {
@@ -1014,6 +1029,8 @@ twm_resize_move_start(GntBindable *binda
 
 	wm->mode = mode;
 
+	gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), TRUE);
+
 	return TRUE;
 }
 
@@ -1101,6 +1118,7 @@ twm_resize_move(GntBindable *bindable, G
 					break;
 			}
 		}
+      gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), TRUE);
 		return TRUE;
 	} else if (wm->mode == GNT_KP_MODE_MOVE) {
 		/* move mode */
@@ -1118,6 +1136,7 @@ twm_resize_move(GntBindable *bindable, G
 				twm_move_win_right_down(wm, FRAME_SPLIT_V);
 				break;
 		}
+      gnt_wm_window_reverse(wm, GNT_WIDGET(wm->cws->ordered->data), TRUE);
 		return TRUE;
 	}
 


More information about the Commits mailing list