summaryrefslogtreecommitdiff
path: root/openbox/action.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-24 14:37:46 +0000
committerDana Jansens <danakj@orodu.net>2007-04-24 14:37:46 +0000
commitc1a124fcf287f3fe87e623f906701b7d5b21c5f0 (patch)
tree01b64dbbf7e6c31bbaa7acb1072904a4c007cf47 /openbox/action.c
parentff59630f51806b98df3a91591b09abeb2df147f7 (diff)
preliminary change to the 9 corners thing, to add a recursive 9 corners inside the middle one
Diffstat (limited to 'openbox/action.c')
-rw-r--r--openbox/action.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/openbox/action.c b/openbox/action.c
index e51f7133..daed9768 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -1598,8 +1598,35 @@ static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch)
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;
+ 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;
+ }
+ }
}
}