Use motionnotify to focus client with mouse, check for tag frame too

This commit is contained in:
Martin Duquesnoy 2011-10-07 00:08:58 +02:00
parent ad5c4101ee
commit f224f7056f
3 changed files with 12 additions and 7 deletions

2
configure vendored
View File

@ -32,7 +32,7 @@ done
LIBS="$LIBS $USE_XINERAMA"
which pkg-config >/dev/null 2>&1
which pkg-config > /dev/null 2>&1
if [ $? -eq 0 ];
then

View File

@ -435,7 +435,6 @@ client_geo_hints(struct geo *g, int *s)
g->h = s[MAXH];
}
void
client_moveresize(struct client *c, struct geo *g)
{

View File

@ -35,6 +35,7 @@ event_buttonpress(XEvent *e)
}
}
/*
static void
event_enternotify(XEvent *e)
{
@ -50,6 +51,7 @@ event_enternotify(XEvent *e)
if((c = client_gb_win(ev->window)))
client_focus(c);
}
*/
static void
event_clientmessageevent(XEvent *e)
@ -184,17 +186,21 @@ event_unmapnotify(XEvent *e)
client_remove(c);
}
/*
static void
event_motionnotify(XEvent *e)
{
XMotionEvent *ev = &e->xmotion;
struct client *c;
if((c = client_gb_win(ev->subwindow)) && c != c->tag->sel)
/*
* Check client window and tag frame to get focused
* window with mouse motion
*/
if(((c = client_gb_win(ev->subwindow)) && c != c->tag->sel)
|| (ev->window == W->screen->seltag->frame
&& ((c = client_gb_pos(W->screen->seltag, ev->x, ev->y)))))
client_focus(c);
}
*/
static void
event_keypress(XEvent *e)
@ -244,14 +250,14 @@ event_init(void)
event_handle[ClientMessage] = event_clientmessageevent;
event_handle[ConfigureRequest] = event_configureevent;
event_handle[DestroyNotify] = event_destroynotify;
event_handle[EnterNotify] = event_enternotify;
/*event_handle[EnterNotify] = event_enternotify;*/
event_handle[Expose] = event_expose;
event_handle[FocusIn] = event_focusin;
event_handle[KeyPress] = event_keypress;
/*event_handle[MapNotify] = event_mapnotify;*/
event_handle[MapRequest] = event_maprequest;
event_handle[MappingNotify] = event_mappingnotify;
/*event_handle[MotionNotify] = event_motionnotify;*/
event_handle[MotionNotify] = event_motionnotify;
event_handle[PropertyNotify] = event_propertynotify;
/*event_handle[ReparentNotify] = event_reparentnotify;*/
/*event_handle[SelectionClear] = event_selectionclearevent;*/