forked from 12to11/12to11
Minor code pruning
* dmabuf.c (struct _BufferParams): Prune unused code. * shm.c (CreateBuffer): Fix offset checks. * xdg_toplevel.c (SetAppId): Don't allow setting the app ID on a mapped surface.
This commit is contained in:
parent
007ba43dba
commit
266c3e5c1e
3 changed files with 11 additions and 7 deletions
3
dmabuf.c
3
dmabuf.c
|
@ -102,9 +102,6 @@ struct _BufferParams
|
|||
/* The width and height of the buffer that will be created. */
|
||||
int width, height;
|
||||
|
||||
/* The buffer ID that will be used to create the buffer. */
|
||||
uint32_t buffer_id;
|
||||
|
||||
/* The DRM format. */
|
||||
uint32_t drm_format;
|
||||
};
|
||||
|
|
10
shm.c
10
shm.c
|
@ -263,17 +263,18 @@ CreateBuffer (struct wl_client *client, struct wl_resource *resource,
|
|||
if (!depth)
|
||||
{
|
||||
wl_resource_post_error (resource, WL_SHM_ERROR_INVALID_FORMAT,
|
||||
"The specified format is not supported");
|
||||
"the specified format is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
pool = wl_resource_get_user_data (resource);
|
||||
|
||||
if (pool->size < offset || stride != width * 4
|
||||
|| offset + stride * height > pool->size)
|
||||
|| offset + stride * height > pool->size
|
||||
|| offset < 0)
|
||||
{
|
||||
wl_resource_post_error (resource, WL_SHM_ERROR_INVALID_STRIDE,
|
||||
"Invalid offset or stride, or pool too small");
|
||||
"invalid offset or stride, or pool too small");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -288,7 +289,8 @@ CreateBuffer (struct wl_client *client, struct wl_resource *resource,
|
|||
{
|
||||
/* X doesn't support smaller drawables. */
|
||||
wl_resource_post_error (resource, WL_SHM_ERROR_INVALID_STRIDE,
|
||||
"Invalid size, X server does not support zero-width drawables");
|
||||
"invalid size, this server does not support"
|
||||
" zero-width drawables");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1622,6 +1622,11 @@ SetAppId (struct wl_client *client, struct wl_resource *resource,
|
|||
if (!toplevel->role)
|
||||
return;
|
||||
|
||||
if (toplevel->state & StateIsMapped)
|
||||
/* The toplevel is already mapped. Setting class hints in this
|
||||
situation is not possible under X. */
|
||||
return;
|
||||
|
||||
class_hints.res_name = (char *) app_id;
|
||||
class_hints.res_class = (char *) app_id;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue