[hackers] [wmii] Fix column dividers with Xinerama || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 21 Oct 2008 23:17:17 +0000 (UTC)

changeset: 2400:fa1019c1090e
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Oct 21 19:17:16 2008 -0400
files: cmd/wmii/dat.h cmd/wmii/div.c cmd/wmii/mouse.c
description:
Fix column dividers with Xinerama

diff -r a3d399b276d4 -r fa1019c1090e cmd/wmii/dat.h
--- a/cmd/wmii/dat.h Tue Oct 21 11:19:12 2008 -0400
+++ b/cmd/wmii/dat.h Tue Oct 21 19:17:16 2008 -0400
@@ -193,6 +193,8 @@
 struct Divide {
         Divide* next;
         Window* w;
+ Area* left;
+ Area* right;
         bool mapped;
         int x;
 };
diff -r a3d399b276d4 -r fa1019c1090e cmd/wmii/div.c
--- a/cmd/wmii/div.c Tue Oct 21 11:19:12 2008 -0400
+++ b/cmd/wmii/div.c Tue Oct 21 19:17:16 2008 -0400
@@ -50,12 +50,14 @@
 void
 div_set(Divide *d, int x) {
         Rectangle r;
+ int scrn;
+
+ scrn = d->left ? d->left->screen : d->right->screen;
 
         d->x = x;
         r = rectaddpt(divimg->r, Pt(x - Dx(divimg->r)/2, 0));
- /* XXX: Multihead. */
- r.min.y = selview->screenr.min.y;
- r.max.y = selview->screenr.max.y;
+ r.min.y = selview->r[scrn].min.y;
+ r.max.y = selview->r[scrn].max.y;
 
         reshapewin(d->w, r);
         mapdiv(d);
@@ -117,7 +119,7 @@
 void
 div_update_all(void) {
         Divide **dp, *d;
- Area *a;
+ Area *a, *ap;
         View *v;
         int s;
 
@@ -125,14 +127,20 @@
 
         v = selview;
         dp = &divs;
+ ap = nil;
         foreach_column(v, s, a) {
                 d = getdiv(dp);
                 dp = &d->next;
+ d->left = ap;
+ d->right = a;
                 div_set(d, a->r.min.x);
+ ap = a;
 
                 if(!a->next) {
                         d = getdiv(dp);
                         dp = &d->next;
+ d->left = a;
+ d->right = nil;
                         div_set(d, a->r.max.x);
                 }
         }
diff -r a3d399b276d4 -r fa1019c1090e cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Tue Oct 21 11:19:12 2008 -0400
+++ b/cmd/wmii/mouse.c Tue Oct 21 19:17:16 2008 -0400
@@ -315,22 +315,15 @@
 void
 mouse_resizecol(Divide *d) {
         Window *cwin;
- Divide *dp;
         View *v;
         Area *a;
         Rectangle r;
         Point pt;
- int minw, s;
+ int minw;
 
         v = selview;
 
- dp = divs;
- foreach_column(v, s, a) {
- if(dp->next == d)
- break;
- dp = dp->next;
- }
-
+ a = d->left;
         /* Fix later */
         if(a == nil || a->next == nil)
                 return;
Received on Tue Oct 21 2008 - 23:17:17 UTC

This archive was generated by hypermail 2.2.0 : Tue Oct 21 2008 - 23:24:03 UTC