fixed mouse grabbing for the moment

This commit is contained in:
Anselm R. Garbe 2006-01-17 18:33:12 +02:00
parent 76a41dbdab
commit 24f4a8b42d
6 changed files with 5 additions and 17 deletions

View File

@ -28,6 +28,10 @@ alloc_client(Window w)
void
focus_client(Client * c)
{
Client *old = sel_client();
if(old)
ungrab_client(old, AnyModifier, AnyButton);
grab_client(c, Mod1Mask, Button1);
grab_client(c, Mod1Mask, Button3);
c->frame->sel = c;
@ -37,13 +41,6 @@ focus_client(Client * c)
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
}
void
unfocus_client(Client * c)
{
ungrab_client(c, AnyModifier, AnyButton);
grab_client(c, AnyModifier, AnyButton);
}
void
set_client_state(Client * c, int state)
{
@ -60,7 +57,7 @@ map_client(Client * c)
{
XMapRaised(dpy, c->win);
set_client_state(c, NormalState);
grab_client(c, AnyModifier, AnyButton);
/* grab_client(c, AnyModifier, AnyButton); */
}
void

View File

@ -64,9 +64,6 @@ handle_buttonpress(XEvent * e)
handle_frame_buttonpress(ev, f);
else if((c = win_to_client(ev->window)) && c->frame) {
Layout *l = sel_layout();
Client *old = sel_client();
if(old != c)
unfocus_client(old);
if(l != c->frame->layout)
focus_layout(c->frame->layout);
focus_client(c);

View File

@ -420,8 +420,6 @@ focus_col(Layout *l, Client *c, Bool raise)
Client *old = sel_col(l);
Cell *cell = c->frame->aux;
if(old != c)
unfocus_client(old);
acme->sel = cell->col;
cell->col->sel = cell;
l->file[L_SEL_FRAME]->content = c->frame->file[F_PREFIX]->content;

View File

@ -188,8 +188,6 @@ focus_float(Layout *l, Client *c, Bool raise)
Float *fl = l->aux;
Client *old = fl->sel->sel;
if(old != c)
unfocus_client(old);
fl->sel = c->frame;
l->file[L_SEL_FRAME]->content = c->frame->file[F_PREFIX]->content;
if(raise) {

View File

@ -329,7 +329,6 @@ draw_detached_clients()
configure_client(c);
map_client(c);
XRaiseWindow(dpy, c->win);
grab_client(c, AnyModifier, AnyButton);
XSync(dpy, False);
c = c->next;
}

View File

@ -223,7 +223,6 @@ void unmap_client(Client * c);
void map_client(Client * c);
void reparent_client(Client * c, Window w, int x, int y);
void focus_client(Client * c);
void unfocus_client(Client * c);
void attach_client(Client * c);
void detach_client(Client * c, Bool unmap);
Client *sel_client();