Merge branch 'master' into 'revert'
# Conflicts: # key.c # manage.c
This commit is contained in:
commit
5dcb3bfee3
2 changed files with 12 additions and 24 deletions
21
key.c
21
key.c
|
@ -109,9 +109,6 @@ keypress(XKeyEvent *e)
|
||||||
static XWindowAttributes ra;
|
static XWindowAttributes ra;
|
||||||
XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra);
|
XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra);
|
||||||
|
|
||||||
/* alt tab */
|
|
||||||
if(e->keycode == tabcode && (e->state&Mod1Mask) == (1<<3))
|
|
||||||
alttab(e->state&ShiftMask);
|
|
||||||
|
|
||||||
/* basic wm functionality */
|
/* basic wm functionality */
|
||||||
if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if(e->keycode == dcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
|
@ -127,27 +124,27 @@ keypress(XKeyEvent *e)
|
||||||
|
|
||||||
/* half snap */
|
/* half snap */
|
||||||
if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, 0, 0, ra.width/2, ra.height);
|
quickreshape(current, 0, 0, scrw/2, scrh);
|
||||||
if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, ra.width/2, 0, ra.width/2, ra.height);
|
quickreshape(current, scrw/2, 0, scrw/2, scrh);
|
||||||
if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, 0, ra.height/2, ra.width, ra.height/2);
|
quickreshape(current, 0, scrh/2, scrw, scrh/2);
|
||||||
if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, 0, 0, ra.width, ra.height/2);
|
quickreshape(current, 0, 0, scrw, scrh/2);
|
||||||
|
|
||||||
/* quarter snap */
|
/* quarter snap */
|
||||||
if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, 0, 0, ra.width/2, ra.height/2);
|
quickreshape(current, 0, 0, scrw/2, scrh/2);
|
||||||
if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, 0, ra.height/2, ra.width/2, ra.height/2);
|
quickreshape(current, 0, scrh/2, scrw/2, scrh/2);
|
||||||
if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, ra.width/2, ra.height/2, ra.width/2, ra.height/2);
|
quickreshape(current, scrw/2, scrh/2, scrw/2, scrh/2);
|
||||||
if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, ra.width/2, 0, ra.width/2, ra.height/2);
|
quickreshape(current, scrw/2, 0, scrw/2, scrh/2);
|
||||||
|
|
||||||
/* center snap */
|
/* center snap */
|
||||||
if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))
|
if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))
|
||||||
quickreshape(current, ra.width/5, ra.height/5, 3*ra.width/5, 3*ra.height/5);
|
quickreshape(current, scrw/5, scrh/5, 3*scrw/5, 3*scrh/5);
|
||||||
|
|
||||||
|
|
||||||
/* launch */
|
/* launch */
|
||||||
|
|
15
main.c
15
main.c
|
@ -72,14 +72,14 @@ char *fontlist[] = {
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: ryudo [-grey] [-font fname] [-s] [-term prog] [-version] [-virtuals num] [exit|restart]\n");
|
fprintf(stderr, "usage: ryudo [-font fname] [-s] [-term prog] [-version] [-virtuals num] [exit|restart]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i, background, do_exit, do_restart;
|
int i, do_exit, do_restart;
|
||||||
char *fname;
|
char *fname;
|
||||||
int shape_event;
|
int shape_event;
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
|
@ -90,14 +90,11 @@ main(int argc, char *argv[])
|
||||||
myargv = argv; /* for restart */
|
myargv = argv; /* for restart */
|
||||||
|
|
||||||
do_exit = do_restart = 0;
|
do_exit = do_restart = 0;
|
||||||
background = 0;
|
|
||||||
font = 0;
|
font = 0;
|
||||||
fname = 0;
|
fname = 0;
|
||||||
for(i = 1; i < argc; i++)
|
for(i = 1; i < argc; i++)
|
||||||
if(strcmp(argv[i], "-nostalgia") == 0)
|
if(strcmp(argv[i], "-nostalgia") == 0)
|
||||||
nostalgia++;
|
nostalgia++;
|
||||||
else if(strcmp(argv[i], "-grey") == 0)
|
|
||||||
background = 1;
|
|
||||||
else if(strcmp(argv[i], "-debug") == 0)
|
else if(strcmp(argv[i], "-debug") == 0)
|
||||||
debug++;
|
debug++;
|
||||||
/*
|
/*
|
||||||
|
@ -217,7 +214,7 @@ main(int argc, char *argv[])
|
||||||
screens = (ScreenInfo *)malloc(sizeof(ScreenInfo) * num_screens);
|
screens = (ScreenInfo *)malloc(sizeof(ScreenInfo) * num_screens);
|
||||||
|
|
||||||
for(i = 0; i < num_screens; i++)
|
for(i = 0; i < num_screens; i++)
|
||||||
initscreen(&screens[i], i, background);
|
initscreen(&screens[i], i, 0);
|
||||||
|
|
||||||
initb2menu(numvirtuals);
|
initb2menu(numvirtuals);
|
||||||
|
|
||||||
|
@ -352,12 +349,6 @@ initscreen(ScreenInfo *s, int i, int background)
|
||||||
XChangeWindowAttributes(dpy, s->root, mask, &attr);
|
XChangeWindowAttributes(dpy, s->root, mask, &attr);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
||||||
if(background){
|
|
||||||
XSetWindowBackgroundPixmap(dpy, s->root, s->root_pixmap);
|
|
||||||
XClearWindow(dpy, s->root);
|
|
||||||
} else
|
|
||||||
system("xsetroot -solid grey30");
|
|
||||||
|
|
||||||
attrs.border_pixel = colorpixel(dpy, s, s->depth, MBORDERCOL, s->black);
|
attrs.border_pixel = colorpixel(dpy, s, s->depth, MBORDERCOL, s->black);
|
||||||
attrs.background_pixel = colorpixel(dpy, s, s->depth, MENUBGCOL, s->white);
|
attrs.background_pixel = colorpixel(dpy, s, s->depth, MENUBGCOL, s->white);
|
||||||
attrs.colormap = s->def_cmap;
|
attrs.colormap = s->def_cmap;
|
||||||
|
|
Loading…
Reference in a new issue