Resolve some TODOs

* 12to11.c (PickVisual): Remove redundant TODOs.
* dmabuf.c (CreateHeader): Handle flags like wlroots.
* dnd.c (HandleXdndPositionEvent):
* subsurface.c:
* xdg_surface.c (CurrentRootPosition, XLGetXdgSurface): Remove
outdated TODOs.
This commit is contained in:
oldosfan 2022-09-15 02:38:06 +00:00
parent 424ab2966f
commit 007ba43dba
5 changed files with 20 additions and 13 deletions

View file

@ -46,7 +46,6 @@ PickVisual (int *depth)
if (n_visuals)
{
/* TODO: verify visual format. */
selection = visuals[0].visual;
*depth = visuals[0].depth;
XFree (visuals);

View file

@ -684,7 +684,7 @@ XLHandleOneXEventForDmabuf (XEvent *event)
#define CreateHeader \
BufferParams *params; \
int num_buffers, i, depth, bpp; \
uint32_t mod_high, mod_low; \
uint32_t mod_high, mod_low, all_flags; \
int32_t *allfds; \
\
params = wl_resource_get_user_data (resource); \
@ -752,7 +752,25 @@ XLHandleOneXEventForDmabuf (XEvent *event)
goto inert_error; \
} \
\
/* TODO: handle flags. */ \
all_flags = (ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT \
| ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED \
| ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST); \
\
if (flags & ~all_flags) \
{ \
wl_resource_post_error (resource, \
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT, \
"invalid dmabuf flags: %u", flags); \
goto inert_error; \
} \
\
if (flags) \
{ \
/* Flags are not supported by wlroots, so I guess we don't have \
to either. */ \
zwp_linux_buffer_params_v1_send_failed (resource); \
goto inert_error; \
} \
\
/* Copy the file descriptors into a buffer. At this point, we know \
there are no gaps in params->entries. */ \

3
dnd.c
View file

@ -990,8 +990,6 @@ HandleXdndPositionEvent (Surface *surface, XEvent *event)
uint32_t action;
Bool sent_actions;
/* TODO: handle subsurfaces. */
if (event->xclient.data.l[0] != dnd_state.source_window)
/* The message is coming from the wrong window, or drag and drop
has not yet been set up. */
@ -1011,7 +1009,6 @@ HandleXdndPositionEvent (Surface *surface, XEvent *event)
XLWindowFromSurface (surface),
root_x, root_y, &x, &y, &child);
/* Compute the action. TODO: handle multiple actions. */
action = TranslateAction (event->xclient.data.l[4]);
/* Handle mouse motion. */

View file

@ -22,8 +22,6 @@ along with 12to11. If not, see <https://www.gnu.org/licenses/>. */
#include "compositor.h"
/* TODO: handle unmapping nested subsurfaces. */
enum
{
PendingPosition = 1,

View file

@ -1049,8 +1049,6 @@ CurrentRootPosition (XdgRole *role, int *root_x, int *root_y)
return;
}
/* TODO: handle root position changing in quick succession and avoid
call to XTranslateCoordinates. */
XTranslateCoordinates (compositor.display, role->window,
DefaultRootWindow (compositor.display),
0, 0, root_x, root_y, &child_return);
@ -1285,9 +1283,6 @@ XLGetXdgSurface (struct wl_client *client, struct wl_resource *resource,
return;
}
/* TODO: post more errors if the surface is not in a valid
state. */
role = XLSafeMalloc (sizeof *role);
if (!role)