Fix ambiguity of 0 serial for surface configures

There is a bug where the transaction code will still wait for a client
commit even though the instruction configure is unsuccessful.
Unfortunately a serial of 0 is both used as a valid serial and
to denote an unsuccessful commit. Fix this my making relevant configure
functions return a boolean and taking in a serial pointer.
This commit is contained in:
Alexander Orzechowski 2022-02-21 20:03:25 -05:00
parent 85d1c98476
commit f7290007b2
5 changed files with 43 additions and 33 deletions

View file

@ -38,8 +38,8 @@ struct sway_view_impl {
const char *(*get_string_prop)(struct sway_view *view,
enum sway_view_prop prop);
uint32_t (*get_int_prop)(struct sway_view *view, enum sway_view_prop prop);
uint32_t (*configure)(struct sway_view *view, double lx, double ly,
int width, int height);
bool (*configure)(struct sway_view *view, uint32_t *serial,
double lx, double ly, int width, int height);
void (*set_activated)(struct sway_view *view, bool activated);
void (*set_tiled)(struct sway_view *view, bool tiled);
void (*set_fullscreen)(struct sway_view *view, bool fullscreen);
@ -244,8 +244,8 @@ const char *view_get_shell(struct sway_view *view);
void view_get_constraints(struct sway_view *view, double *min_width,
double *max_width, double *min_height, double *max_height);
uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
int height);
bool view_configure(struct sway_view *view, uint32_t *serial,
double lx, double ly, int width, int height);
bool view_inhibit_idle(struct sway_view *view);