[hackers] [wmii] Add XRandR support.

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Jan 21 00:31:09 2008

changeset: 2236:184693ca0dde
user: Kris Maglione <jg_AT_suckless.org>
date: Sat Jan 19 20:05:10 2008 -0500
summary: Add XRandR support.

diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/Makefile
--- a/cmd/wmii/Makefile Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/Makefile Sat Jan 19 20:05:10 2008 -0500
@@ -8,7 +8,7 @@ HFILES= dat.h fns.h
 HFILES= dat.h fns.h
 
 LIB = ${LIBIXP}
-LDFLAGS += -lm ${LIBX11} -lXext ${LIBICONV} -lregexp9 -lbio -lfmt -lutf
+LDFLAGS += -lm ${LIBX11} -lXext -lXrandr ${LIBICONV} -lregexp9 -lbio -lfmt -lutf
 CFLAGS += ${INCX11} ${INCICONV} -DVERSION=\"${VERSION}\" \
           -DIXP_NEEDAPI=86
 OBJ = area \
@@ -32,6 +32,7 @@ OBJ = area \
         utf \
         view \
         x11 \
+ xext \
         ../util
 
 include ${ROOT}/mk/one.mk
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/event.c
--- a/cmd/wmii/event.c Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/event.c Sat Jan 19 20:05:10 2008 -0500
@@ -12,6 +12,8 @@ dispatch_event(XEvent *e) {
                 printevent(e);
         if(e->type < nelem(handler) && handler[e->type])
                 handler[e->type](e);
+ else
+ xext_event(e);
 }
 
 #define handle(w, fn, ev) \
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/fns.h Sat Jan 19 20:05:10 2008 -0500
@@ -203,3 +203,9 @@ char* toutf8(const char*);
 char* toutf8(const char*);
 char* toutf8n(const char*, size_t);
 
+/* xext.c */
+void randr_event(XEvent*);
+void randr_init(void);
+void xext_event(XEvent*);
+void xext_init(void);
+
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/frame.c Sat Jan 19 20:05:10 2008 -0500
@@ -500,6 +500,13 @@ frame_draw(Frame *f) {
                 border(screen->ibuf, r, 1, col->border);
         }
 
+ /* Border increment gaps... */
+ r.min.y = f->crect.min.y;
+ r.min.x = max(1, f->crect.min.x - 1);
+ r.max.x = min(fr.max.x - 1, f->crect.max.x + 1);
+ r.max.y = min(fr.max.y - 1, f->crect.max.y + 1);
+ border(screen->ibuf, r, 1, col->border);
+
         /* Why? Because some non-ICCCM-compliant apps feel the need to
          * change the background properties of all of their ancestor windows
          * in order to implement pseudo-transparency.
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/main.c
--- a/cmd/wmii/main.c Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/main.c Sat Jan 19 20:05:10 2008 -0500
@@ -427,6 +427,7 @@ main(int argc, char *argv[]) {
         init_cursors();
         init_lock_keys();
         ewmh_init();
+ xext_init();
 
         srv.preselect = check_preselect;
         ixp_listen(&srv, sock, &p9srv, serve_9pcon, nil);
@@ -466,11 +467,11 @@ main(int argc, char *argv[]) {
 
         screen->focus = nil;
         setfocus(screen->barwin, RevertToParent);
+ view_select("1");
 
         scan_wins();
         starting = false;
 
- view_select("nil");
         view_update_all();
         ewmh_updateviews();
 
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/mouse.c Sat Jan 19 20:05:10 2008 -0500
@@ -395,7 +395,7 @@ mouse_resizecolframe(Frame *f, Align ali
                 d = d->next;
 
         min.x = Dx(v->r)/NCOL;
- min.y = frame_delta_h() + labelh(def.font);
+ min.y = /*frame_delta_h() +*/ labelh(def.font);
         if(align&NORTH) {
                 if(f->aprev) {
                         r.min.y = f->aprev->r.min.y + min.y;
diff -r 39545a2ab9aa -r 184693ca0dde cmd/wmii/x11.c
--- a/cmd/wmii/x11.c Sat Jan 19 18:23:52 2008 -0500
+++ b/cmd/wmii/x11.c Sat Jan 19 20:05:10 2008 -0500
@@ -343,6 +343,7 @@ winprotocols(Window *w) {
 /* Shape */
 void
 setshapemask(Window *dst, Image *src, Point pt) {
+ /* Assumes that we have the shape extension... */
         XShapeCombineMask (display, dst->w,
                 ShapeBounding, pt.x, pt.y, src->image, ShapeSet);
 }
diff -r 39545a2ab9aa -r 184693ca0dde include/x11.h
--- a/include/x11.h Sat Jan 19 18:23:52 2008 -0500
+++ b/include/x11.h Sat Jan 19 20:05:10 2008 -0500
@@ -9,6 +9,7 @@
 #ifdef _X11_VISIBLE
 # include <X11/Xatom.h>
 # include <X11/extensions/shape.h>
+# include <X11/extensions/Xrandr.h>
 #endif
 #undef Window
 #undef Font
Received on Mon Jan 21 2008 - 00:31:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:59:00 UTC