aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2015-11-11 14:22:01 +0000
committerokan2015-11-11 14:22:01 +0000
commitf6f5e0fe9eb0a0ce66ee5d0720182bfadf2cf800 (patch)
tree55799ebc2fe2f87b956e1440a0b2ce413bbffe64 /screen.c
parent29e76eaac34fcdbc70eaccb72c3f68b638a4c5b2 (diff)
downloadcwm-f6f5e0fe9eb0a0ce66ee5d0720182bfadf2cf800.tar.gz
Partial revert of replacing screen_area() with region_find(); until a
fix for a regression is found; this bug has been around for a long time it seems, but this change exposed it. Likely need to track clients in to and out of regions.
Diffstat (limited to '')
-rw-r--r--screen.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index eb52404..e1f5fe8 100644
--- a/screen.c
+++ b/screen.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: screen.c,v 1.78 2015/11/09 20:03:30 okan Exp $
+ * $OpenBSD: screen.c,v 1.79 2015/11/11 14:22:01 okan Exp $
*/
#include <sys/types.h>
@@ -138,6 +138,24 @@ region_find(struct screen_ctx *sc, int x, int y)
return(rc);
}
+struct geom
+screen_area(struct screen_ctx *sc, int x, int y, int flags)
+{
+ struct region_ctx *rc;
+ struct geom area = sc->work;
+
+ TAILQ_FOREACH(rc, &sc->regionq, entry) {
+ if ((x >= rc->area.x) && (x < (rc->area.x + rc->area.w)) &&
+ (y >= rc->area.y) && (y < (rc->area.y + rc->area.h))) {
+ area = rc->area;
+ break;
+ }
+ }
+ if (flags & CWM_GAP)
+ area = screen_apply_gap(sc, area);
+ return(area);
+}
+
void
screen_update_geometry(struct screen_ctx *sc)
{
@@ -171,6 +189,10 @@ screen_update_geometry(struct screen_ctx *sc)
rc = xmalloc(sizeof(*rc));
rc->num = i;
+ rc->area.x = ci->x;
+ rc->area.y = ci->y;
+ rc->area.w = ci->width;
+ rc->area.h = ci->height;
rc->view.x = ci->x;
rc->view.y = ci->y;
rc->view.w = ci->width;