aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2013-12-13 22:39:13 +0000
committerokan2013-12-13 22:39:13 +0000
commit2f199b5ad84adda4a8b7d72b78529d68ec037786 (patch)
tree9a52007e2980e107873674841b7b4a7d6d5096a4 /screen.c
parentab7c1ffd6e208c0d7bfd9e1ca4be0eecbfac1b40 (diff)
downloadcwm-2f199b5ad84adda4a8b7d72b78529d68ec037786.tar.gz
Teach screen_find_xinerama() to apply gap only when told to do so;
adjust callers. Needed for an upcoming feature.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/screen.c b/screen.c
index dce4065..11ff286 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.52 2013/06/17 17:11:10 okan Exp $
+ * $OpenBSD: screen.c,v 1.53 2013/12/13 22:39:13 okan Exp $
*/
#include <sys/param.h>
@@ -126,7 +126,7 @@ screen_updatestackingorder(struct screen_ctx *sc)
* Find which xinerama screen the coordinates (x,y) is on.
*/
struct geom
-screen_find_xinerama(struct screen_ctx *sc, int x, int y)
+screen_find_xinerama(struct screen_ctx *sc, int x, int y, int flags)
{
XineramaScreenInfo *info;
struct geom geom;
@@ -141,13 +141,19 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y)
info = &sc->xinerama[i];
if (x >= info->x_org && x < info->x_org + info->width &&
y >= info->y_org && y < info->y_org + info->height) {
- geom.x = info->x_org + sc->gap.left;
- geom.y = info->y_org + sc->gap.top;
- geom.w = info->width - (sc->gap.left + sc->gap.right);
- geom.h = info->height - (sc->gap.top + sc->gap.bottom);
+ geom.x = info->x_org;
+ geom.y = info->y_org;
+ geom.w = info->width;
+ geom.h = info->height;
break;
}
}
+ if (flags & CWM_GAP) {
+ geom.x += sc->gap.left;
+ geom.y += sc->gap.top;
+ geom.w -= (sc->gap.left + sc->gap.right);
+ geom.h -= (sc->gap.top + sc->gap.bottom);
+ }
return (geom);
}