mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Disable automatic switching on Linux to avoid bug on X11
This commit is contained in:
parent
f5076723e8
commit
bd15f26c35
1 changed files with 10 additions and 0 deletions
|
@ -97,7 +97,17 @@ void set_default_settings()
|
||||||
// Client
|
// Client
|
||||||
settings->setDefault("address", "");
|
settings->setDefault("address", "");
|
||||||
settings->setDefault("enable_sound", "true");
|
settings->setDefault("enable_sound", "true");
|
||||||
|
#if defined(__unix__) && !defined(__APPLE__) && !defined (__ANDROID__)
|
||||||
|
// On Linux+X11 (not Linux+Wayland or Linux+XWayland), I've encountered a bug
|
||||||
|
// where fake mouse events were generated from touch events if in relative
|
||||||
|
// mouse mode, resulting in the touchscreen controls being instantly disabled
|
||||||
|
// again and thus making them unusable.
|
||||||
|
// => We can't switch based on the last input method used.
|
||||||
|
// => Fall back to hardware detection.
|
||||||
|
settings->setDefault("touch_controls", bool_to_cstr(has_touch));
|
||||||
|
#else
|
||||||
settings->setDefault("touch_controls", "auto");
|
settings->setDefault("touch_controls", "auto");
|
||||||
|
#endif
|
||||||
// Since GUI scaling shouldn't suddenly change during a session, we use
|
// Since GUI scaling shouldn't suddenly change during a session, we use
|
||||||
// hardware detection for "touch_gui" instead of switching based on the last
|
// hardware detection for "touch_gui" instead of switching based on the last
|
||||||
// input method used.
|
// input method used.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue