]> git.mdlowis.com Git - proto/labwc.git/commitdiff
view: remove view_hasfocus()
authorJohan Malm <jgm323@gmail.com>
Mon, 14 Sep 2020 16:42:39 +0000 (17:42 +0100)
committerJohan Malm <jgm323@gmail.com>
Mon, 14 Sep 2020 16:42:39 +0000 (17:42 +0100)
src/output.c
src/view.c

index d588a508e3b894df9be87d1136122f6c221e12a6..44cf15e1486d93507018afb6a6e418aa0fb1b447 100644 (file)
@@ -103,13 +103,13 @@ static void render_decorations(struct wlr_output *output, struct view *view)
        draw_rect(&ddata, deco_box(view, LAB_DECO_PART_BOTTOM));
        draw_rect(&ddata, deco_box(view, LAB_DECO_PART_LEFT));
 
-       if (view_hasfocus(view))
+       if (view->surface == seat_focused_surface())
                ddata.rgba = theme.window_active_title_bg_color;
        else
                ddata.rgba = theme.window_inactive_title_bg_color;
        draw_rect(&ddata, deco_box(view, LAB_DECO_PART_TITLE));
 
-       if (view_hasfocus(view)) {
+       if (view->surface == seat_focused_surface()) {
                render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_CLOSE),
                            theme.xbm_close_active_unpressed);
                render_icon(&ddata, deco_box(view, LAB_DECO_BUTTON_MAXIMIZE),
index e28588c0d2b9699246ab77addd4b4436bd2622b8..d47a07b3180808a703a1c8726c2bc4e4c1f53696 100644 (file)
@@ -84,11 +84,3 @@ void view_unminimize(struct view *view)
        view->minimized = false;
        view->impl->map(view);
 }
-
-bool view_hasfocus(struct view *view)
-{
-       if (!view || !view->surface)
-               return false;
-       struct wlr_seat *seat = view->server->seat;
-       return (view->surface == seat->keyboard_state.focused_surface);
-}