mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Revert "Restrict relative mouse mode to Wayland users (#15697)"
see #15761 SDL is the only device that supports relative mode and mouse input is actually somewhat broken if it's *not* enabled. This reverts commit45c5ef8798
and88b007907a
.
This commit is contained in:
parent
bc43019467
commit
7602308835
4 changed files with 2 additions and 29 deletions
|
@ -756,7 +756,6 @@ private:
|
|||
f32 m_repeat_dig_time;
|
||||
f32 m_cache_cam_smoothing;
|
||||
|
||||
bool m_enable_relative_mode = false;
|
||||
bool m_invert_mouse;
|
||||
bool m_enable_hotbar_mouse_wheel;
|
||||
bool m_invert_hotbar_mouse_wheel;
|
||||
|
@ -900,15 +899,6 @@ bool Game::startup(bool *kill,
|
|||
|
||||
m_first_loop_after_window_activation = true;
|
||||
|
||||
// In principle we could always enable relative mouse mode, but it causes weird
|
||||
// bugs on some setups (e.g. #14932), so we enable it only when it's required.
|
||||
// That is: on Wayland or Android, because it does not support mouse repositioning
|
||||
#ifdef __ANDROID__
|
||||
m_enable_relative_mode = true;
|
||||
#else
|
||||
m_enable_relative_mode = device->isUsingWayland();
|
||||
#endif
|
||||
|
||||
g_client_translations->clear();
|
||||
|
||||
// address can change if simple_singleplayer_mode
|
||||
|
@ -2361,10 +2351,8 @@ void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
|
|||
Since Minetest has its own code to synthesize mouse events from touch events,
|
||||
this results in duplicated input. To avoid that, we don't enable relative
|
||||
mouse mode if we're in touchscreen mode. */
|
||||
if (cur_control) {
|
||||
cur_control->setRelativeMode(m_enable_relative_mode &&
|
||||
!g_touchcontrols && !isMenuActive());
|
||||
}
|
||||
if (cur_control)
|
||||
cur_control->setRelativeMode(!g_touchcontrols && !isMenuActive());
|
||||
|
||||
if ((device->isWindowActive() && device->isWindowFocused()
|
||||
&& !isMenuActive()) || input->isRandom()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue