Event buttonpress: Fix bug #9 opened by Cheaterman.
This commit is contained in:
parent
0faf031150
commit
a3f144f642
18
src/event.c
18
src/event.c
@ -62,12 +62,22 @@ buttonpress(XButtonEvent *ev)
|
||||
mouse_resize(c);
|
||||
|
||||
/* Client */
|
||||
if((c = client_gb_win(ev->window)))
|
||||
if((c = client_gb_win(ev->window)) && c == sel)
|
||||
for(i = 0; i < conf.client.nmouse; ++i)
|
||||
if(ev->button == conf.client.mouse[i].button)
|
||||
if(conf.client.mouse[i].func)
|
||||
conf.client.mouse[i].func(conf.client.mouse[i].cmd);
|
||||
|
||||
/* If the mouse is on a client that is not selected
|
||||
and you click on it. */
|
||||
if((c = client_gb_win(ev->window)) && c != sel
|
||||
&& ev->button == Button1)
|
||||
{
|
||||
client_focus(c);
|
||||
if(conf.raisefocus)
|
||||
client_raise(c);
|
||||
}
|
||||
|
||||
/* Root */
|
||||
if(ev->window == ROOT)
|
||||
for(i = 0; i < conf.root.nmouse; ++i)
|
||||
@ -315,9 +325,9 @@ enternotify(XCrossingEvent *ev)
|
||||
Client *c;
|
||||
int n;
|
||||
|
||||
if((ev->mode != NotifyNormal
|
||||
|| ev->detail == NotifyInferior)
|
||||
&& ev->window != ROOT)
|
||||
if((ev->mode != NotifyNormal))
|
||||
// || ev->detail == NotifyInferior)
|
||||
// && ev->window != ROOT)
|
||||
return;
|
||||
|
||||
if((c = client_gb_win(ev->window))
|
||||
|
||||
@ -136,10 +136,11 @@ init_root(void)
|
||||
XSetWindowAttributes at;
|
||||
|
||||
at.event_mask = KeyMask | ButtonMask | MouseMask
|
||||
| SubstructureRedirectMask | SubstructureNotifyMask |StructureNotifyMask;
|
||||
| SubstructureRedirectMask | SubstructureNotifyMask | StructureNotifyMask;
|
||||
|
||||
at.cursor = cursor[CurNormal];
|
||||
XChangeWindowAttributes(dpy, ROOT, CWEventMask | CWCursor, &at);
|
||||
|
||||
if(conf.root.background_command)
|
||||
uicb_spawn(conf.root.background_command);
|
||||
|
||||
|
||||
@ -217,10 +217,12 @@ spawn(const char *format, ...)
|
||||
vsprintf(cmd, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if(!(sh = getenv("SHELL")))
|
||||
sh = "/bin/sh";
|
||||
if(!strlen(cmd))
|
||||
return;
|
||||
|
||||
if(!(sh = getenv("SHELL")))
|
||||
sh = "/bin/sh";
|
||||
|
||||
if(fork() == 0)
|
||||
{
|
||||
if(fork() == 0)
|
||||
@ -229,7 +231,7 @@ spawn(const char *format, ...)
|
||||
close(ConnectionNumber(dpy));
|
||||
setsid();
|
||||
execl(sh, sh, "-c", cmd, (char*)NULL);
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@ -234,6 +234,7 @@ char* alias_to_str(char *conf_choice);
|
||||
/* }}} */
|
||||
XRectangle get_mouse_pos(void);
|
||||
void spawn(const char *str, ...);
|
||||
Pixmap get_root_pixmap(void);
|
||||
void uicb_spawn(uicb_t);
|
||||
|
||||
/* tag.c */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user