From: Johan Malm Date: Wed, 2 Sep 2020 19:26:18 +0000 (+0100) Subject: view.c: simplify view_at() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=b99977368dd109a7a3e4f821c53212d2df84ca03;p=proto%2Flabwc.git view.c: simplify view_at() --- diff --git a/src/view.c b/src/view.c index 8974ad9e..cd887c94 100644 --- a/src/view.c +++ b/src/view.c @@ -250,26 +250,9 @@ struct view *view_at(struct server *server, double lx, double ly, return view; if (!view->show_server_side_deco) continue; - if (deco_at(view, lx, ly) == LAB_DECO_PART_TITLE) { - *view_area = LAB_DECO_PART_TITLE; + *view_area = deco_at(view, lx, ly); + if (*view_area != LAB_DECO_NONE) return view; - } - if (deco_at(view, lx, ly) == LAB_DECO_PART_TOP) { - *view_area = LAB_DECO_PART_TOP; - return view; - } - if (deco_at(view, lx, ly) == LAB_DECO_PART_RIGHT) { - *view_area = LAB_DECO_PART_RIGHT; - return view; - } - if (deco_at(view, lx, ly) == LAB_DECO_PART_BOTTOM) { - *view_area = LAB_DECO_PART_BOTTOM; - return view; - } - if (deco_at(view, lx, ly) == LAB_DECO_PART_LEFT) { - *view_area = LAB_DECO_PART_LEFT; - return view; - } } return NULL; }