[x11] Add possibility to set a user-defined string to detect styluses (#3176)

This commit is contained in:
David Capello 2022-04-28 16:32:09 -03:00
parent f638b5ca2b
commit 94065571b5
3 changed files with 16 additions and 3 deletions

View File

@ -158,6 +158,7 @@
<option id="show_menu_bar" type="bool" default="true" /> <option id="show_menu_bar" type="bool" default="true" />
<option id="recent_items" type="int" default="16" /> <option id="recent_items" type="int" default="16" />
<option id="osx_async_view" type="bool" default="true" /> <option id="osx_async_view" type="bool" default="true" />
<option id="x11_stylus_id" type="std::string" />
</section> </section>
<section id="undo" text="Undo"> <section id="undo" text="Undo">
<option id="size_limit" type="int" default="0" /> <option id="size_limit" type="int" default="0" />

2
laf

@ -1 +1 @@
Subproject commit df53f4ac0cecada789bf84b4283947d2591833bd Subproject commit 8f9e7892e0da31e423e224b199f53d8ffefce32b

View File

@ -71,6 +71,8 @@
#if LAF_MACOS #if LAF_MACOS
#include "os/osx/system.h" #include "os/osx/system.h"
#elif LAF_LINUX
#include "os/x11/system.h"
#endif #endif
#include <iostream> #include <iostream>
@ -236,6 +238,7 @@ int App::initialize(const AppOptions& options)
m_coreModules = new CoreModules; m_coreModules = new CoreModules;
#if LAF_WINDOWS #if LAF_WINDOWS
if (options.disableWintab() || if (options.disableWintab() ||
!preferences().experimental.loadWintabDriver() || !preferences().experimental.loadWintabDriver() ||
preferences().tablet.api() == "pointer") { preferences().tablet.api() == "pointer") {
@ -245,11 +248,20 @@ int App::initialize(const AppOptions& options)
system->setTabletAPI(os::TabletAPI::WintabPackets); system->setTabletAPI(os::TabletAPI::WintabPackets);
else // preferences().tablet.api() == "wintab" else // preferences().tablet.api() == "wintab"
system->setTabletAPI(os::TabletAPI::Wintab); system->setTabletAPI(os::TabletAPI::Wintab);
#endif
#if LAF_MACOS #elif LAF_MACOS
if (!preferences().general.osxAsyncView()) if (!preferences().general.osxAsyncView())
os::osx_set_async_view(false); os::osx_set_async_view(false);
#elif LAF_LINUX
{
const std::string& stylusId = preferences().general.x11StylusId();
if (!stylusId.empty())
os::x11_set_user_defined_string_to_detect_stylus(stylusId);
}
#endif #endif
system->setAppName(get_app_name()); system->setAppName(get_app_name());