mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
use CLEANMASK() where we should
This commit is contained in:
parent
69c235280d
commit
38e6a309cb
1 changed files with 10 additions and 13 deletions
23
event.c
23
event.c
|
@ -36,7 +36,7 @@
|
||||||
#include "layouts/tile.h"
|
#include "layouts/tile.h"
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
|
||||||
#define CLEANMASK(mask, screen) (mask & ~(awesomeconf[screen].numlockmask | LockMask))
|
#define CLEANMASK(mask, acf) (mask & ~(acf.numlockmask | LockMask))
|
||||||
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
|
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -160,13 +160,13 @@ uicb_resizemouse(awesome_config *awesomeconf, const char *arg __attribute__ ((un
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_mouse_button_press(awesome_config *awesomeconf,
|
handle_mouse_button_press(awesome_config *awesomeconf,
|
||||||
unsigned int button, unsigned int state, unsigned int numlockmask,
|
unsigned int button, unsigned int state,
|
||||||
Button *buttons, char *arg)
|
Button *buttons, char *arg)
|
||||||
{
|
{
|
||||||
Button *b;
|
Button *b;
|
||||||
|
|
||||||
for(b = buttons; b; b = b->next)
|
for(b = buttons; b; b = b->next)
|
||||||
if(button == b->button && (state == b->mod || state == (b->mod | numlockmask)) && b->func)
|
if(button == b->button && CLEANMASK(state, awesomeconf[0]) == b->mod && b->func)
|
||||||
{
|
{
|
||||||
if(arg)
|
if(arg)
|
||||||
b->func(awesomeconf, arg);
|
b->func(awesomeconf, arg);
|
||||||
|
@ -198,8 +198,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
|| (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x))
|
|| (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x))
|
||||||
{
|
{
|
||||||
snprintf(arg, sizeof(arg), "%d", i + 1);
|
snprintf(arg, sizeof(arg), "%d", i + 1);
|
||||||
handle_mouse_button_press(&awesomeconf[screen],
|
handle_mouse_button_press(&awesomeconf[screen], ev->button, ev->state,
|
||||||
ev->button, ev->state, awesomeconf->numlockmask,
|
|
||||||
awesomeconf[screen].buttons.tag, arg);
|
awesomeconf[screen].buttons.tag, arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -210,12 +209,10 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
&& ev->x < x)
|
&& ev->x < x)
|
||||||
|| (awesomeconf[screen].statusbar.position == BarRight && ev->y < x)
|
|| (awesomeconf[screen].statusbar.position == BarRight && ev->y < x)
|
||||||
|| (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x))
|
|| (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x))
|
||||||
handle_mouse_button_press(&awesomeconf[screen],
|
handle_mouse_button_press(&awesomeconf[screen], ev->button, ev->state,
|
||||||
ev->button, ev->state, awesomeconf->numlockmask,
|
|
||||||
awesomeconf[screen].buttons.layout, NULL);
|
awesomeconf[screen].buttons.layout, NULL);
|
||||||
else
|
else
|
||||||
handle_mouse_button_press(&awesomeconf[screen],
|
handle_mouse_button_press(&awesomeconf[screen], ev->button, ev->state,
|
||||||
ev->button, ev->state, awesomeconf->numlockmask,
|
|
||||||
awesomeconf[screen].buttons.title, NULL);
|
awesomeconf[screen].buttons.title, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +221,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XAllowEvents(c->display, ReplayPointer, CurrentTime);
|
XAllowEvents(c->display, ReplayPointer, CurrentTime);
|
||||||
focus(c, ev->same_screen, &awesomeconf[c->screen]);
|
focus(c, ev->same_screen, &awesomeconf[c->screen]);
|
||||||
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey)
|
if(CLEANMASK(ev->state, awesomeconf[c->screen]) != awesomeconf[c->screen].modkey)
|
||||||
{
|
{
|
||||||
if (ev->button == Button1)
|
if (ev->button == Button1)
|
||||||
{
|
{
|
||||||
|
@ -258,8 +255,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
||||||
&& XQueryPointer(e->xany.display, ev->window, &wdummy, &wdummy, &x, &y, &i, &i, &udummy))
|
&& XQueryPointer(e->xany.display, ev->window, &wdummy, &wdummy, &x, &y, &i, &i, &udummy))
|
||||||
{
|
{
|
||||||
screen = get_screen_bycoord(e->xany.display, x, y);
|
screen = get_screen_bycoord(e->xany.display, x, y);
|
||||||
handle_mouse_button_press(&awesomeconf[screen],
|
handle_mouse_button_press(&awesomeconf[screen], ev->button, ev->state,
|
||||||
ev->button, ev->state, awesomeconf->numlockmask,
|
|
||||||
awesomeconf[screen].buttons.root, NULL);
|
awesomeconf[screen].buttons.root, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -418,7 +414,8 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf)
|
||||||
|
|
||||||
for(i = 0; i < awesomeconf[screen].nkeys; i++)
|
for(i = 0; i < awesomeconf[screen].nkeys; i++)
|
||||||
if(keysym == awesomeconf[screen].keys[i].keysym
|
if(keysym == awesomeconf[screen].keys[i].keysym
|
||||||
&& CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func)
|
&& CLEANMASK(awesomeconf[screen].keys[i].mod, awesomeconf[screen])
|
||||||
|
== CLEANMASK(ev->state, awesomeconf[screen]) && awesomeconf[screen].keys[i].func)
|
||||||
awesomeconf[screen].keys[i].func(&awesomeconf[screen], awesomeconf[screen].keys[i].arg);
|
awesomeconf[screen].keys[i].func(&awesomeconf[screen], awesomeconf[screen].keys[i].arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue