-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting delta for move/resize actions #23
Comments
Looking through the code for: ISRELA()
I believe that if the string begins with a "+" or a "-" then the string is considered relative and will be added or subtracted from the current window position. window_movevoid window_move(xcb_window_t win)
{
xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, win), NULL);
if (geo == NULL) {
return;
}
uint32_t values[2] = {geo->x, geo->y};
int i = 0;
SETGEOM(x)
SETGEOM(y)
xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, values);
} and SETGEOM(v)#define SETGEOM(v) \
if (cfg.v != NULL) { \
uint32_t v = atoi(cfg.v); \
if (ISRELA(cfg.v)) { \
values[i] += v; \
} else { \
values[i] = v; \
} \
} \
i++; Perhaps the way X11 handles window move events has changed recently. It works fine (if your not counting window titles and borders) with an absolute value like:
I was unable to get this to work correctly on KDE with relative values though.
I presume the author wrote this to work with bspwm and the window move logic isn't necessarily exactly compatible with other window managers. I've had similar issues trying to handle relative window movement with xdotool and wmctrl
So far the best way my research has turned up to do a window manager independent relative window move is the code in this post... Some testing shows it working for me, but I haven't wrapped it up in something useful yet. |
You can get some windows to move relatively with
Unfortunately, this will not work on on all windows at least while running KDE. Many windows have a Titlebar/Border visible area offset that doesn't match the rest of the window geometry, so moving a window horizontally actually moves it diagonally down the screen. I'm looking into this in more detail, but it's a fairly complicated. Hopefully doesn't ultimately require integration with every window manager individually, because I would like to find a way do this only with XCB. |
Would you please tell me how to set delta for move/resize action, but not position. E.g.:
xdo move -x +1 #want to move +1 pixel from current to the right
Thanks!
The text was updated successfully, but these errors were encountered: