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;
|
static XColor bl, wh;
|
||||||
|
|
||||||
Cursor getcursor(Cursordata* c, ScreenInfo* s)
|
Cursor getcursor(Cursordata* c, ScreenInfo* s) {
|
||||||
{
|
|
||||||
Pixmap f, m;
|
Pixmap f, m;
|
||||||
|
|
||||||
f = XCreatePixmapFromBitmapData(
|
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]);
|
return XCreatePixmapCursor(dpy, f, m, &bl, &wh, c->hot[0], c->hot[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initcurs(ScreenInfo* s)
|
void initcurs(ScreenInfo* s) {
|
||||||
{
|
|
||||||
XColor dummy;
|
XColor dummy;
|
||||||
|
|
||||||
XAllocNamedColor(dpy, DefaultColormap(dpy, s->num), "black", &bl, &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);
|
XConfigureWindow(dpy, c->parent, e->value_mask, &wc);
|
||||||
|
|
||||||
if (e->value_mask & CWStackMode) {
|
if (e->value_mask & CWStackMode) {
|
||||||
|
if (c->virt > 0 && c->virt != virt)
|
||||||
|
switch_to(c->virt);
|
||||||
top(c);
|
top(c);
|
||||||
active(c);
|
active(c);
|
||||||
}
|
}
|
||||||
|
@ -292,14 +294,14 @@ void newwindow(XCreateWindowEvent* e) {
|
||||||
void destroy(Window w) {
|
void destroy(Window w) {
|
||||||
int i;
|
int i;
|
||||||
Client* c;
|
Client* c;
|
||||||
// int v;
|
// int v;
|
||||||
|
|
||||||
curtime = CurrentTime;
|
curtime = CurrentTime;
|
||||||
c = getclient(w, 0);
|
c = getclient(w, 0);
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// v = c->virt;
|
// v = c->virt;
|
||||||
if (numvirtuals > 1)
|
if (numvirtuals > 1)
|
||||||
for (i = 0; i < numvirtuals; i++)
|
for (i = 0; i < numvirtuals; i++)
|
||||||
if (currents[i] == c)
|
if (currents[i] == c)
|
||||||
|
|
10
grab.c
10
grab.c
|
@ -581,7 +581,7 @@ int sweepdrag(
|
||||||
getmouse(&cx, &cy, c->screen);
|
getmouse(&cx, &cy, c->screen);
|
||||||
else
|
else
|
||||||
getmouse(&c->x, &c->y, c->screen);
|
getmouse(&c->x, &c->y, c->screen);
|
||||||
//XGrabServer(dpy);
|
// XGrabServer(dpy);
|
||||||
if (bl != BorderUnknown) {
|
if (bl != BorderUnknown) {
|
||||||
notmoved = recalc(c, cx, cy, bl, notmoved);
|
notmoved = recalc(c, cx, cy, bl, notmoved);
|
||||||
}
|
}
|
||||||
|
@ -593,10 +593,10 @@ int sweepdrag(
|
||||||
if (rx != cx || ry != cy || ++idle > 300) {
|
if (rx != cx || ry != cy || ++idle > 300) {
|
||||||
drawbound(c, 0);
|
drawbound(c, 0);
|
||||||
if (rx == cx && ry == cy) {
|
if (rx == cx && ry == cy) {
|
||||||
//XUngrabServer(dpy);
|
// XUngrabServer(dpy);
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
//misleep(500);
|
// misleep(500);
|
||||||
//XGrabServer(dpy);
|
// XGrabServer(dpy);
|
||||||
idle = 0;
|
idle = 0;
|
||||||
}
|
}
|
||||||
if (e0 || bl != BorderUnknown)
|
if (e0 || bl != BorderUnknown)
|
||||||
|
@ -617,7 +617,7 @@ int sweepdrag(
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
drawbound(c, 0);
|
drawbound(c, 0);
|
||||||
ungrab(e);
|
ungrab(e);
|
||||||
//XUngrabServer(dpy);
|
// XUngrabServer(dpy);
|
||||||
if (e->button != but && c->init)
|
if (e->button != but && c->init)
|
||||||
goto bad;
|
goto bad;
|
||||||
if (c->dx < 0) {
|
if (c->dx < 0) {
|
||||||
|
|
6
menu.c
6
menu.c
|
@ -182,7 +182,7 @@ void button(XButtonEvent* e) {
|
||||||
case Delete:
|
case Delete:
|
||||||
shift = 0;
|
shift = 0;
|
||||||
c = selectwin(1, &shift, s);
|
c = selectwin(1, &shift, s);
|
||||||
delete(c, shift);
|
delete (c, shift);
|
||||||
break;
|
break;
|
||||||
case Hide:
|
case Hide:
|
||||||
hide(selectwin(1, 0, s));
|
hide(selectwin(1, 0, s));
|
||||||
|
@ -294,10 +294,10 @@ void move(Client* c, int but) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete (Client* c, int shift) {
|
void delete (Client* c, int shift) {
|
||||||
//int v;
|
// int v;
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
return;
|
return;
|
||||||
//v = c->virt;
|
// v = c->virt;
|
||||||
if ((c->proto & Pdelete) && !shift)
|
if ((c->proto & Pdelete) && !shift)
|
||||||
sendcmessage(c->window, wm_protocols, wm_delete, 0, 0);
|
sendcmessage(c->window, wm_protocols, wm_delete, 0, 0);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue