[hackers] [wmii] Fix scrolling across Xinerama screens via keyboard. Fixes issue #126. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Fri, 2 Oct 2009 06:52:06 +0000 (UTC)

changeset: 2511:3c5a74149fb8
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Oct 02 02:48:25 2009 -0400
files: cmd/wmii/screen.c
description:
Fix scrolling across Xinerama screens via keyboard. Fixes issue #126.

diff -r 05dcc069deb5 -r 3c5a74149fb8 cmd/wmii/screen.c
--- a/cmd/wmii/screen.c Fri Oct 02 02:30:28 2009 -0400
+++ b/cmd/wmii/screen.c Fri Oct 02 02:48:25 2009 -0400
@@ -81,16 +81,13 @@
 
 static Rectangle
 leastthing(Rectangle rect, int direction, Vector_ptr *vec, Rectangle (*key)(void*)) {
- void *p;
         Rectangle r;
- Point pt;
         int i, best, d;
 
         SET(d);
         SET(best);
         for(i=0; i < vec->n; i++) {
- p = vec->ary[i];
- r = key(p);
+ r = key(vec->ary[i]);
                 switch(direction) {
                 case South: d = r.min.y; break;
                 case North: d = -r.max.y; break;
@@ -100,14 +97,13 @@
                 if(i == 0 || d < best)
                         best = d;
         }
- pt = rect.min;
         switch(direction) {
- case South: pt.y = best - Dy(rect); break;
- case North: pt.y = -best + Dy(rect); break;
- case East: pt.x = best - Dy(rect); break;
- case West: pt.x = -best + Dy(rect); break;
+ case South: rect.min.y = rect.max.y = best; break;
+ case North: rect.min.y = rect.max.y = -best; break;
+ case East: rect.min.x = rect.max.x = best; break;
+ case West: rect.min.x = rect.max.x = -best; break;
         }
- return rectsetorigin(rect, pt);
+ return rect;
 }
 
 void*
Received on Fri Oct 02 2009 - 06:52:06 UTC

This archive was generated by hypermail 2.2.0 : Fri Oct 02 2009 - 07:00:13 UTC