Merge pull request #46 from tiosgz/view-get-size

view_get_size: access view::geom directly
This commit is contained in:
Niclas 2021-10-18 16:29:24 +00:00 committed by GitHub
commit 68085d94e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 19 deletions

View file

@ -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 *(

View file

@ -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 *

View file

@ -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,