diff --git a/client.c b/client.c index 6c910975c..0cac08759 100644 --- a/client.c +++ b/client.c @@ -261,7 +261,7 @@ client_focus(Client *c, int screen, Bool raise) } /* since we're dropping EnterWindow events and sometimes the window * will appear under the mouse, grabbuttons */ - window_grabbuttons(c->phys_screen, c->win); + window_grabbuttons(c->win, c->phys_screen); } else XSetInputFocus(globalconf.display, @@ -402,7 +402,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen) if(globalconf.have_shape) { XShapeSelectInput(globalconf.display, w, ShapeNotifyMask); - window_setshape(c->phys_screen, c->win); + window_setshape(c->win, c->phys_screen); } /* attach to the stack */ diff --git a/event.c b/event.c index cc1af69ec..710ba7a7a 100644 --- a/event.c +++ b/event.c @@ -132,7 +132,7 @@ event_handle_buttonpress(XEvent *e) && ev->button == Button1) { XAllowEvents(globalconf.display, ReplayPointer, CurrentTime); - window_grabbuttons(c->phys_screen, c->win); + window_grabbuttons(c->win, c->phys_screen); } else event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL); @@ -268,7 +268,7 @@ event_handle_enternotify(XEvent *e) if(c || (c = client_get_bywin(globalconf.clients, ev->window))) { - window_grabbuttons(c->phys_screen, c->win); + window_grabbuttons(c->win, c->phys_screen); if(globalconf.screens[c->screen].sloppy_focus) client_focus(c, c->screen, (globalconf.screens[c->screen].sloppy_focus @@ -472,7 +472,7 @@ event_handle_shape(XEvent * e) Client *c = client_get_bywin(globalconf.clients, ev->window); if(c) - window_setshape(c->phys_screen, c->win); + window_setshape(c->win, c->phys_screen); } /** Handle XRandR events diff --git a/window.c b/window.c index 77250205c..652cedfb3 100644 --- a/window.c +++ b/window.c @@ -93,11 +93,11 @@ window_configure(Window win, area_t geometry, int border) } /** Grab or ungrab buttons on a window - * \param screen The screen * \param win The window + * \param phys_screen Physical screen number */ void -window_grabbuttons(int phys_screen, Window win) +window_grabbuttons(Window win, int phys_screen) { Button *b; @@ -175,14 +175,17 @@ window_root_grabkeys(int phys_screen) } void -window_setshape(int screen, Window win) +window_setshape(Window win, int phys_screen) { - int bounding_shaped; - int i, b; unsigned int u; /* dummies */ + int bounding_shaped, i, b; + unsigned int u; /* dummies */ + /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */ if(XShapeQueryExtents(globalconf.display, win, &bounding_shaped, &i, &i, &u, &u, &b, &i, &i, &u, &u) && bounding_shaped) - XShapeCombineShape(globalconf.display, RootWindow(globalconf.display, screen), ShapeBounding, 0, 0, win, ShapeBounding, ShapeSet); + XShapeCombineShape(globalconf.display, + RootWindow(globalconf.display, phys_screen), + ShapeBounding, 0, 0, win, ShapeBounding, ShapeSet); } int diff --git a/window.h b/window.h index 1febf3f94..ff7318960 100644 --- a/window.h +++ b/window.h @@ -27,10 +27,10 @@ int window_setstate(Window, long); long window_getstate(Window); Status window_configure(Window, area_t, int); -void window_grabbuttons(int, Window); +void window_grabbuttons(Window, int); void window_root_grabbuttons(int); void window_root_grabkeys(int); -void window_setshape(int, Window); +void window_setshape(Window, int); int window_settrans(Window, double); #endif