X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=a6323d6f636a1cd7672978281e2369f0f6ab3ea4;hb=ff39f02c38f738168644fc38a7ad526bf16c2ab7;hp=bd8ae9e40fd9192706c51ec9f8347274088cea19;hpb=ed4c6995ca199e5d015f1ca90654b4030c7ea760;p=chaz%2Fopenbox 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; } }