Re: [dev] [patch] map new window *after* arrange()
Hi Peter, On 9 July 2011 00:40, Peter Hartlich bq...@hartlich.com wrote: I reviewed your patch and concluded I can't apply it as is, because focus() would be called twice, once on the unmapped window, and then on again. It seems to me that focusing and arranging should be independent operations. So here comes another patch to remove focus(NULL) from arrange and add it, if missing, everywhere arrange is called after either a window might have vanished from selmon's view, or selmon itself might have vanished. I agree with this and applied both patches. It is not my ideal solution, but I postpone an ideal version for 6.0. All, please test hg tip. If there are no issues this will become 5.9 tomorrow. Cheers, --garbeam
Re: [dev] [patch] map new window *after* arrange()
On Sat, Jul 9, 2011 at 10:01, garbeam garb...@gmail.com wrote: Hi Peter, On 9 July 2011 00:40, Peter Hartlich bq...@hartlich.com wrote: I reviewed your patch and concluded I can't apply it as is, because focus() would be called twice, once on the unmapped window, and then on again. It seems to me that focusing and arranging should be independent operations. So here comes another patch to remove focus(NULL) from arrange and add it, if missing, everywhere arrange is called after either a window might have vanished from selmon's view, or selmon itself might have vanished. I agree with this and applied both patches. It is not my ideal solution, but I postpone an ideal version for 6.0. All, please test hg tip. If there are no issues this will become 5.9 tomorrow. Cheers, --garbeam just one annoying issue with floating apps. eg. running save as in gimp, will open a window in the background.
Re: [dev] [patch] map new window *after* arrange()
just one annoying issue with floating apps. eg. running save as in gimp, will open a window in the background. Oh man, sorry. I should've tested it more with floating windows. So arrange calls arrangemon, which calls restack, but the new floating window hasn't become selmon-sel yet. Restacking again at the end of manage fixes it, but then there's another redraw. To prevent the first restack, maybe something like the attached patch? Or split off (un)select functions from (un)focus, which also came up in connection to virtual keyboards some time ago. Regards, Peter --- dwm/dwm.c.orig 2011-07-10 02:34:59.982409153 +0200 +++ dwm/dwm.c 2011-07-10 03:49:19.114387186 +0200 @@ -1150,9 +1150,12 @@ manage(Window w, XWindowAttributes *wa) attachstack(c); XMoveResizeWindow(dpy, c-win, c-x + 2 * sw, c-y, c-w, c-h); /* some windows require this */ setclientstate(c, NormalState); + unfocus(selmon-sel, False); + selmon-sel = NULL; arrange(c-mon); XMapWindow(dpy, c-win); focus(c); + restack(c-mon); } void
Re: [dev] [patch] map new window *after* arrange()
To prevent the first restack, maybe something like the attached patch? ... which causes the title bar to flicker, as restack calls drawbar before bailing out. Not sure why that's needed. Peter