mirror of
https://github.com/swaywm/sway.git
synced 2025-11-26 06:59:59 -05:00
Add view_get_geometry
This commit is contained in:
parent
db4b4935b3
commit
b3ee9af0c8
4 changed files with 28 additions and 37 deletions
|
|
@ -107,7 +107,8 @@ static void get_constraints(struct sway_view *view, double *min_width,
|
|||
*max_height = state->max_height > 0 ? state->max_height : DBL_MAX;
|
||||
}
|
||||
|
||||
static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) {
|
||||
static const char *get_string_prop(struct sway_view *view,
|
||||
enum sway_view_prop prop) {
|
||||
if (xdg_shell_view_from_view(view) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -121,6 +122,16 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p
|
|||
}
|
||||
}
|
||||
|
||||
static void get_geometry(struct sway_view *view, struct wlr_box *box) {
|
||||
struct sway_xdg_shell_view *xdg_shell_view =
|
||||
xdg_shell_view_from_view(view);
|
||||
if (xdg_shell_view == NULL) {
|
||||
return;
|
||||
}
|
||||
struct wlr_xdg_surface *surface = view->wlr_xdg_surface;
|
||||
wlr_xdg_surface_get_geometry(surface, box);
|
||||
}
|
||||
|
||||
static uint32_t configure(struct sway_view *view, double lx, double ly,
|
||||
int width, int height) {
|
||||
struct sway_xdg_shell_view *xdg_shell_view =
|
||||
|
|
@ -231,6 +242,7 @@ static void destroy(struct sway_view *view) {
|
|||
static const struct sway_view_impl view_impl = {
|
||||
.get_constraints = get_constraints,
|
||||
.get_string_prop = get_string_prop,
|
||||
.get_geometry = get_geometry,
|
||||
.configure = configure,
|
||||
.set_activated = set_activated,
|
||||
.set_tiled = set_tiled,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue