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