view: add proper abstraction with interface

This commit is contained in:
Jente Hidskes 2019-01-30 17:01:16 +01:00
parent 24517922cc
commit 64b971a665
7 changed files with 201 additions and 121 deletions

11
seat.c
View file

@ -27,6 +27,9 @@
#include "seat.h"
#include "server.h"
#include "view.h"
#if CAGE_HAS_XWAYLAND
#include "xwayland.h"
#endif
static void drag_icon_update_position(struct cg_drag_icon *drag_icon);
@ -707,9 +710,11 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view)
}
#if CAGE_HAS_XWAYLAND
if (view->type == CAGE_XWAYLAND_VIEW &&
!wlr_xwayland_or_surface_wants_focus(view->xwayland_surface)) {
return;
if (view->type == CAGE_XWAYLAND_VIEW) {
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
if (!wlr_xwayland_or_surface_wants_focus(xwayland_view->xwayland_surface)) {
return;
}
}
#endif