soc.2008.finch: 6a0b12dc: Force windows to be the size of the fram...

queueram at soc.pidgin.im queueram at soc.pidgin.im
Sat Sep 13 20:30:23 EDT 2008


-----------------------------------------------------------------
Revision: 6a0b12dc429ffe000895be6b8c22311c72261b11
Ancestor: a05f9beb4f4326b43841b54148c70d661be50b5b
Author: queueram at soc.pidgin.im
Date: 2008-09-14T00:27:45
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/6a0b12dc429ffe000895be6b8c22311c72261b11

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

ChangeLog: 

Force windows to be the size of the frame they reside in.  I worry this may
produce unexpected behavior with some windows that assume control over
their size and position.

-------------- next part --------------
============================================================
--- finch/libgnt/wms/tiling.c	5ced04751285c54cda74f803c6403cb7cbf49408
+++ finch/libgnt/wms/tiling.c	8e9cd695ca8b10dc3a10a8f89848e36a9368f7c2
@@ -343,13 +343,39 @@ tiling_wm_window_move_confirm(GntWM *wm,
 static gboolean
 tiling_wm_window_move_confirm(GntWM *wm, GntWidget *win, int *x, int *y)
 {
-	return TRUE;
+	TilingWM *twm = (TilingWM*)wm;
+	TilingFrame *frame;
+
+	if (twm->current->window == win) {
+		frame = twm->current;
+	} else {
+		frame = find_frame_by_window(&twm->root, win);
+	}
+
+	if (!frame || (*x == frame->x && *y == frame->y)) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
 }
 
 static gboolean
 tiling_wm_window_resize_confirm(GntWM *wm, GntWidget *win, int *w, int *h)
 {
-	return TRUE;
+	TilingWM *twm = (TilingWM*)wm;
+	TilingFrame *frame;
+
+	if (twm->current->window == win) {
+		frame = twm->current;
+	} else {
+		frame = find_frame_by_window(&twm->root, win);
+	}
+
+	if (!frame || (*w == frame->width && *h == frame->height)) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
 }
 
 static gboolean


More information about the Commits mailing list