since the root and event window are the same in the case of a button

event on the screen's root window, there's no need to pass down the
entire XButtonEvent event, at least to group_menu(), the only callback
which takes an argument at this point; instead use the already populated
screen.
This commit is contained in:
okan 2013-07-09 01:24:49 +00:00
parent c2e750f350
commit 0cd6dbc0fc
3 changed files with 6 additions and 9 deletions

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: calmwm.h,v 1.216 2013/07/08 18:39:20 okan Exp $
* $OpenBSD: calmwm.h,v 1.217 2013/07/09 01:24:49 okan Exp $
*/
#ifndef _CALMWM_H_
@ -360,7 +360,7 @@ void group_autogroup(struct client_ctx *);
void group_cycle(struct screen_ctx *, int);
void group_hidetoggle(struct screen_ctx *, int);
void group_init(struct screen_ctx *);
void group_menu(XButtonEvent *);
void group_menu(struct screen_ctx *);
void group_movetogroup(struct client_ctx *, int);
void group_only(struct screen_ctx *, int);
void group_sticky(struct client_ctx *);

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: group.c,v 1.77 2013/07/08 15:48:16 okan Exp $
* $OpenBSD: group.c,v 1.78 2013/07/09 01:24:49 okan Exp $
*/
#include <sys/param.h>
@ -309,16 +309,13 @@ group_cycle(struct screen_ctx *sc, int flags)
}
void
group_menu(XButtonEvent *e)
group_menu(struct screen_ctx *sc)
{
struct screen_ctx *sc;
struct group_ctx *gc;
struct menu *mi;
struct menu_q menuq;
int i;
sc = screen_fromroot(e->root);
TAILQ_INIT(&menuq);
for (i = 0; i < CALMWM_NGROUPS; i++) {

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: mousefunc.c,v 1.55 2013/07/08 18:39:20 okan Exp $
* $OpenBSD: mousefunc.c,v 1.56 2013/07/09 01:24:49 okan Exp $
*/
#include <sys/param.h>
@ -216,7 +216,7 @@ mousefunc_client_rcyclegroup(struct client_ctx *cc, void *arg)
void
mousefunc_menu_group(struct client_ctx *cc, void *arg)
{
group_menu(arg);
group_menu(cc->sc);
}
void