Blender V5.3
GWL_Display Struct Reference

Classes

struct  [struct].wl
struct  [struct].wp
struct  [struct].xdg
struct  [struct].preferences

Public Attributes

struct  wl
struct  wp
struct  xdg
GWL_DisplayTimeStamp input_timestamp
GHOST_SystemWayland * system = nullptr
bool registry_skip_update_all = false
GWL_RegistryEntry * registry_entry = nullptr
GWL_XDG_Decor_System * xdg_decor = nullptr
std::vector< GWL_Output * > outputs
std::vector< GWL_Seat * > seats
int seats_active_index = 0
bool background = false
bool use_window_frame = false
bool use_window_frame_csd = false
struct  preferences
pthread_t events_pthread = 0
int events_pipe [2] = {-1, -1}
std::vector< std::unique_ptr< const GHOST_IEvent > > events_pending
std::mutex events_pending_mutex
GHOST_TimerManager * key_repeat_timer_manager = nullptr
bool supports_color_manager_feature_windows_scrgb = false
bool supports_color_manager_extended_srgb_linear = false

Detailed Description

Definition at line 1568 of file GHOST_SystemWayland.cc.

Member Data Documentation

◆ background

bool GWL_Display::background = false

When true, running without any windows. Wayland is only used to access the GPU.

Note
In general logic should not diverge too much in background mode, so as to avoid maintaining multiple code-paths however some logic can be skipped such as libraries for showing window decorations and threaded event handling.

Definition at line 1658 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_destroy(), gwl_display_event_thread_create(), gwl_display_event_thread_destroy(), and gwl_display_event_thread_fn().

◆ events_pending

std::vector<std::unique_ptr<const GHOST_IEvent> > GWL_Display::events_pending

Events added from the event reading thread. Added into the main event queue when on GHOST_SystemWayland::processEvents.

Definition at line 1724 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_event_thread_create().

◆ events_pending_mutex

std::mutex GWL_Display::events_pending_mutex

Guard against multiple threads accessing events_pending at once.

Definition at line 1726 of file GHOST_SystemWayland.cc.

◆ events_pipe

int GWL_Display::events_pipe[2] = {-1, -1}

Used to make the loop exit, otherwise if a flag on the loop condition were simply used, when the stop happens while poll is blocking the thread would never quit since there are no WAYLAND messages coming anymore.

Not set when background == true.

  • 0: The read end, waited on by events_pthread.
  • 1: The write end, closing it ends that threads loop.

Definition at line 1718 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_event_thread_create(), gwl_display_event_thread_destroy(), and gwl_display_event_thread_fn().

◆ events_pthread

pthread_t GWL_Display::events_pthread = 0

Run a thread that consumes events in the background. Use pthread because std::thread leaks memory.

Not set when background == true.

Definition at line 1707 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_destroy(), gwl_display_event_thread_create(), and gwl_display_event_thread_destroy().

◆ input_timestamp

GWL_DisplayTimeStamp GWL_Display::input_timestamp

Definition at line 1615 of file GHOST_SystemWayland.cc.

◆ key_repeat_timer_manager

GHOST_TimerManager* GWL_Display::key_repeat_timer_manager = nullptr

A timer manager for key-repeat events.

There are two reasons a separate timer manager is needed:

  • It's necessary to fire the timer immediately after events have been processed, (not before - like regular system timers), otherwise the release events won't have been handled and repeat events may be sent after the keys have been released, see: #151359.
  • A separate timer queue, needed so the WAYLAND thread can lock access. Using the system's GHOST_System::getTimerManager is not thread safe because access to the timer outside of WAYLAND specific logic will not lock.

    Needed because GHOST_System::dispatchEvents fires timers outside of WAYLAND (without locking the timer_mutex).

Definition at line 1746 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_destroy().

◆ outputs

std::vector<GWL_Output *> GWL_Display::outputs

NOTE(@ideasman42): Handling of outputs must account for this vector to be empty. While this seems like something which might not ever happen, it can occur when unplugging monitors (presumably from dodgy cables/connections too).

Definition at line 1635 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_output_add(), and gwl_registry_wl_output_remove().

◆ preferences

struct GWL_Display::[struct].preferences GWL_Display::preferences

◆ registry_entry

GWL_RegistryEntry* GWL_Display::registry_entry = nullptr

◆ registry_skip_update_all

bool GWL_Display::registry_skip_update_all = false

True when initializing registration, while updating all other entries wont cause problems, it will perform many redundant update calls.

Definition at line 1623 of file GHOST_SystemWayland.cc.

Referenced by global_handle_add(), and global_handle_remove().

◆ seats

◆ seats_active_index

int GWL_Display::seats_active_index = 0

Support a single active seat at once, this isn't an exact or correct mapping from WAYLAND. Only allow input from different seats, not full concurrent multi-seat support.

The main purpose of having an active seat is an alternative from always using the first seat which prevents events from any other seat.

NOTE(@ideasman42): This could be extended and developed further extended to support an active seat per window (for example), basic support is sufficient for now as currently isn't a widely used feature.

Definition at line 1648 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_seat_active_get(), gwl_display_seat_active_set(), and gwl_registry_wl_seat_remove().

◆ supports_color_manager_extended_srgb_linear

bool GWL_Display::supports_color_manager_extended_srgb_linear = false

Definition at line 1749 of file GHOST_SystemWayland.cc.

Referenced by color_manager_v1_done().

◆ supports_color_manager_feature_windows_scrgb

bool GWL_Display::supports_color_manager_feature_windows_scrgb = false

Definition at line 1748 of file GHOST_SystemWayland.cc.

Referenced by color_manager_v1_done().

◆ system

GHOST_SystemWayland* GWL_Display::system = nullptr

◆ use_window_frame

bool GWL_Display::use_window_frame = false

Show window decorations, otherwise all windows are frame-less.

Definition at line 1663 of file GHOST_SystemWayland.cc.

◆ use_window_frame_csd

bool GWL_Display::use_window_frame_csd = false

When true, try to draw our own CSD.

Definition at line 1667 of file GHOST_SystemWayland.cc.

◆ wl

◆ wp

◆ xdg

◆ xdg_decor


The documentation for this struct was generated from the following file: