xdg-shell: Drop edges arg from xdg_surface configure event
This commit is contained in:
+1
-3
@@ -3851,12 +3851,10 @@ handle_surface_ping(void *data, struct xdg_surface *xdg_surface, uint32_t serial
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
||||||
uint32_t edges, int32_t width, int32_t height)
|
int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
struct window *window = data;
|
struct window *window = data;
|
||||||
|
|
||||||
window->resize_edges = edges;
|
|
||||||
|
|
||||||
window_schedule_resize(window, width, height);
|
window_schedule_resize(window, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-3
@@ -134,6 +134,7 @@ struct shell_surface {
|
|||||||
bool saved_size_valid;
|
bool saved_size_valid;
|
||||||
bool saved_rotation_valid;
|
bool saved_rotation_valid;
|
||||||
int unresponsive, grabbed;
|
int unresponsive, grabbed;
|
||||||
|
uint32_t resize_edges;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct weston_transform transform;
|
struct weston_transform transform;
|
||||||
@@ -347,6 +348,7 @@ shell_grab_end(struct shell_grab *grab)
|
|||||||
if (grab->shsurf) {
|
if (grab->shsurf) {
|
||||||
wl_list_remove(&grab->shsurf_destroy_listener.link);
|
wl_list_remove(&grab->shsurf_destroy_listener.link);
|
||||||
grab->shsurf->grabbed = 0;
|
grab->shsurf->grabbed = 0;
|
||||||
|
grab->shsurf->resize_edges = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
weston_pointer_end_grab(grab->grab.pointer);
|
weston_pointer_end_grab(grab->grab.pointer);
|
||||||
@@ -1691,6 +1693,7 @@ surface_resize(struct shell_surface *shsurf,
|
|||||||
surface_subsurfaces_boundingbox(shsurf->surface, NULL, NULL,
|
surface_subsurfaces_boundingbox(shsurf->surface, NULL, NULL,
|
||||||
&resize->width, &resize->height);
|
&resize->width, &resize->height);
|
||||||
|
|
||||||
|
shsurf->resize_edges = edges;
|
||||||
shell_grab_start(&resize->base, &resize_grab_interface, shsurf,
|
shell_grab_start(&resize->base, &resize_grab_interface, shsurf,
|
||||||
seat->pointer, edges);
|
seat->pointer, edges);
|
||||||
|
|
||||||
@@ -3327,7 +3330,7 @@ xdg_send_configure(struct weston_surface *surface,
|
|||||||
|
|
||||||
assert(shsurf);
|
assert(shsurf);
|
||||||
|
|
||||||
xdg_surface_send_configure(shsurf->resource, edges, width, height);
|
xdg_surface_send_configure(shsurf->resource, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct weston_shell_client xdg_client = {
|
static const struct weston_shell_client xdg_client = {
|
||||||
@@ -4837,11 +4840,22 @@ shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
|
|||||||
} else if (type_changed || sx != 0 || sy != 0 ||
|
} else if (type_changed || sx != 0 || sy != 0 ||
|
||||||
shsurf->last_width != es->width ||
|
shsurf->last_width != es->width ||
|
||||||
shsurf->last_height != es->height) {
|
shsurf->last_height != es->height) {
|
||||||
shsurf->last_width = es->width;
|
|
||||||
shsurf->last_height = es->height;
|
|
||||||
float from_x, from_y;
|
float from_x, from_y;
|
||||||
float to_x, to_y;
|
float to_x, to_y;
|
||||||
|
|
||||||
|
if (shsurf->resize_edges) {
|
||||||
|
sx = 0;
|
||||||
|
sy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shsurf->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
|
||||||
|
sx = shsurf->last_width - es->width;
|
||||||
|
if (shsurf->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP)
|
||||||
|
sy = shsurf->last_height - es->height;
|
||||||
|
|
||||||
|
shsurf->last_width = es->width;
|
||||||
|
shsurf->last_height = es->height;
|
||||||
|
|
||||||
weston_view_to_global_float(shsurf->view, 0, 0, &from_x, &from_y);
|
weston_view_to_global_float(shsurf->view, 0, 0, &from_x, &from_y);
|
||||||
weston_view_to_global_float(shsurf->view, sx, sy, &to_x, &to_y);
|
weston_view_to_global_float(shsurf->view, sx, sy, &to_x, &to_y);
|
||||||
configure(shell, es,
|
configure(shell, es,
|
||||||
|
|||||||
@@ -230,7 +230,6 @@
|
|||||||
in surface local coordinates.
|
in surface local coordinates.
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<arg name="edges" type="uint"/>
|
|
||||||
<arg name="width" type="int"/>
|
<arg name="width" type="int"/>
|
||||||
<arg name="height" type="int"/>
|
<arg name="height" type="int"/>
|
||||||
</event>
|
</event>
|
||||||
|
|||||||
Reference in New Issue
Block a user