Screen notification types

Updated: April 19, 2023

Types of notifications

Synopsis:

#include <screen/screen.h>
enum {
    SCREEN_NOTIFY_UPDATE = 1,
    SCREEN_NOTIFY_INPUT = 2,
    SCREEN_NOTIFY_EVENT = 3,
    SCREEN_NOTIFY_DISPLAY = 4
};

Data:

SCREEN_NOTIFY_UPDATE
Notification of an update; this notification type is applicable to the following API objects:
  • display: notification when Screen completes composition
  • stream: notification when screen_post_stream() has been called with the specified stream
  • window: notification when screen_post_window() has been called with the specified window

When you register for SCREEN_NOTIFY_UPDATE notifications, Screen still adds SCREEN_EVENT_POST events to your context's event queue when applicable.

SCREEN_NOTIFY_INPUT
Notification of an event from a display or an input device; this notification type is applicable to the following API objects:
  • device: notification when the specified device is sending input; note that when you receive a notification for input, it isn't necessarily an indication that there's an event corresponding to your input device in your context's event queue.
  • display: notification when there's input occurring that's targeted for the specified display

When you register for SCREEN_NOTIFY_INPUT notifications with a NULL object, then you receive notifications when any input device is sending input

SCREEN_NOTIFY_EVENT
Notification of when a property has been changed on the specified API object or when an event is available in your context's event queue; this notification type is applicable to the following API objects:
  • device
  • group
  • pixmap
  • session
  • stream
  • window

When you register for SCREEN_NOTIFY_EVENT notifications for any of the above API objects, Screen sends a notification when a property has been changed on that specified object. If the property change also invokes Screen to send a SCREEN_EVENT_PROPERTY event, then you will receive this event in your context's event queue in addition to the notification; otherwise, you receive only the notification. Refer to Screen property types to determine whether a property sends a change event.

When you register for SCREEN_NOTIFY_EVENT notifications with a NULL object, then you receive one notification for each event that's residing in your context's event queue (i.e., one notification for each event that you can call screen_get_event() to retrieve).

SCREEN_NOTIFY_DISPLAY
Notification of display update; this notification type is applicable to display API objects.

Library:

libscreen