window: assimilate window_get_resize_dx_dy() into the call site
Not used elsewhere, just cleanup. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
02bba7ceb0
commit
7bcfeade53
+15
-24
@@ -1140,26 +1140,6 @@ display_get_pointer_image(struct display *display, int pointer)
|
|||||||
return cursor ? cursor->images[0] : NULL;
|
return cursor ? cursor->images[0] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
window_get_resize_dx_dy(struct window *window, int *x, int *y)
|
|
||||||
{
|
|
||||||
struct surface *surface = window->main_surface;
|
|
||||||
|
|
||||||
if (window->resize_edges & WINDOW_RESIZING_LEFT)
|
|
||||||
*x = surface->server_allocation.width -
|
|
||||||
surface->allocation.width;
|
|
||||||
else
|
|
||||||
*x = 0;
|
|
||||||
|
|
||||||
if (window->resize_edges & WINDOW_RESIZING_TOP)
|
|
||||||
*y = surface->server_allocation.height -
|
|
||||||
surface->allocation.height;
|
|
||||||
else
|
|
||||||
*y = 0;
|
|
||||||
|
|
||||||
window->resize_edges = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
surface_attach_surface(struct surface *surface)
|
surface_attach_surface(struct surface *surface)
|
||||||
{
|
{
|
||||||
@@ -1259,8 +1239,10 @@ surface_create_surface(struct surface *surface, int dx, int dy, uint32_t flags)
|
|||||||
static void
|
static void
|
||||||
window_create_surface(struct window *window)
|
window_create_surface(struct window *window)
|
||||||
{
|
{
|
||||||
|
struct surface *surface = window->main_surface;
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
int dx, dy;
|
int dx = 0;
|
||||||
|
int dy = 0;
|
||||||
|
|
||||||
if (!window->transparent)
|
if (!window->transparent)
|
||||||
flags |= SURFACE_OPAQUE;
|
flags |= SURFACE_OPAQUE;
|
||||||
@@ -1268,9 +1250,18 @@ window_create_surface(struct window *window)
|
|||||||
if (window->resizing)
|
if (window->resizing)
|
||||||
flags |= SURFACE_HINT_RESIZE;
|
flags |= SURFACE_HINT_RESIZE;
|
||||||
|
|
||||||
window_get_resize_dx_dy(window, &dx, &dy);
|
if (window->resize_edges & WINDOW_RESIZING_LEFT)
|
||||||
window->cairo_surface =
|
dx = surface->server_allocation.width -
|
||||||
surface_create_surface(window->main_surface, dx, dy, flags);
|
surface->allocation.width;
|
||||||
|
|
||||||
|
if (window->resize_edges & WINDOW_RESIZING_TOP)
|
||||||
|
dy = surface->server_allocation.height -
|
||||||
|
surface->allocation.height;
|
||||||
|
|
||||||
|
window->resize_edges = 0;
|
||||||
|
|
||||||
|
window->cairo_surface = surface_create_surface(window->main_surface,
|
||||||
|
dx, dy, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user