From 05331254ebe644aee52fad992ef24af82d771fe4 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 23 Jan 2019 13:34:50 +0100 Subject: [PATCH] Enable CEF for Linux. --- indra/media_plugins/CMakeLists.txt | 1 + indra/media_plugins/cef/media_plugin_cef.cpp | 17 +++++++- .../skins/default/xui/en/mime_types_linux.xml | 40 +++++++++---------- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 803fee551d..51b55f900b 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -7,6 +7,7 @@ if (LINUX) #add_subdirectory(libvlc) add_subdirectory(example) add_subdirectory(gstreamer10) + add_subdirectory(cef) endif (LINUX) if (DARWIN) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 2bd5526a86..f58a69d16a 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -119,6 +119,9 @@ MediaPluginBase(host_send_func, host_user_data) mPluginsEnabled = false; mJavascriptEnabled = true; mDisableGPU = false; +#ifdef LL_LINUX // Do not use GPU on Linux, using GPU messes with some window managers (https://bitbucket.org/NickyD/phoenix-firestorm-lgpl-linux/commits/14c936db5a02cf0f3ff24eb7f1c92136#comment-6048984) + mDisableGPU = true; +#endif mUserAgentSubtring = ""; mAuthUsername = ""; mAuthPassword = ""; @@ -680,7 +683,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) keyEvent(key_event, native_key_data); -#elif LL_WINDOWS +//#elif LL_WINDOWS // Windows & Linux +#else std::string event = message_in.getValue("event"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); @@ -825,6 +829,17 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif + +// Keyboard handling for Linux. +#if LL_LINUX + uint32_t native_scan_code = (uint32_t)(native_key_data["sdl_sym"].asInteger()); + uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); + uint32_t native_modifiers = (uint32_t)(native_key_data["cef_modifiers"].asInteger()); + if( native_scan_code == '\n' ) + native_scan_code = '\r'; + mCEFLib->nativeKeyboardEvent(key_event, native_scan_code, native_virtual_key, native_modifiers); +#endif +// }; void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD::emptyMap()) diff --git a/indra/newview/skins/default/xui/en/mime_types_linux.xml b/indra/newview/skins/default/xui/en/mime_types_linux.xml index 84aeaf3b54..22a0024874 100644 --- a/indra/newview/skins/default/xui/en/mime_types_linux.xml +++ b/indra/newview/skins/default/xui/en/mime_types_linux.xml @@ -7,7 +7,7 @@ none - media_plugin_webkit + media_plugin_cef