view_get_size: access view::geom directly
This commit is contained in:
parent
ca71a58462
commit
6a1af5f1ae
3 changed files with 2 additions and 19 deletions
|
@ -76,8 +76,6 @@ struct kiwmi_view_impl {
|
||||||
wlr_surface_iterator_func_t callback,
|
wlr_surface_iterator_func_t callback,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
pid_t (*get_pid)(struct kiwmi_view *view);
|
pid_t (*get_pid)(struct kiwmi_view *view);
|
||||||
void (
|
|
||||||
*get_size)(struct kiwmi_view *view, uint32_t *width, uint32_t *height);
|
|
||||||
void (*set_activated)(struct kiwmi_view *view, bool activated);
|
void (*set_activated)(struct kiwmi_view *view, bool activated);
|
||||||
void (*set_size)(struct kiwmi_view *view, uint32_t width, uint32_t height);
|
void (*set_size)(struct kiwmi_view *view, uint32_t width, uint32_t height);
|
||||||
const char *(
|
const char *(
|
||||||
|
|
|
@ -47,9 +47,8 @@ view_get_pid(struct kiwmi_view *view)
|
||||||
void
|
void
|
||||||
view_get_size(struct kiwmi_view *view, uint32_t *width, uint32_t *height)
|
view_get_size(struct kiwmi_view *view, uint32_t *width, uint32_t *height)
|
||||||
{
|
{
|
||||||
if (view->impl->get_size) {
|
*width = view->geom.width;
|
||||||
view->impl->get_size(view, width, height);
|
*height = view->geom.height;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
|
@ -382,19 +382,6 @@ xdg_shell_view_get_pid(struct kiwmi_view *view)
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
xdg_shell_view_get_size(
|
|
||||||
struct kiwmi_view *view,
|
|
||||||
uint32_t *width,
|
|
||||||
uint32_t *height)
|
|
||||||
{
|
|
||||||
struct wlr_box geom;
|
|
||||||
wlr_xdg_surface_get_geometry(view->xdg_surface, &geom);
|
|
||||||
|
|
||||||
*width = geom.width;
|
|
||||||
*height = geom.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
xdg_shell_view_get_string_prop(
|
xdg_shell_view_get_string_prop(
|
||||||
struct kiwmi_view *view,
|
struct kiwmi_view *view,
|
||||||
|
@ -446,7 +433,6 @@ static const struct kiwmi_view_impl xdg_shell_view_impl = {
|
||||||
.close = xdg_shell_view_close,
|
.close = xdg_shell_view_close,
|
||||||
.for_each_mapped_surface = xdg_shell_view_for_each_mapped_surface,
|
.for_each_mapped_surface = xdg_shell_view_for_each_mapped_surface,
|
||||||
.get_pid = xdg_shell_view_get_pid,
|
.get_pid = xdg_shell_view_get_pid,
|
||||||
.get_size = xdg_shell_view_get_size,
|
|
||||||
.get_string_prop = xdg_shell_view_get_string_prop,
|
.get_string_prop = xdg_shell_view_get_string_prop,
|
||||||
.set_activated = xdg_shell_view_set_activated,
|
.set_activated = xdg_shell_view_set_activated,
|
||||||
.set_size = xdg_shell_view_set_size,
|
.set_size = xdg_shell_view_set_size,
|
||||||
|
|
Loading…
Reference in a new issue