Man: Add -c/-s option in man.

This commit is contained in:
Martin Duquesnoy 2009-04-23 14:25:05 +02:00
parent 3e69e6455d
commit e760c2bc7a
4 changed files with 40 additions and 20 deletions

View File

@ -89,10 +89,17 @@ init_gc(void)
gc = DefaultGC(dpy, SCREEN); gc = DefaultGC(dpy, SCREEN);
/* Stipple GC */
gcv.function = GXcopy; gcv.function = GXcopy;
gcv.fill_style = FillStippled; gcv.fill_style = FillStippled;
gcv.stipple = XCreateBitmapFromData(dpy, ROOT, pix_bits, 10, 4); 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; return;
} }
@ -135,7 +142,7 @@ init_root(void)
{ {
XSetWindowAttributes at; XSetWindowAttributes at;
at.event_mask = KeyMask | ButtonMask | MouseMask at.event_mask = KeyMask | ButtonMask | MouseMask | PropertyChangeMask
| SubstructureRedirectMask | SubstructureNotifyMask | StructureNotifyMask; | SubstructureRedirectMask | SubstructureNotifyMask | StructureNotifyMask;
at.cursor = cursor[CurNormal]; at.cursor = cursor[CurNormal];

View File

@ -121,8 +121,6 @@ mouse_move(Client *c)
void void
mouse_resize(Client *c) mouse_resize(Client *c)
{ {
int ocx = c->geo.x;
int ocy = c->geo.y;
XRectangle geo = c->geo; XRectangle geo = c->geo;
XEvent ev; XEvent ev;
Window w; Window w;
@ -138,10 +136,6 @@ mouse_resize(Client *c)
if(XGrabPointer(dpy, ROOT, False, MouseMask, GrabModeAsync, GrabModeAsync, if(XGrabPointer(dpy, ROOT, False, MouseMask, GrabModeAsync, GrabModeAsync,
None, cursor[CurResize], CurrentTime) != GrabSuccess) None, cursor[CurResize], CurrentTime) != GrabSuccess)
return; return;
if(!c->tile)
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height);
do do
{ {
XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev); XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev);
@ -166,11 +160,23 @@ mouse_resize(Client *c)
} }
else if(!c->tile) else if(!c->tile)
{ {
geo.width = ((ev.xmotion.x - ocx < 1) ? 1 : ev.xmotion.x - ocx); if((geo.width + ev.xmotion.x_root - omx) > 1)
geo.height = ((ev.xmotion.y - ocy < 1) ? 1 : ev.xmotion.y - ocy); 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) if(!conf.resize_transparent)
client_moveresize(c, geo, True); 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); XSync(dpy, False);
} }
@ -182,10 +188,7 @@ mouse_resize(Client *c)
while(ev.type != ButtonRelease); while(ev.type != ButtonRelease);
if(!c->tile) if(!c->tile)
{
client_moveresize(c, geo, True); client_moveresize(c, geo, True);
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height);
}
else else
tags[selscreen][seltag[selscreen]].layout.func(c->screen); tags[selscreen][seltag[selscreen]].layout.func(c->screen);

View File

@ -308,7 +308,7 @@ void uicb_reload(uicb_t);
/* Principal */ /* Principal */
Display *dpy; Display *dpy;
GC gc, gc_stipple; GC gc, gc_stipple, gc_reverse;
int selscreen; int selscreen;
Conf conf; Conf conf;
Key *keys; Key *keys;

22
wmfs.1
View File

@ -1,5 +1,5 @@
.\" Title: wmfs .\" Title: wmfs
.\" Author: .\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 04/22/2009 .\" Date: 04/22/2009
.\" Manual: manual of wmfs .\" Manual: manual of wmfs
@ -13,24 +13,34 @@
.SH "NAME" .SH "NAME"
wmfs \- Window Manager From Scratch wmfs \- Window Manager From Scratch
.SH "SYNOPSIS" .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 <uicb_function> <cmd>\fR] [\fB\-s <string>\fR]
.sp .sp
.SH "DESCRIPTION" .SH "DESCRIPTION"
\fBWMFS\fR is a basic, lightweight and dynamic tiling windows manager for X\&. \fBWMFS\fR is a basic, lightweight and dynamic tiling windows manager for X\&.
.sp .sp
.SH "OPTIONS" .SH "OPTIONS"
.PP .PP
\fB\-v\fR, \fB\-\-version\fR \fB\-c <uicb_function> <cmd>\fR
.RS 4
Execute an uicb function to control WMFS\&.
.RE
.PP
\fB\-s <string>\fR
.RS 4
Set the bar(s) statustext\&.
.RE
.PP
\fB\-v\fR
.RS 4 .RS 4
Print version information to standard output, then exit\&. Print version information to standard output, then exit\&.
.RE .RE
.PP .PP
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR
.RS 4 .RS 4
Print help information, then exit\&. Print help information, then exit\&.
.RE .RE
.PP .PP
\fB\-i\fR, \fB\-\-info\fR \fB\-i\fR
.RS 4 .RS 4
Print WMFS informations Print WMFS informations
.RE .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\&. WMFS isn\'t stable for now\&. So it certainly contains some bugs\&.
.sp .sp
.SH "AUTHORS" .SH "AUTHORS"
Martin Duquesnoy <\fIxorg62@gmail\&.com\fR\&[1]> for the code\&. Martin Duquesnoy <\fIxorg62@gmail\&.com\fR\&[1]>\&.
.sp .sp
.SH "WWW" .SH "WWW"
Main site: \fIhttp://wmfs\&.malikania\&.org\fR Bug tracker: \fIhttp://wmfs\&.malikania\&.org/projects/wmfs/issues\fR Main site: \fIhttp://wmfs\&.malikania\&.org\fR Bug tracker: \fIhttp://wmfs\&.malikania\&.org/projects/wmfs/issues\fR