event: fix configure requests where a window in another desktop requests focus; client, cursor, event, grab, key, manage, menu: clang-format
This commit is contained in:
parent
2a3fb33866
commit
548f2f7cba
7 changed files with 36 additions and 36 deletions
6
cursor.c
6
cursor.c
|
@ -141,8 +141,7 @@ static char grey_bits[] = {0x01, 0x04};
|
|||
|
||||
static XColor bl, wh;
|
||||
|
||||
Cursor getcursor(Cursordata* c, ScreenInfo* s)
|
||||
{
|
||||
Cursor getcursor(Cursordata* c, ScreenInfo* s) {
|
||||
Pixmap f, m;
|
||||
|
||||
f = XCreatePixmapFromBitmapData(
|
||||
|
@ -166,8 +165,7 @@ Cursor getcursor(Cursordata* c, ScreenInfo* s)
|
|||
return XCreatePixmapCursor(dpy, f, m, &bl, &wh, c->hot[0], c->hot[1]);
|
||||
}
|
||||
|
||||
void initcurs(ScreenInfo* s)
|
||||
{
|
||||
void initcurs(ScreenInfo* s) {
|
||||
XColor dummy;
|
||||
|
||||
XAllocNamedColor(dpy, DefaultColormap(dpy, s->num), "black", &bl, &dummy);
|
||||
|
|
6
event.c
6
event.c
|
@ -159,6 +159,8 @@ void configurereq(XConfigureRequestEvent* e) {
|
|||
XConfigureWindow(dpy, c->parent, e->value_mask, &wc);
|
||||
|
||||
if (e->value_mask & CWStackMode) {
|
||||
if (c->virt > 0 && c->virt != virt)
|
||||
switch_to(c->virt);
|
||||
top(c);
|
||||
active(c);
|
||||
}
|
||||
|
@ -292,14 +294,14 @@ void newwindow(XCreateWindowEvent* e) {
|
|||
void destroy(Window w) {
|
||||
int i;
|
||||
Client* c;
|
||||
// int v;
|
||||
// int v;
|
||||
|
||||
curtime = CurrentTime;
|
||||
c = getclient(w, 0);
|
||||
if (c == 0)
|
||||
return;
|
||||
|
||||
// v = c->virt;
|
||||
// v = c->virt;
|
||||
if (numvirtuals > 1)
|
||||
for (i = 0; i < numvirtuals; i++)
|
||||
if (currents[i] == c)
|
||||
|
|
10
grab.c
10
grab.c
|
@ -581,7 +581,7 @@ int sweepdrag(
|
|||
getmouse(&cx, &cy, c->screen);
|
||||
else
|
||||
getmouse(&c->x, &c->y, c->screen);
|
||||
//XGrabServer(dpy);
|
||||
// XGrabServer(dpy);
|
||||
if (bl != BorderUnknown) {
|
||||
notmoved = recalc(c, cx, cy, bl, notmoved);
|
||||
}
|
||||
|
@ -593,10 +593,10 @@ int sweepdrag(
|
|||
if (rx != cx || ry != cy || ++idle > 300) {
|
||||
drawbound(c, 0);
|
||||
if (rx == cx && ry == cy) {
|
||||
//XUngrabServer(dpy);
|
||||
// XUngrabServer(dpy);
|
||||
XFlush(dpy);
|
||||
//misleep(500);
|
||||
//XGrabServer(dpy);
|
||||
// misleep(500);
|
||||
// XGrabServer(dpy);
|
||||
idle = 0;
|
||||
}
|
||||
if (e0 || bl != BorderUnknown)
|
||||
|
@ -617,7 +617,7 @@ int sweepdrag(
|
|||
case ButtonRelease:
|
||||
drawbound(c, 0);
|
||||
ungrab(e);
|
||||
//XUngrabServer(dpy);
|
||||
// XUngrabServer(dpy);
|
||||
if (e->button != but && c->init)
|
||||
goto bad;
|
||||
if (c->dx < 0) {
|
||||
|
|
16
key.c
16
key.c
|
@ -461,11 +461,11 @@ void keypress(XKeyEvent* e) {
|
|||
zoom = !zoom;
|
||||
if (zoom) {
|
||||
quickreshape(
|
||||
current,
|
||||
-BORDER,
|
||||
-BORDER,
|
||||
ra.width + 2 * BORDER,
|
||||
ra.height + 2 * BORDER);
|
||||
current,
|
||||
-BORDER,
|
||||
-BORDER,
|
||||
ra.width + 2 * BORDER,
|
||||
ra.height + 2 * BORDER);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -508,7 +508,7 @@ void keypress(XKeyEvent* e) {
|
|||
ra.height / 2 - 1.5 * GAPSZ);
|
||||
#endif
|
||||
|
||||
/* quarter snap */
|
||||
/* quarter snap */
|
||||
#ifdef SNAPTOPLEFT_KEY
|
||||
else if (e->keycode == qcode && (e->state & SHORTCUTMOD) == (MODBITS))
|
||||
quickreshape(
|
||||
|
@ -546,7 +546,7 @@ void keypress(XKeyEvent* e) {
|
|||
ra.height / 2 - 1.5 * GAPSZ);
|
||||
#endif
|
||||
|
||||
/* center snap */
|
||||
/* center snap */
|
||||
#ifdef SNAPCENTER_KEY
|
||||
else if (e->keycode == ccode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
||||
if ((e->state & ShiftMask) == (1 << 0)) {
|
||||
|
@ -573,7 +573,7 @@ void keypress(XKeyEvent* e) {
|
|||
stickystack(0);
|
||||
#endif
|
||||
|
||||
/* launch */
|
||||
/* launch */
|
||||
#ifdef LAUNCH_KEY
|
||||
else if (e->keycode == slcode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
||||
kbLaunch = 1;
|
||||
|
|
14
manage.c
14
manage.c
|
@ -560,15 +560,15 @@ void getproto(Client* c) {
|
|||
#ifdef ALWAYSDRAW
|
||||
int shouldalwaysdraw(Client* c) {
|
||||
static char* alwaysdraw[] = ALWAYSDRAW;
|
||||
char** a = alwaysdraw;
|
||||
char** a = alwaysdraw;
|
||||
|
||||
while (*a) {
|
||||
if (c && c->class && strstr(c->class, *a)) {
|
||||
return 1;
|
||||
}
|
||||
++a;
|
||||
while (*a) {
|
||||
if (c && c->class && strstr(c->class, *a)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
++a;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
6
menu.c
6
menu.c
|
@ -182,7 +182,7 @@ void button(XButtonEvent* e) {
|
|||
case Delete:
|
||||
shift = 0;
|
||||
c = selectwin(1, &shift, s);
|
||||
delete(c, shift);
|
||||
delete (c, shift);
|
||||
break;
|
||||
case Hide:
|
||||
hide(selectwin(1, 0, s));
|
||||
|
@ -294,10 +294,10 @@ void move(Client* c, int but) {
|
|||
}
|
||||
|
||||
void delete (Client* c, int shift) {
|
||||
//int v;
|
||||
// int v;
|
||||
if (c == 0)
|
||||
return;
|
||||
//v = c->virt;
|
||||
// v = c->virt;
|
||||
if ((c->proto & Pdelete) && !shift)
|
||||
sendcmessage(c->window, wm_protocols, wm_delete, 0, 0);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue