screenshooter: Add missing field initializers for wl_output_listener

Submitted by Christopher Michael on July 7, 2015, 5:27 p.m.

Details

Message ID 559C0C03.3010104@osg.samsung.com
State Rejected
Delegated to: Daniel Stone
Headers show

Not browsing as part of any series.

Commit Message

Christopher Michael July 7, 2015, 5:27 p.m.
This patch adds missing placeholders for the wl_output listener 
functions 'done' and 'scale. The placeholders added here are no-op 
function placeholders as the done and scale callbacks are not used in 
the screenshot client.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
---
  clients/screenshot.c | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/clients/screenshot.c b/clients/screenshot.c
index 0d9b320..03f63e0 100644
--- a/clients/screenshot.c
+++ b/clients/screenshot.c
@@ -112,11 +112,21 @@  display_handle_mode(void *data,
  	}
  }

+static void
+display_handle_done(void *data, struct wl_output *wl_output)
+{
+}
+
+static void
+display_handle_scale(void *data, struct wl_output *output, int32_t scale)
+{
+}
+
  static const struct wl_output_listener output_listener = {
  	display_handle_geometry,
  	display_handle_mode,
-	NULL,
-	NULL,
+	display_handle_done,
+	display_handle_scale,
  };

  static void

Comments

Hi,

On 7 July 2015 at 18:27, Christopher Michael <cpmichael@osg.samsung.com> wrote:
> This patch adds missing placeholders for the wl_output listener functions
> 'done' and 'scale. The placeholders added here are no-op function
> placeholders as the done and scale callbacks are not used in the screenshot
> client.

More correctly, they are never called (which would happen on receipt
of a server event) because it only ever binds wl_output v1, where the
done/scale events were added in v2, so the server will never send
those events.

Cheers,
Daniel
On Tue, Jul 7, 2015 at 11:11 AM, Daniel Stone <daniel@fooishbar.org> wrote:

>
> More correctly, they are never called (which would happen on receipt
> of a server event) because it only ever binds wl_output v1, where the
> done/scale events were added in v2, so the server will never send
> those events.
>

How come the definition of the listener with those calls is available when
compiling, but it still compiles a request for an earlier version of the
api? I would think these would be tied together so that it is difficult to
produce code using a different api version than listener structure.
On 7 July 2015 at 19:48, Bill Spitzak <spitzak@gmail.com> wrote:
> On Tue, Jul 7, 2015 at 11:11 AM, Daniel Stone <daniel@fooishbar.org> wrote:
>> More correctly, they are never called (which would happen on receipt
>> of a server event) because it only ever binds wl_output v1, where the
>> done/scale events were added in v2, so the server will never send
>> those events.
>
> How come the definition of the listener with those calls is available when
> compiling, but it still compiles a request for an earlier version of the
> api? I would think these would be tied together so that it is difficult to
> produce code using a different api version than listener structure.

For a whole series of tedious reasons, including how you still need to
be careful if you're negotiating non-fixed versions anyway.

Cheers,
Daniel