window: Replace manual switch statement for a resizing grab op

This commit is contained in:
Jasper St. Pierre 2014-04-29 15:33:09 -04:00
parent 70713cc7db
commit e382a4b560

View File

@ -7334,38 +7334,12 @@ meta_window_is_client_decorated (MetaWindow *window)
void
meta_window_refresh_resize_popup (MetaWindow *window)
{
if (window->display->grab_op == META_GRAB_OP_NONE)
if (!meta_grab_op_is_resizing (window->display->grab_op))
return;
if (window->display->grab_window != window)
return;
switch (window->display->grab_op)
{
case META_GRAB_OP_RESIZING_SE:
case META_GRAB_OP_RESIZING_S:
case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW:
case META_GRAB_OP_RESIZING_W:
case META_GRAB_OP_RESIZING_E:
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
case META_GRAB_OP_KEYBOARD_RESIZING_S:
case META_GRAB_OP_KEYBOARD_RESIZING_N:
case META_GRAB_OP_KEYBOARD_RESIZING_W:
case META_GRAB_OP_KEYBOARD_RESIZING_E:
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
break;
default:
/* Not resizing */
return;
}
if (window->display->grab_resize_popup == NULL)
{
if (window->size_hints.width_inc > 1 ||