mirror of
https://github.com/0intro/wmii
synced 2025-01-21 01:22:07 +03:00
hopefully this fixes the issue seen by Sander
This commit is contained in:
parent
939677d2f0
commit
ec658d058f
@ -388,7 +388,7 @@ manage_client(Client *c)
|
||||
XSync(dpy, False);
|
||||
if(c->frame.data[c->sel]->area->view == view.data[sel])
|
||||
focus_client(c, False);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -425,7 +425,7 @@ destroy_client(Client *c)
|
||||
XSync(dpy, False);
|
||||
XSetErrorHandler(wmii_error_handler);
|
||||
XUngrabServer(dpy);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
Client *
|
||||
@ -534,7 +534,7 @@ select_client(Client *c, char *arg)
|
||||
return;
|
||||
}
|
||||
focus_client(a->frame.data[i]->client, True);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
void
|
||||
@ -591,7 +591,7 @@ Swaparea:
|
||||
if(idx_of_area(a))
|
||||
arrange_column(a, False);
|
||||
focus_client(c, True);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
void
|
||||
@ -641,7 +641,7 @@ send_client_to(Client *c, char *arg)
|
||||
to = v->area.data[i];
|
||||
}
|
||||
send_to_area(to, a, c);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
void
|
||||
@ -657,7 +657,7 @@ resize_all_clients()
|
||||
resize_client(c, &c->frame.data[c->sel]->rect, False);
|
||||
}
|
||||
}
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
/* convenience function */
|
||||
|
@ -57,7 +57,7 @@ check_x_event(IXPConn *c)
|
||||
}
|
||||
|
||||
unsigned int
|
||||
flush_events(long even_mask)
|
||||
flush_masked_events(long even_mask)
|
||||
{
|
||||
XEvent ev;
|
||||
unsigned int n = 0;
|
||||
@ -100,13 +100,13 @@ handle_buttonpress(XEvent *e)
|
||||
if((ev->button == Button1 || ev->button == Button3))
|
||||
focus(c, True);
|
||||
if(ev->button == Button1)
|
||||
do_mouse_move(c);
|
||||
do_mouse_move(c, ev);
|
||||
else if (ev->button == Button3) {
|
||||
BlitzAlign align = blitz_align_of_rect(&c->rect, ev->x, ev->y);
|
||||
if(align != CENTER)
|
||||
do_mouse_resize(c, align);
|
||||
do_mouse_resize(c, ev, align);
|
||||
else
|
||||
do_mouse_move(c);
|
||||
do_mouse_move(c, ev);
|
||||
}
|
||||
}
|
||||
else if(ev->button == Button1)
|
||||
|
@ -199,7 +199,7 @@ draw_pseudo_border(XRectangle * r)
|
||||
}
|
||||
|
||||
void
|
||||
do_mouse_move(Client *c)
|
||||
do_mouse_move(Client *c, XButtonPressedEvent *e)
|
||||
{
|
||||
int px = 0, py = 0, wex, wey, ex, ey, first = 1, i;
|
||||
Window dummy;
|
||||
@ -220,14 +220,11 @@ do_mouse_move(Client *c)
|
||||
pt.y = ey;
|
||||
XSync(dpy, False);
|
||||
|
||||
if(flush_events(ButtonReleaseMask))
|
||||
return;
|
||||
|
||||
XGrabServer(dpy);
|
||||
while(XGrabPointer(dpy, root, False, ButtonMotionMask | ButtonReleaseMask,
|
||||
if(XGrabPointer(dpy, root, False, ButtonMotionMask | ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None, cursor[CurMove],
|
||||
CurrentTime) != GrabSuccess)
|
||||
usleep(1000);
|
||||
e->time) != GrabSuccess)
|
||||
return;
|
||||
XGrabServer(dpy);
|
||||
|
||||
for(;;) {
|
||||
while(!XCheckMaskEvent(dpy, ButtonReleaseMask | ButtonMotionMask, &ev)) {
|
||||
@ -445,7 +442,7 @@ snap_resize(XRectangle * r, XRectangle * o, BlitzAlign align,
|
||||
}
|
||||
|
||||
void
|
||||
do_mouse_resize(Client *c, BlitzAlign align)
|
||||
do_mouse_resize(Client *c, XButtonPressedEvent *e, BlitzAlign align)
|
||||
{
|
||||
int px = 0, py = 0, i, ox, oy, first = 1;
|
||||
Window dummy;
|
||||
@ -463,14 +460,11 @@ do_mouse_resize(Client *c, BlitzAlign align)
|
||||
XQueryPointer(dpy, c->framewin, &dummy, &dummy, &i, &i, &ox, &oy, &dmask);
|
||||
XSync(dpy, False);
|
||||
|
||||
if(flush_events(ButtonReleaseMask))
|
||||
return;
|
||||
|
||||
XGrabServer(dpy);
|
||||
while(XGrabPointer(dpy, c->framewin, False, ButtonMotionMask | ButtonReleaseMask,
|
||||
if(XGrabPointer(dpy, c->framewin, False, ButtonMotionMask | ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None, cursor[CurResize],
|
||||
CurrentTime) != GrabSuccess)
|
||||
usleep(1000);
|
||||
e->time) != GrabSuccess)
|
||||
return;
|
||||
XGrabServer(dpy);
|
||||
|
||||
for(;;) {
|
||||
while(!XCheckMaskEvent(dpy, ButtonReleaseMask | ButtonMotionMask, &ev)) {
|
||||
|
@ -105,7 +105,7 @@ focus_view(View *v)
|
||||
update_view_bars();
|
||||
XSync(dpy, False);
|
||||
XUngrabServer(dpy);
|
||||
flush_events(EnterWindowMask);
|
||||
flush_masked_events(EnterWindowMask);
|
||||
}
|
||||
|
||||
XRectangle *
|
||||
|
@ -247,7 +247,7 @@ Area *new_right_column(View *v);
|
||||
/* event.c */
|
||||
void init_x_event_handler();
|
||||
void check_x_event(IXPConn *c);
|
||||
unsigned int flush_events(long even_mask);
|
||||
unsigned int flush_masked_events(long even_mask);
|
||||
|
||||
/* frame.c */
|
||||
Frame *create_frame(Area *a, Client *c);
|
||||
@ -269,8 +269,8 @@ void init_lock_keys();
|
||||
unsigned long mod_key_of_str(char *val);
|
||||
|
||||
/* mouse.c */
|
||||
void do_mouse_resize(Client *c, BlitzAlign align);
|
||||
void do_mouse_move(Client *c);
|
||||
void do_mouse_resize(Client *c, XButtonPressedEvent *e, BlitzAlign align);
|
||||
void do_mouse_move(Client *c, XButtonPressedEvent *e);
|
||||
void grab_mouse(Window w, unsigned long mod, unsigned int button);
|
||||
void ungrab_mouse(Window w, unsigned long mod, unsigned int button);
|
||||
|
||||
|
@ -457,7 +457,7 @@ then the last rule should be defined in the following form:
|
||||
.SS Processing events
|
||||
Running
|
||||
.B wmiiwm
|
||||
in an useful way needs to control it through reading events
|
||||
in a useful way needs to control it through reading events
|
||||
from the
|
||||
.I /event
|
||||
file described above.
|
||||
|
Loading…
Reference in New Issue
Block a user