Rename option windowed to embedded
This commit is contained in:
parent
301e7de62f
commit
75634f63d1
2 changed files with 9 additions and 9 deletions
1
config.h
1
config.h
|
@ -2,6 +2,7 @@
|
||||||
/* Default settings; can be overriden by command line. */
|
/* Default settings; can be overriden by command line. */
|
||||||
|
|
||||||
static int topbar = 1;
|
static int topbar = 1;
|
||||||
|
static int embedded = 0;
|
||||||
static int minpwlen = 32;
|
static int minpwlen = 32;
|
||||||
static const char *fonts[] = {
|
static const char *fonts[] = {
|
||||||
"monospace:size=10"
|
"monospace:size=10"
|
||||||
|
|
|
@ -43,7 +43,7 @@ enum { Nothing, Yes, No }; /* confirm dialog */
|
||||||
|
|
||||||
static char text[BUFSIZ] = "";
|
static char text[BUFSIZ] = "";
|
||||||
//static char *text;
|
//static char *text;
|
||||||
static char *embed;
|
static char *winid;
|
||||||
static int bh, mw, mh;
|
static int bh, mw, mh;
|
||||||
static int sel;
|
static int sel;
|
||||||
static int promptw, ppromptw, pdescw;
|
static int promptw, ppromptw, pdescw;
|
||||||
|
@ -96,7 +96,7 @@ static void
|
||||||
grabkeyboard(void) {
|
grabkeyboard(void) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (embed) {
|
if (winid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* try to grab keyboard,
|
/* try to grab keyboard,
|
||||||
|
@ -305,7 +305,7 @@ setup(void) {
|
||||||
XNClientWindow, win, XNFocusWindow, win, NULL);
|
XNClientWindow, win, XNFocusWindow, win, NULL);
|
||||||
XMapRaised(dpy, win);
|
XMapRaised(dpy, win);
|
||||||
|
|
||||||
if (embed) {
|
if (winid) {
|
||||||
XSelectInput(dpy, parentwin, FocusChangeMask);
|
XSelectInput(dpy, parentwin, FocusChangeMask);
|
||||||
|
|
||||||
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
|
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
|
||||||
|
@ -532,7 +532,7 @@ cmdhandler(pinentry_t received_pinentry) {
|
||||||
}
|
}
|
||||||
screen = DefaultScreen(dpy);
|
screen = DefaultScreen(dpy);
|
||||||
root = RootWindow(dpy, screen);
|
root = RootWindow(dpy, screen);
|
||||||
if (!embed || !(parentwin = strtol(embed, NULL, 0))) {
|
if (!winid || !(parentwin = strtol(winid, NULL, 0))) {
|
||||||
parentwin = root;
|
parentwin = root;
|
||||||
}
|
}
|
||||||
if (!XGetWindowAttributes(dpy, parentwin, &wa)) {
|
if (!XGetWindowAttributes(dpy, parentwin, &wa)) {
|
||||||
|
@ -624,8 +624,8 @@ main(int argc, char *argv[]) {
|
||||||
if (config_lookup_string(&cfg, "desc_fg", &str)) {
|
if (config_lookup_string(&cfg, "desc_fg", &str)) {
|
||||||
colors[SchemeDesc][ColFg] = str;
|
colors[SchemeDesc][ColFg] = str;
|
||||||
}
|
}
|
||||||
if (config_lookup_bool(&cfg, "windowed", &bval)) {
|
if (config_lookup_bool(&cfg, "embedded", &bval)) {
|
||||||
windowed = bval;
|
embedded = bval;
|
||||||
}
|
}
|
||||||
} else if (str = config_error_file(&cfg)) {
|
} else if (str = config_error_file(&cfg)) {
|
||||||
fprintf(stderr, "%s:%d: %s\n", config_error_file(&cfg),
|
fprintf(stderr, "%s:%d: %s\n", config_error_file(&cfg),
|
||||||
|
@ -637,9 +637,8 @@ main(int argc, char *argv[]) {
|
||||||
|
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
if (!strcmp(argv[i], "-W") || !strcmp(argv[i], "--parent-wid")) {
|
if (!strcmp(argv[i], "-W") || !strcmp(argv[i], "--parent-wid")) {
|
||||||
if (windowed) {
|
if (embedded) {
|
||||||
embed = argv[++i];
|
winid = argv[++i];
|
||||||
printf("-> embed: %s\n", embed);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue