Merge b80138ea72be3df02a638a922babed604ec51af5 into 25c3441925272978596df7964aeec68c295ad0b5
This commit is contained in:
commit
29c88d2996
@ -32,6 +32,10 @@ Dock the bar at the bottom of the screen.
|
||||
|
||||
Force docking without asking the window manager. This is needed if the window manager isn't EWMH compliant.
|
||||
|
||||
=item B<-e>
|
||||
|
||||
Output enter and leave window events on stdout.
|
||||
|
||||
=item B<-f> I<font>
|
||||
|
||||
Comma separated list of fonts, lemonbar supports a maximum of five fonts (the limit can be tweaked by changing the MAX_FONT_COUNT parameter in the source).
|
||||
|
20
lemonbar.c
20
lemonbar.c
@ -735,11 +735,16 @@ monitor_new (int x, int y, int width, int height)
|
||||
ret->window = xcb_generate_id(c);
|
||||
|
||||
int depth = (visual == scr->root_visual) ? XCB_COPY_FROM_PARENT : 32;
|
||||
uint32_t events =
|
||||
XCB_EVENT_MASK_EXPOSURE |
|
||||
XCB_EVENT_MASK_BUTTON_PRESS |
|
||||
XCB_EVENT_MASK_ENTER_WINDOW |
|
||||
XCB_EVENT_MASK_LEAVE_WINDOW ;
|
||||
xcb_create_window(c, depth, ret->window, scr->root,
|
||||
ret->x, ret->y, width, bh, 0,
|
||||
XCB_WINDOW_CLASS_INPUT_OUTPUT, visual,
|
||||
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP,
|
||||
(const uint32_t []){ bgc.v, bgc.v, dock, XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS, colormap });
|
||||
(const uint32_t []){ bgc.v, bgc.v, dock, events, colormap });
|
||||
|
||||
ret->pixmap = xcb_generate_id(c);
|
||||
xcb_create_pixmap(c, depth, ret->pixmap, ret->window, width, bh);
|
||||
@ -1243,6 +1248,7 @@ main (int argc, char **argv)
|
||||
xcb_button_press_event_t *press_ev;
|
||||
char input[4096] = {0, };
|
||||
bool permanent = false;
|
||||
bool enterleave = false;
|
||||
int geom_v[4] = { -1, -1, 0, 0 };
|
||||
int ch;
|
||||
|
||||
@ -1260,7 +1266,7 @@ main (int argc, char **argv)
|
||||
|
||||
ugc = fgc;
|
||||
|
||||
while ((ch = getopt(argc, argv, "hg:bdf:a:pu:B:F:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "hg:bdef:a:pu:B:F:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
printf ("lemonbar version %s\n", VERSION);
|
||||
@ -1269,6 +1275,7 @@ main (int argc, char **argv)
|
||||
"\t-g Set the bar geometry {width}x{height}+{xoffset}+{yoffset}\n"
|
||||
"\t-b Put the bar at the bottom of the screen\n"
|
||||
"\t-d Force docking (use this if your WM isn't EWMH compliant)\n"
|
||||
"\t-e Output enter and leave window events\n"
|
||||
"\t-f Bar font list, comma separated\n"
|
||||
"\t-p Don't close after the data ends\n"
|
||||
"\t-u Set the underline/overline height in pixels\n"
|
||||
@ -1279,6 +1286,7 @@ main (int argc, char **argv)
|
||||
case 'p': permanent = true; break;
|
||||
case 'b': topbar = false; break;
|
||||
case 'd': dock = true; break;
|
||||
case 'e': enterleave = true; break;
|
||||
case 'f': parse_font_list(optarg); break;
|
||||
case 'u': bu = strtoul(optarg, NULL, 10); break;
|
||||
case 'B': dbgc = bgc = parse_color(optarg, NULL, (rgba_t)scr->black_pixel); break;
|
||||
@ -1336,6 +1344,14 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XCB_ENTER_NOTIFY:
|
||||
case XCB_LEAVE_NOTIFY:
|
||||
{
|
||||
bool entered = ev->response_type == XCB_ENTER_NOTIFY;
|
||||
if (enterleave)
|
||||
write(STDOUT_FILENO, entered ? "enter\n" : "leave\n", 6);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
free(ev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user