Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
wayland
wayland
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 94
    • Issues 94
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 23
    • Merge Requests 23
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • wayland
  • waylandwayland
  • Issues
  • #160

Closed
Open
Opened Apr 29, 2020 by Christian Rauch@christian-rauch

allow NULL callbacks in listeners

A client has to provide callback function pointers for all callbacks in a listener even if these are not used.

Example:

It is not possible to define a wl_keyboard_listener with only a subset of callbacks defined:

static const struct wl_keyboard_listener keyboard_listener = {
  .keymap = keyboard_keymap,
  .key = keyboard_key,
  .modifiers = keyboard_modifiers,
};

Since the enter and leave callbacks are not defined, the client execution will fail with listener function for opcode 1 of wl_keyboard is NULL.

One has to define the empty functions:

void keyboard_enter(...)
{
  //
}

void keyboard_leave(...)
{
  //
}

to work around this issue. This produces a lot of code clutter.

To remove the need to provide function pointers for unused callbacks, the wayland client library should handle undefined (NULL) callback function pointers and simply ignore (skip) these callbacks if they are not defined.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: wayland/wayland#160