index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
Showing only changes of commit 335d32153e - Show all commits

View File

@ -5586,8 +5586,6 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
# endif # endif
display_destroy_and_free_all(); display_destroy_and_free_all();
throw std::runtime_error("Wayland: unable to find libdecor!"); throw std::runtime_error("Wayland: unable to find libdecor!");
use_libdecor = true;
} }
} }
else { else {
@ -5610,7 +5608,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
(void)background; (void)background;
#endif #endif
{ {
GWL_XDG_Decor_System &decor = *display_->xdg_decor; const GWL_XDG_Decor_System &decor = *display_->xdg_decor;
if (!decor.shell) { if (!decor.shell) {
display_destroy_and_free_all(); display_destroy_and_free_all();
throw std::runtime_error("Wayland: unable to access xdg_shell!"); throw std::runtime_error("Wayland: unable to access xdg_shell!");
@ -6071,11 +6069,9 @@ static GHOST_TSuccess getCursorPositionClientRelative_impl(
/* As the cursor is restored at the warped location, /* As the cursor is restored at the warped location,
* apply warping when requesting the cursor location. */ * apply warping when requesting the cursor location. */
GHOST_Rect wrap_bounds{}; GHOST_Rect wrap_bounds{};
if (win->getCursorGrabModeIsWarp()) {
if (win->getCursorGrabBounds(wrap_bounds) == GHOST_kFailure) { if (win->getCursorGrabBounds(wrap_bounds) == GHOST_kFailure) {
win->getClientBounds(wrap_bounds); win->getClientBounds(wrap_bounds);
} }
}
int xy_wrap[2] = { int xy_wrap[2] = {
seat_state_pointer->xy[0], seat_state_pointer->xy[0],
seat_state_pointer->xy[1], seat_state_pointer->xy[1],
@ -6680,10 +6676,9 @@ GHOST_TSuccess GHOST_SystemWayland::cursor_shape_custom_set(uint8_t *bitmap,
static constexpr uint32_t transparent = 0x00000000; static constexpr uint32_t transparent = 0x00000000;
uint8_t datab = 0, maskb = 0; uint8_t datab = 0, maskb = 0;
uint32_t *pixel;
for (int y = 0; y < sizey; ++y) { for (int y = 0; y < sizey; ++y) {
pixel = &static_cast<uint32_t *>(cursor->custom_data)[y * sizex]; uint32_t *pixel = &static_cast<uint32_t *>(cursor->custom_data)[y * sizex];
for (int x = 0; x < sizex; ++x) { for (int x = 0; x < sizex; ++x) {
if ((x % 8) == 0) { if ((x % 8) == 0) {
datab = *bitmap++; datab = *bitmap++;