Cleanup: correct typos & clarify doc-strings for GHOST/Wayland

This commit is contained in:
Campbell Barton
2025-10-08 13:30:11 +11:00
parent a6a8fc9619
commit 5d671a4ade
2 changed files with 10 additions and 7 deletions

View File

@@ -1719,7 +1719,7 @@ struct GWL_RegisteryAdd_Params {
* \note Any operations that depend on other interfaces being registered must be performed in the
* #GWL_RegistryHandler_UpdateFn callback as the order interfaces are added is out of our control.
*
* \param display: The display which holes a reference to the global object.
* \param display: The display which holds a reference to the global object.
* \param params: Various arguments needed for registration.
*/
using GWL_RegistryHandler_AddFn = void (*)(GWL_Display *display,
@@ -1738,7 +1738,7 @@ struct GWL_RegisteryUpdate_Params {
/**
* Optional update callback to refresh internal data when another interface has been added/removed.
*
* \param display: The display which holes a reference to the global object.
* \param display: The display which holds a reference to the global object.
* \param params: Various arguments needed for updating.
*/
using GWL_RegistryHandler_UpdateFn = void (*)(GWL_Display *display,
@@ -1746,7 +1746,7 @@ using GWL_RegistryHandler_UpdateFn = void (*)(GWL_Display *display,
/**
* Remove callback for object registry.
* \param display: The display which holes a reference to the global object.
* \param display: The display which holds a reference to the global object.
* \param user_data: Optional reference to a sub element of `display`,
* use for outputs or seats, for example when the display may hold multiple references.
* \param on_exit: Enabled when freeing on exit.
@@ -5535,7 +5535,7 @@ static bool xkb_compose_state_feed_and_get_utf8(
*/
static void keyboard_handle_key_repeat_cancel(GWL_Seat *seat)
{
GHOST_ASSERT(seat->key_repeat.timer != nullptr, "Caller much check for timer");
GHOST_ASSERT(seat->key_repeat.timer != nullptr, "Caller must check for timer");
delete static_cast<GWL_KeyRepeatPlayload *>(seat->key_repeat.timer->getUserData());
gwl_seat_key_repeat_timer_remove(seat);
@@ -5550,7 +5550,7 @@ static void keyboard_handle_key_repeat_cancel(GWL_Seat *seat)
*/
static void keyboard_handle_key_repeat_reset(GWL_Seat *seat, const bool use_delay)
{
GHOST_ASSERT(seat->key_repeat.timer != nullptr, "Caller much check for timer");
GHOST_ASSERT(seat->key_repeat.timer != nullptr, "Caller must check for timer");
GHOST_TimerProcPtr key_repeat_fn = seat->key_repeat.timer->getTimerProc();
GHOST_TUserDataPtr payload = seat->key_repeat.timer->getUserData();

View File

@@ -371,7 +371,7 @@ enum eGWL_PendingWindowActions {
struct GWL_WindowFrame {
/**
* The frame size (in GHOST window coordinates).
* The frame size (in pixels).
*
* These must be converted to WAYLAND relative coordinates when the window is scaled
* by Hi-DPI/fractional scaling.
@@ -2600,6 +2600,8 @@ GHOST_TSuccess GHOST_WindowWayland::close()
GHOST_TSuccess GHOST_WindowWayland::activate()
{
/* When first initializing from the main thread, activation is called directly,
* otherwise activation is performed when processing pending events. */
#ifdef USE_EVENT_BACKGROUND_THREAD
const bool is_main_thread = system_->main_thread_id == std::this_thread::get_id();
if (is_main_thread)
@@ -2628,8 +2630,9 @@ GHOST_TSuccess GHOST_WindowWayland::activate()
GHOST_TSuccess GHOST_WindowWayland::deactivate()
{
/* When first initializing from the main thread, deactivation is called directly,
* otherwise deactivation is performed when processing pending events. */
#ifdef USE_EVENT_BACKGROUND_THREAD
/* Actual activation is handled when processing pending events. */
const bool is_main_thread = system_->main_thread_id == std::this_thread::get_id();
if (is_main_thread)
#endif