clean up and simplify
This commit is contained in:
parent
187645a625
commit
e6381d7b85
4 changed files with 6 additions and 55 deletions
2
event.c
2
event.c
|
@ -563,13 +563,11 @@ void enter(XCrossingEvent* e) {
|
||||||
Client* c;
|
Client* c;
|
||||||
|
|
||||||
curtime = e->time;
|
curtime = e->time;
|
||||||
if (!ffm)
|
|
||||||
if (e->mode != NotifyGrab || e->detail != NotifyNonlinearVirtual)
|
if (e->mode != NotifyGrab || e->detail != NotifyNonlinearVirtual)
|
||||||
return;
|
return;
|
||||||
c = getclient(e->window, 0);
|
c = getclient(e->window, 0);
|
||||||
if (c != 0 && c != current) {
|
if (c != 0 && c != current) {
|
||||||
/* someone grabbed the pointer; make them current */
|
/* someone grabbed the pointer; make them current */
|
||||||
if (!ffm)
|
|
||||||
XMapRaised(dpy, c->parent);
|
XMapRaised(dpy, c->parent);
|
||||||
top(c);
|
top(c);
|
||||||
active(c);
|
active(c);
|
||||||
|
|
32
key.c
32
key.c
|
@ -95,10 +95,6 @@ void keysetup(void) {
|
||||||
#ifdef PREVVIRT_KEY
|
#ifdef PREVVIRT_KEY
|
||||||
int leftcode = XKeysymToKeycode(dpy, PREVVIRT_KEY);
|
int leftcode = XKeysymToKeycode(dpy, PREVVIRT_KEY);
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEVEL
|
|
||||||
int tcode = XKeysymToKeycode(dpy, STICKYTOFRONT_KEY);
|
|
||||||
int bcode = XKeysymToKeycode(dpy, STICKYTOBACK_KEY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < num_screens; i++) {
|
for (i = 0; i < num_screens; i++) {
|
||||||
XGrabKey(
|
XGrabKey(
|
||||||
|
@ -561,12 +557,6 @@ void keysetup(void) {
|
||||||
GrabModeSync,
|
GrabModeSync,
|
||||||
GrabModeAsync);
|
GrabModeAsync);
|
||||||
#endif
|
#endif
|
||||||
/* XGrabKey(dpy, pgupcode, Mod1Mask, screens[i].root, 0, GrabModeSync,
|
|
||||||
* GrabModeAsync); */
|
|
||||||
/* XGrabKey(dpy, pgdowncode, Mod1Mask, screens[i].root, 0, GrabModeSync,
|
|
||||||
* GrabModeAsync); */
|
|
||||||
/* XGrabKey(dpy, altcode, 0, screens[i].root, 0, GrabModeSync,
|
|
||||||
* GrabModeAsync); */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,10 +884,7 @@ void keypress(XKeyEvent* e) {
|
||||||
kbLaunch = 1;
|
kbLaunch = 1;
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
// this code doesn't seem necessary
|
close(ConnectionNumber(dpy));
|
||||||
// close(ConnectionNumber(dpy));
|
|
||||||
// if (dpy != '\0')
|
|
||||||
// putenv(dpy);
|
|
||||||
signal(SIGINT, SIG_DFL);
|
signal(SIGINT, SIG_DFL);
|
||||||
signal(SIGTERM, SIG_DFL);
|
signal(SIGTERM, SIG_DFL);
|
||||||
signal(SIGHUP, SIG_DFL);
|
signal(SIGHUP, SIG_DFL);
|
||||||
|
@ -1001,20 +988,3 @@ static void alttab(int shift) {
|
||||||
shuffleonmonitor(monitor);
|
shuffleonmonitor(monitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEVEL
|
|
||||||
void stickystack(int toTop) {
|
|
||||||
Client* c;
|
|
||||||
if (toTop) {
|
|
||||||
for (c = clients; c->next; c = c->next) {
|
|
||||||
if (c && isautostick(c))
|
|
||||||
top(c);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (c = clients; c->next; c = c->next) {
|
|
||||||
if (c && !isautostick(c))
|
|
||||||
top(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
11
main.c
11
main.c
|
@ -22,7 +22,7 @@
|
||||||
#include "patchlevel.h"
|
#include "patchlevel.h"
|
||||||
|
|
||||||
char* version[] = {
|
char* version[] = {
|
||||||
"ryudo version 1.5.0\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ "
|
"ryudo version 1.6.0\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ "
|
||||||
"Cox,\n(c) 2019-2024 Iris Lightshard",
|
"Cox,\n(c) 2019-2024 Iris Lightshard",
|
||||||
0};
|
0};
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ int scrolling;
|
||||||
int num_screens;
|
int num_screens;
|
||||||
int solidsweep = 0;
|
int solidsweep = 0;
|
||||||
int numvirtuals = 0;
|
int numvirtuals = 0;
|
||||||
int ffm = 0;
|
|
||||||
int kbLaunch = 0;
|
int kbLaunch = 0;
|
||||||
int zoom = 0;
|
int zoom = 0;
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ char* fontlist[] = FONTLIST;
|
||||||
void usage(void) {
|
void usage(void) {
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr,
|
stderr,
|
||||||
"usage: ryudo [-ffm] [-font fname] [-s] [-term prog] [-version] [-virtuals "
|
"usage: ryudo [-font fname] [-s] [-term prog] [-version] [-virtuals "
|
||||||
"num] [exit|restart]\n");
|
"num] [exit|restart]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -88,9 +87,6 @@ int main(int argc, char* argv[]) {
|
||||||
if (strcmp(argv[i], "-debug") == 0)
|
if (strcmp(argv[i], "-debug") == 0)
|
||||||
debug++;
|
debug++;
|
||||||
|
|
||||||
else if (strcmp(argv[i], "-ffm") == 0)
|
|
||||||
ffm++;
|
|
||||||
|
|
||||||
else if (strcmp(argv[i], "-font") == 0 && i + 1 < argc) {
|
else if (strcmp(argv[i], "-font") == 0 && i + 1 < argc) {
|
||||||
i++;
|
i++;
|
||||||
fname = argv[i];
|
fname = argv[i];
|
||||||
|
@ -159,9 +155,6 @@ int main(int argc, char* argv[]) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0)
|
|
||||||
XSynchronize(dpy, True);
|
|
||||||
|
|
||||||
wm_state = XInternAtom(dpy, "WM_STATE", False);
|
wm_state = XInternAtom(dpy, "WM_STATE", False);
|
||||||
wm_change_state = XInternAtom(dpy, "WM_CHANGE_STATE", False);
|
wm_change_state = XInternAtom(dpy, "WM_CHANGE_STATE", False);
|
||||||
wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
|
||||||
|
|
10
menu.c
10
menu.c
|
@ -135,8 +135,6 @@ void button(XButtonEvent* e) {
|
||||||
switch (e->button) {
|
switch (e->button) {
|
||||||
case Button1:
|
case Button1:
|
||||||
if (c) {
|
if (c) {
|
||||||
if (ffm)
|
|
||||||
XRaiseWindow(dpy, c->window);
|
|
||||||
XMapRaised(dpy, c->parent);
|
XMapRaised(dpy, c->parent);
|
||||||
top(c);
|
top(c);
|
||||||
active(c);
|
active(c);
|
||||||
|
@ -148,12 +146,6 @@ void button(XButtonEvent* e) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case Button3:
|
case Button3:
|
||||||
if (c) {
|
|
||||||
XMapRaised(dpy, c->parent);
|
|
||||||
top(c);
|
|
||||||
active(c);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Button4:
|
case Button4:
|
||||||
/* scroll up changes to previous virtual screen, wraps around */
|
/* scroll up changes to previous virtual screen, wraps around */
|
||||||
|
@ -246,8 +238,6 @@ void spawn(ScreenInfo* s) {
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
close(ConnectionNumber(dpy));
|
close(ConnectionNumber(dpy));
|
||||||
if (s->display[0] != '\0')
|
|
||||||
putenv(s->display);
|
|
||||||
signal(SIGINT, SIG_DFL);
|
signal(SIGINT, SIG_DFL);
|
||||||
signal(SIGTERM, SIG_DFL);
|
signal(SIGTERM, SIG_DFL);
|
||||||
signal(SIGHUP, SIG_DFL);
|
signal(SIGHUP, SIG_DFL);
|
||||||
|
|
Loading…
Reference in a new issue