all repos — openbox @ f20182804656b9f1a705c93bc1f42f92ab3590ef

openbox fork - make it a bit more like ryudo

this doesn't work yet but i don't want to screw it up accidentally
Mikael Magnusson mikachu@comhem.se
commit

f20182804656b9f1a705c93bc1f42f92ab3590ef

parent

ac241a8235be139ddfa15d6f2cbdcb64385c25d9

1 files changed, 21 insertions(+), 48 deletions(-)

jump to
M openbox/action.copenbox/action.c

@@ -1579,54 +1579,27 @@ else

return prop_atoms.net_wm_moveresize_size_topleft; } } else { - if (x - cx > cw * 2 / 3) { - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottomright; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_topright; - else - return prop_atoms.net_wm_moveresize_size_right; - } else if (x - cx < cw / 3) { - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottomleft; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_topleft; - else - return prop_atoms.net_wm_moveresize_size_left; - } else - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottom; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_top; - else { - /* inside the middle square... */ - cx += cw / 3; - cy += ch / 3; - cw /= 3; - ch /= 3; - if (x - cx > cw * 2 / 3) { - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottomright; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_topright; - else - return prop_atoms.net_wm_moveresize_size_right; - } else if (x - cx < cw / 3) { - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottomleft; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_topleft; - else - return prop_atoms.net_wm_moveresize_size_left; - } else - if (y - cy > ch * 2 / 3) - return prop_atoms.net_wm_moveresize_size_bottom; - else if (y - cy < ch / 3) - return prop_atoms.net_wm_moveresize_size_top; - else { - return prop_atoms.net_wm_moveresize_move; - } - } + /* let's make x and y client relative instead of screen relative */ + x = x - cx; + y = y - cy; + if (y < -4*x*ch/cw+7*ch/3 && y > -ch*x/4/cw+2*ch/3) + return prop_atoms.net_wm_moveresize_size_topleft; + else if (y > 5*ch/9 && y > 4*x*ch/cw-15*ch/9) + return prop_atoms.net_wm_moveresize_size_top; + else if (y > ch*x/4/cw+5*ch/12) + return prop_atoms.net_wm_moveresize_size_topright; + else if (x < 4*cw/9 && y > ch*x/4/cw+ch/3) + return prop_atoms.net_wm_moveresize_size_left; + else if (x > 5*cw/9 && y > -ch*x/4/cw+7*ch/12) + return prop_atoms.net_wm_moveresize_size_right; + else if (y > 4*ch*x/cw-4*ch/3) + return prop_atoms.net_wm_moveresize_size_bottomleft; + else if (y < 4*ch/9 && y < -4*x*ch/cw+8*ch/3) + return prop_atoms.net_wm_moveresize_size_bottom; + else if (y > 5*cw/9) + return prop_atoms.net_wm_moveresize_size_bottomright; + else + return prop_atoms.net_wm_moveresize_move; } }