diff --git a/src/init.c b/src/init.c index 03e3783..3323fd1 100644 --- a/src/init.c +++ b/src/init.c @@ -89,10 +89,17 @@ init_gc(void) gc = DefaultGC(dpy, SCREEN); + /* Stipple GC */ gcv.function = GXcopy; gcv.fill_style = FillStippled; gcv.stipple = XCreateBitmapFromData(dpy, ROOT, pix_bits, 10, 4); - gc_stipple = XCreateGC(dpy, ROOT, GCFunction|GCFillStyle|GCStipple, &gcv); + gc_stipple = XCreateGC(dpy, ROOT, GCFunction | GCFillStyle | GCStipple, &gcv); + + /* Reverse GC */ + gcv.function = GXinvert; + gcv.line_width = BORDH; + gcv.subwindow_mode = IncludeInferiors; + gc_reverse = XCreateGC(dpy, ROOT, GCFunction | GCLineWidth | GCSubwindowMode, &gcv); return; } @@ -135,7 +142,7 @@ init_root(void) { XSetWindowAttributes at; - at.event_mask = KeyMask | ButtonMask | MouseMask + at.event_mask = KeyMask | ButtonMask | MouseMask | PropertyChangeMask | SubstructureRedirectMask | SubstructureNotifyMask | StructureNotifyMask; at.cursor = cursor[CurNormal]; diff --git a/src/mouse.c b/src/mouse.c index db77eef..37f5a55 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -121,8 +121,6 @@ mouse_move(Client *c) void mouse_resize(Client *c) { - int ocx = c->geo.x; - int ocy = c->geo.y; XRectangle geo = c->geo; XEvent ev; Window w; @@ -138,10 +136,6 @@ mouse_resize(Client *c) if(XGrabPointer(dpy, ROOT, False, MouseMask, GrabModeAsync, GrabModeAsync, None, cursor[CurResize], CurrentTime) != GrabSuccess) return; - - if(!c->tile) - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height); - do { XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev); @@ -166,11 +160,23 @@ mouse_resize(Client *c) } else if(!c->tile) { - geo.width = ((ev.xmotion.x - ocx < 1) ? 1 : ev.xmotion.x - ocx); - geo.height = ((ev.xmotion.y - ocy < 1) ? 1 : ev.xmotion.y - ocy); + if((geo.width + ev.xmotion.x_root - omx) > 1) + geo.width += ev.xmotion.x_root - omx; + if((geo.height + ev.xmotion.y_root - omy) > 1) + geo.height += ev.xmotion.y_root - omy; + + omx = ev.xmotion.x_root; + omy = ev.xmotion.y_root; if(!conf.resize_transparent) client_moveresize(c, geo, True); + else + { + XClearWindow(dpy, c->win); + XClearWindow(dpy, ROOT); + frame_update(c); + XDrawRectangles(dpy, ROOT, gc_reverse, &geo, 1); + } XSync(dpy, False); } @@ -182,10 +188,7 @@ mouse_resize(Client *c) while(ev.type != ButtonRelease); if(!c->tile) - { client_moveresize(c, geo, True); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height); - } else tags[selscreen][seltag[selscreen]].layout.func(c->screen); diff --git a/src/wmfs.h b/src/wmfs.h index 6785ec8..87eef6d 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -308,7 +308,7 @@ void uicb_reload(uicb_t); /* Principal */ Display *dpy; -GC gc, gc_stipple; +GC gc, gc_stipple, gc_reverse; int selscreen; Conf conf; Key *keys; diff --git a/wmfs.1 b/wmfs.1 index 038fe04..c36cf84 100644 --- a/wmfs.1 +++ b/wmfs.1 @@ -1,5 +1,5 @@ .\" Title: wmfs -.\" Author: +.\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 .\" Date: 04/22/2009 .\" Manual: manual of wmfs @@ -13,24 +13,34 @@ .SH "NAME" wmfs \- Window Manager From Scratch .SH "SYNOPSIS" -\fBwmfs\fR [\fB\-v\fR | \fB\-\-version\fR] [\fB\-h\fR | \fB\-\-help\fR] [ \fB\-i\fR | \fB\-\-info\fR] +\fBwmfs\fR [\fB\-v\fR] [\fB\-h\fR] [\fB\-i\fR] [\fB\-c \fR] [\fB\-s \fR] .sp .SH "DESCRIPTION" \fBWMFS\fR is a basic, lightweight and dynamic tiling windows manager for X\&. .sp .SH "OPTIONS" .PP -\fB\-v\fR, \fB\-\-version\fR +\fB\-c \fR +.RS 4 +Execute an uicb function to control WMFS\&. +.RE +.PP +\fB\-s \fR +.RS 4 +Set the bar(s) statustext\&. +.RE +.PP +\fB\-v\fR .RS 4 Print version information to standard output, then exit\&. .RE .PP -\fB\-h\fR, \fB\-\-help\fR +\fB\-h\fR .RS 4 Print help information, then exit\&. .RE .PP -\fB\-i\fR, \fB\-\-info\fR +\fB\-i\fR .RS 4 Print WMFS informations .RE @@ -157,7 +167,7 @@ WMFS is configured by \fI$HOME/\&.config/wmfs/wmfsrc\fR\&. WMFS isn\'t stable for now\&. So it certainly contains some bugs\&. .sp .SH "AUTHORS" -Martin Duquesnoy <\fIxorg62@gmail\&.com\fR\&[1]> for the code\&. +Martin Duquesnoy <\fIxorg62@gmail\&.com\fR\&[1]>\&. .sp .SH "WWW" Main site: \fIhttp://wmfs\&.malikania\&.org\fR Bug tracker: \fIhttp://wmfs\&.malikania\&.org/projects/wmfs/issues\fR