[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Misc patches (back?)ported from dwm
Hi there.
I've been keeping this couple of patches in my awesome repo all this
time and thought you might be interested in them. The first one adds
support for lowering floating windows, while the second one warps the
mouse pointer to the center of the focused window, whenever that
changes. These two patches were ported from dwm to awesome and are
already included in the relevant FreeBSD port as user-selectable options
in compile-time, but it would be nice if they went into tip. Both of
them are against v1.3.
--- extrapatch-lowerfloat begins here ---
--- layout.c.orig 2007-09-26 12:08:27.000000000 +0300
+++ layout.c 2007-09-26 17:41:42.000000000 +0300
@@ -118,25 +118,7 @@
drawstatusbar(disp, drawcontext, awesomeconf);
if(!sel)
return;
- if(sel->isfloating || IS_ARRANGE(layout_floating))
- XRaiseWindow(disp, sel->win);
- if(!IS_ARRANGE(layout_floating))
- {
- wc.stack_mode = Below;
- wc.sibling = awesomeconf->statusbar.window;
- if(!sel->isfloating)
- {
- XConfigureWindow(disp, sel->win, CWSibling | CWStackMode, &wc);
- wc.sibling = sel->win;
- }
- for(c = clients; c; c = c->next)
- {
- if(!IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags) || c == sel)
- continue;
- XConfigureWindow(disp, c->win, CWSibling | CWStackMode, &wc);
- wc.sibling = c->win;
- }
- }
+ XRaiseWindow(disp, sel->win);
XSync(disp, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
}
--- extrapatch-lowerfloat ends here ---
--- extrapatch-warp begins here ---
--- layout.c.orig 2007-09-26 13:18:33.000000000 +0300
+++ layout.c 2007-09-26 13:20:48.000000000 +0300
@@ -114,6 +114,22 @@
Client *c;
XEvent ev;
XWindowChanges wc;
+ Window dummy, root;
+ int wex, wey, ex, ey, i;
+ unsigned int dmask;
+
+ if(sel) {
+ ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, &awesomeconf->statusbar);
+ root = RootWindow(disp, awesomeconf->screen);
+ XQueryPointer(disp, sel->win, &dummy, &dummy, &i, &i, &wex, &wey, &dmask);
+ XTranslateCoordinates(disp, sel->win, root, wex, wey, &ex, &ey, &dummy);
+ /* I'm so sorry for this... Shame on me... */
+ if(ex > si[awesomeconf->screen].x_org && ex < si[awesomeconf->screen].width && ey > si[awesomeconf->screen].y_org && ey < si[awesomeconf->screen].height) {
+ XSelectInput(disp, root, SubstructureRedirectMask & EnterWindowMask);
+ XWarpPointer(disp, None, sel->win, 0, 0, 0, 0, sel->w / 2, sel->h / 2);
+ XSelectInput(disp, root, SubstructureRedirectMask);
+ }
+ }
drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf);
if(!sel)
--- extrapatch-warp ends here ---
Cheers...
\n\n
--
To unsubscribe, send mail to awesome-unsubscribe@xxxxxxxxxxxxx