]> git.mdlowis.com Git - proto/labwc.git/commitdiff
view.c: simplify view_at()
authorJohan Malm <jgm323@gmail.com>
Wed, 2 Sep 2020 19:26:18 +0000 (20:26 +0100)
committerJohan Malm <jgm323@gmail.com>
Wed, 2 Sep 2020 19:26:18 +0000 (20:26 +0100)
src/view.c

index 8974ad9e7632f7cfbef389c1fbc0942bc4849da1..cd887c947c4c477329762a65fa4aa07cd0c0236f 100644 (file)
@@ -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;
 }