diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-09-04 17:41:06 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-09-04 17:41:06 +0300 |
commit | 3c29aad787f636167319950636f1497442075df8 (patch) | |
tree | 3a993cc25296ce987893b9f58b7c794b51e77f85 /intern/ghost | |
parent | 498583844fb7d0adbbc91d512f98885800cdf46e (diff) | |
parent | e76e8fcdcc53455a52a6a73495881eddd346472c (diff) |
Merge branch 'master' into blender2.8
Conflicts:
intern/cycles/blender/blender_particles.cpp
source/blender/blenkernel/intern/particle.c
source/blender/gpu/intern/gpu_shader.c
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_ContextWGL.cpp | 1 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_NDOFManagerCocoa.mm | 15 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 22 |
3 files changed, 22 insertions, 16 deletions
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp index 12ffb374d02..255c134e0e7 100644 --- a/intern/ghost/intern/GHOST_ContextWGL.cpp +++ b/intern/ghost/intern/GHOST_ContextWGL.cpp @@ -183,6 +183,7 @@ static int weight_pixel_format(PIXELFORMATDESCRIPTOR &pfd, PIXELFORMATDESCRIPTOR !(pfd.dwFlags & PFD_DOUBLEBUFFER) || /* Blender _needs_ this */ !(pfd.iPixelType == PFD_TYPE_RGBA) || (pfd.cDepthBits < 16) || + (pfd.cColorBits > 32) || /* 64 bit formats disable aero */ (pfd.dwFlags & PFD_GENERIC_FORMAT)) /* no software renderers */ { return 0; diff --git a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm index b56757cd0fe..3cce6bf520b 100644 --- a/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm +++ b/intern/ghost/intern/GHOST_NDOFManagerCocoa.mm @@ -21,8 +21,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#ifdef WITH_INPUT_NDOF - #define DEBUG_NDOF_DRIVER false #include "GHOST_NDOFManagerCocoa.h" @@ -115,13 +113,15 @@ static void* load_func(void* module, const char* func_name) #define LOAD_FUNC(name) name = (name##_ptr) load_func(module, #name) +static void* module; // handle to the whole driver + static bool load_driver_functions() { if (driver_loaded) { return true; } - void* module = dlopen("3DconnexionClient.framework/3DconnexionClient", RTLD_LAZY | RTLD_LOCAL); + module = dlopen("3DconnexionClient.framework/3DconnexionClient", RTLD_LAZY | RTLD_LOCAL); if (module) { LOAD_FUNC(SetConnexionHandlers); @@ -145,8 +145,6 @@ static bool load_driver_functions() has_old_driver = (SetConnexionClientButtonMask == NULL); } - - dlclose(module); // functions will remain loaded } #if DEBUG_NDOF_DRIVER else { @@ -161,6 +159,10 @@ static bool load_driver_functions() return driver_loaded; } +static void unload_driver() +{ + dlclose(module); +} static void DeviceAdded(uint32_t unused) { @@ -268,6 +270,7 @@ GHOST_NDOFManagerCocoa::~GHOST_NDOFManagerCocoa() if (driver_loaded) { UnregisterConnexionClient(clientID); CleanupConnexionHandlers(); + unload_driver(); ghost_system = NULL; ndof_manager = NULL; @@ -278,5 +281,3 @@ bool GHOST_NDOFManagerCocoa::available() { return driver_loaded; } - -#endif // WITH_INPUT_NDOF diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 727bc9a01fb..653c0ccb472 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -838,7 +838,7 @@ GHOST_SystemX11::processEvent(XEvent *xe) case KeyRelease: { XKeyEvent *xke = &(xe->xkey); - KeySym key_sym; + KeySym key_sym = XK_VoidSymbol; KeySym key_sym_str; char ascii; #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING) @@ -870,26 +870,30 @@ GHOST_SystemX11::processEvent(XEvent *xe) * * To address this, we: * - * - Try to get a 'number' key_sym using XLookupKeysym (with or without shift modifier). + * - Try to get a 'number' key_sym using XLookupKeysym (with virtual shift modifier), + * in a very restrictive set of cases. * - Fallback to XLookupString to get a key_sym from active user-defined keymap. * - * Note that this enforces users to use an ascii-compatible keymap with Blender - but at least it gives - * predictable and consistent results. + * Note that: + * - This effectively 'lock' main number keys to always output number events (except when using alt-gr). + * - This enforces users to use an ascii-compatible keymap with Blender - but at least it gives + * predictable and consistent results. * * Also, note that nothing in XLib sources [1] makes it obvious why those two functions give different * key_sym results... * * [1] http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/KeyBind.c */ - if ((xke->keycode >= 10 && xke->keycode < 20)) { + /* Mode_switch 'modifier' is AltGr - when this one or Shift are enabled, we do not want to apply + * that 'forced number' hack. */ + const unsigned int mode_switch_mask = XkbKeysymToModifiers(xke->display, XK_Mode_switch); + const unsigned int number_hack_forbidden_kmods_mask = mode_switch_mask | ShiftMask; + if ((xke->keycode >= 10 && xke->keycode < 20) && ((xke->state & number_hack_forbidden_kmods_mask) == 0)) { key_sym = XLookupKeysym(xke, ShiftMask); if (!((key_sym >= XK_0) && (key_sym <= XK_9))) { - key_sym = XLookupKeysym(xke, 0); + key_sym = XK_VoidSymbol; } } - else { - key_sym = XLookupKeysym(xke, 0); - } if (!XLookupString(xke, &ascii, 1, &key_sym_str, NULL)) { ascii = '\0'; |