Use motionnotify to focus client with mouse, check for tag frame too
This commit is contained in:
16
src/event.c
16
src/event.c
@@ -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;*/
|
||||
|
||||
Reference in New Issue
Block a user