summaryrefslogtreecommitdiff
path: root/openbox/action.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@comhem.se>2004-11-04 12:13:25 +0000
committerMikael Magnusson <mikachu@comhem.se>2004-11-04 12:13:25 +0000
commitff39f02c38f738168644fc38a7ad526bf16c2ab7 (patch)
treeb21635bb179b00cacc926dff0c3aabf3171cb93b /openbox/action.c
parented4c6995ca199e5d015f1ca90654b4030c7ea760 (diff)
add an option to resize with 4 corners as it was long ago and make the default 9 "corners" with the middle corner being move. that way you only need one mod+button to move and resize windows
Diffstat (limited to 'openbox/action.c')
-rw-r--r--openbox/action.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/openbox/action.c b/openbox/action.c
index bd8ae9e4..a6323d6f 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -1344,25 +1344,40 @@ void action_toggle_decorations(union ActionData *data)
static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch)
{
- if ((cw / 3 < 1) || (x - cx > cw / 3 * 2)) {
- if ((ch / 3 < 1) || (y - cy > ch / 3 * 2))
- 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 / 3 * 2)
- 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;
+ if (config_resize_four_corners) {
+ if (x - cx > cw / 2) {
+ if (y - cy > ch / 2)
+ return prop_atoms.net_wm_moveresize_size_bottomright;
+ else
+ return prop_atoms.net_wm_moveresize_size_topright;
+ } else {
+ if (y - cy > ch / 2)
+ return prop_atoms.net_wm_moveresize_size_bottomleft;
+ else
+ return prop_atoms.net_wm_moveresize_size_topleft;
+ }
} else {
- if (y - cy > ch / 2)
- return prop_atoms.net_wm_moveresize_size_bottom;
- else
- return prop_atoms.net_wm_moveresize_size_top;
+ 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;
}
}