Merge branch 'blender-v4.3-release'
This commit is contained in:
@@ -1591,6 +1591,13 @@ static int gwl_display_seat_index(GWL_Display *display, const GWL_Seat *seat)
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callers must null check the return value unless it's known there is a seat.
|
||||
*
|
||||
* \note Running Blender in an instance of the Weston compositor
|
||||
* called with `--backend=headless` causes there to be no seats.
|
||||
* CMake's `WITH_UI_TESTS` does this.
|
||||
*/
|
||||
static GWL_Seat *gwl_display_seat_active_get(const GWL_Display *display)
|
||||
{
|
||||
if (UNLIKELY(display->seats.empty())) {
|
||||
@@ -8480,6 +8487,10 @@ GHOST_TSuccess GHOST_SystemWayland::cursor_shape_check(const GHOST_TStandardCurs
|
||||
{
|
||||
/* No need to lock `server_mutex`. */
|
||||
GWL_Seat *seat = gwl_display_seat_active_get(display_);
|
||||
if (UNLIKELY(!seat)) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
const wl_cursor *wl_cursor = gwl_seat_cursor_find_from_shape(seat, cursorShape, nullptr);
|
||||
if (wl_cursor == nullptr) {
|
||||
return GHOST_kFailure;
|
||||
@@ -8606,7 +8617,9 @@ GHOST_TSuccess GHOST_SystemWayland::cursor_visibility_set(const bool visible)
|
||||
|
||||
GHOST_TCapabilityFlag GHOST_SystemWayland::getCapabilities() const
|
||||
{
|
||||
GHOST_ASSERT(has_wl_trackpad_physical_direction != -1,
|
||||
/* It's possible there are no seats, ignore the value in this case. */
|
||||
GHOST_ASSERT(((gwl_display_seat_active_get(display_) == nullptr) ||
|
||||
(has_wl_trackpad_physical_direction != -1)),
|
||||
"The trackpad direction was expected to be initialized");
|
||||
|
||||
return GHOST_TCapabilityFlag(
|
||||
@@ -8632,7 +8645,9 @@ GHOST_TCapabilityFlag GHOST_SystemWayland::getCapabilities() const
|
||||
/* This WAYLAND back-end has not yet implemented desktop color sample. */
|
||||
GHOST_kCapabilityDesktopSample |
|
||||
/* This flag will eventually be removed. */
|
||||
(has_wl_trackpad_physical_direction ? 0 : GHOST_kCapabilityTrackpadPhysicalDirection)));
|
||||
((has_wl_trackpad_physical_direction == 1) ?
|
||||
0 :
|
||||
GHOST_kCapabilityTrackpadPhysicalDirection)));
|
||||
}
|
||||
|
||||
bool GHOST_SystemWayland::cursor_grab_use_software_display_get(const GHOST_TGrabCursorMode mode)
|
||||
@@ -9090,11 +9105,12 @@ void GHOST_SystemWayland::seat_active_set(const GWL_Seat *seat)
|
||||
wl_seat *GHOST_SystemWayland::wl_seat_active_get_with_input_serial(uint32_t &serial)
|
||||
{
|
||||
GWL_Seat *seat = gwl_display_seat_active_get(display_);
|
||||
if (seat) {
|
||||
serial = seat->data_source_serial;
|
||||
return seat->wl.seat;
|
||||
if (UNLIKELY(!seat)) {
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
serial = seat->data_source_serial;
|
||||
return seat->wl.seat;
|
||||
}
|
||||
|
||||
bool GHOST_SystemWayland::window_surface_unref(const wl_surface *wl_surface)
|
||||
|
||||
Reference in New Issue
Block a user