Revert "windo map patch"
This reverts commit cd218b417b
.
patch causes a bug with hidding windows
This commit is contained in:
parent
9d7f40b41d
commit
47484739cf
54
dwm.c
54
dwm.c
@ -281,9 +281,6 @@ static void updatetitle(Client *c);
|
|||||||
static void updatewindowtype(Client *c);
|
static void updatewindowtype(Client *c);
|
||||||
static void updatewmhints(Client *c);
|
static void updatewmhints(Client *c);
|
||||||
static void view(const Arg *arg);
|
static void view(const Arg *arg);
|
||||||
static void window_set_state(Display *dpy, Window win, long state);
|
|
||||||
static void window_map(Display *dpy, Client *c, int deiconify);
|
|
||||||
static void window_unmap(Display *dpy, Window win, Window root, int iconify);
|
|
||||||
static Client *wintoclient(Window w);
|
static Client *wintoclient(Window w);
|
||||||
static Monitor *wintomon(Window w);
|
static Monitor *wintomon(Window w);
|
||||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
@ -2575,12 +2572,14 @@ showhide(Client *c)
|
|||||||
return;
|
return;
|
||||||
if (ISVISIBLE(c)) {
|
if (ISVISIBLE(c)) {
|
||||||
/* show clients top down */
|
/* show clients top down */
|
||||||
window_map(dpy, c, 1);
|
XMoveWindow(dpy, c->win, c->x, c->y);
|
||||||
|
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
|
||||||
|
resize(c, c->x, c->y, c->w, c->h, 0);
|
||||||
showhide(c->snext);
|
showhide(c->snext);
|
||||||
} else {
|
} else {
|
||||||
/* hide clients bottom up */
|
/* hide clients bottom up */
|
||||||
showhide(c->snext);
|
showhide(c->snext);
|
||||||
window_unmap(dpy, c->win, root, 1);
|
XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3181,51 +3180,6 @@ updatewmhints(Client *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
window_set_state(Display *dpy, Window win, long state)
|
|
||||||
{
|
|
||||||
long data[] = { state, None };
|
|
||||||
|
|
||||||
XChangeProperty(dpy, win, wmatom[WMState], wmatom[WMState], 32,
|
|
||||||
PropModeReplace, (unsigned char*)data, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
window_map(Display *dpy, Client *c, int deiconify)
|
|
||||||
{
|
|
||||||
Window win = c->win;
|
|
||||||
|
|
||||||
if (deiconify)
|
|
||||||
window_set_state(dpy, win, NormalState);
|
|
||||||
|
|
||||||
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
|
||||||
XSetInputFocus(dpy, win, RevertToPointerRoot, CurrentTime);
|
|
||||||
XMapWindow(dpy, win);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
window_unmap(Display *dpy, Window win, Window root, int iconify)
|
|
||||||
{
|
|
||||||
static XWindowAttributes ca, ra;
|
|
||||||
|
|
||||||
XGrabServer(dpy);
|
|
||||||
XGetWindowAttributes(dpy, root, &ra);
|
|
||||||
XGetWindowAttributes(dpy, win, &ca);
|
|
||||||
|
|
||||||
/* Prevent UnmapNotify events */
|
|
||||||
XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
|
|
||||||
XSelectInput(dpy, win, ca.your_event_mask & ~StructureNotifyMask);
|
|
||||||
|
|
||||||
XUnmapWindow(dpy, win);
|
|
||||||
|
|
||||||
if (iconify)
|
|
||||||
window_set_state(dpy, win, IconicState);
|
|
||||||
|
|
||||||
XSelectInput(dpy, root, ra.your_event_mask);
|
|
||||||
XSelectInput(dpy, win, ca.your_event_mask);
|
|
||||||
XUngrabServer(dpy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
view(const Arg *arg)
|
view(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
@ -1,83 +0,0 @@
|
|||||||
diff --git a/dwm.c b/dwm.c
|
|
||||||
index e5efb6a..eaf0333 100644
|
|
||||||
--- a/dwm.c
|
|
||||||
+++ b/dwm.c
|
|
||||||
@@ -228,6 +228,9 @@ static void updatetitle(Client *c);
|
|
||||||
static void updatewindowtype(Client *c);
|
|
||||||
static void updatewmhints(Client *c);
|
|
||||||
static void view(const Arg *arg);
|
|
||||||
+static void window_set_state(Display *dpy, Window win, long state);
|
|
||||||
+static void window_map(Display *dpy, Client *c, int deiconify);
|
|
||||||
+static void window_unmap(Display *dpy, Window win, Window root, int iconify);
|
|
||||||
static Client *wintoclient(Window w);
|
|
||||||
static Monitor *wintomon(Window w);
|
|
||||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
|
||||||
@@ -1617,14 +1620,12 @@ showhide(Client *c)
|
|
||||||
return;
|
|
||||||
if (ISVISIBLE(c)) {
|
|
||||||
/* show clients top down */
|
|
||||||
- XMoveWindow(dpy, c->win, c->x, c->y);
|
|
||||||
- if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
|
|
||||||
- resize(c, c->x, c->y, c->w, c->h, 0);
|
|
||||||
+ window_map(dpy, c, 1);
|
|
||||||
showhide(c->snext);
|
|
||||||
} else {
|
|
||||||
/* hide clients bottom up */
|
|
||||||
showhide(c->snext);
|
|
||||||
- XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
|
|
||||||
+ window_unmap(dpy, c->win, root, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2032,6 +2033,51 @@ updatewmhints(Client *c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+void
|
|
||||||
+window_set_state(Display *dpy, Window win, long state)
|
|
||||||
+{
|
|
||||||
+ long data[] = { state, None };
|
|
||||||
+
|
|
||||||
+ XChangeProperty(dpy, win, wmatom[WMState], wmatom[WMState], 32,
|
|
||||||
+ PropModeReplace, (unsigned char*)data, 2);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+window_map(Display *dpy, Client *c, int deiconify)
|
|
||||||
+{
|
|
||||||
+ Window win = c->win;
|
|
||||||
+
|
|
||||||
+ if (deiconify)
|
|
||||||
+ window_set_state(dpy, win, NormalState);
|
|
||||||
+
|
|
||||||
+ XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
|
||||||
+ XSetInputFocus(dpy, win, RevertToPointerRoot, CurrentTime);
|
|
||||||
+ XMapWindow(dpy, win);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+window_unmap(Display *dpy, Window win, Window root, int iconify)
|
|
||||||
+{
|
|
||||||
+ static XWindowAttributes ca, ra;
|
|
||||||
+
|
|
||||||
+ XGrabServer(dpy);
|
|
||||||
+ XGetWindowAttributes(dpy, root, &ra);
|
|
||||||
+ XGetWindowAttributes(dpy, win, &ca);
|
|
||||||
+
|
|
||||||
+ /* Prevent UnmapNotify events */
|
|
||||||
+ XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
|
|
||||||
+ XSelectInput(dpy, win, ca.your_event_mask & ~StructureNotifyMask);
|
|
||||||
+
|
|
||||||
+ XUnmapWindow(dpy, win);
|
|
||||||
+
|
|
||||||
+ if (iconify)
|
|
||||||
+ window_set_state(dpy, win, IconicState);
|
|
||||||
+
|
|
||||||
+ XSelectInput(dpy, root, ra.your_event_mask);
|
|
||||||
+ XSelectInput(dpy, win, ca.your_event_mask);
|
|
||||||
+ XUngrabServer(dpy);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void
|
|
||||||
view(const Arg *arg)
|
|
||||||
{
|
|
Loading…
Reference in New Issue
Block a user