diff options
author | Mike Erwin <significant.bit@gmail.com> | 2011-08-02 05:01:56 +0400 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2011-08-02 05:01:56 +0400 |
commit | dc2609da3d08ff2dde1747201ef4e0ebb17d5bd9 (patch) | |
tree | b18b8fa9a8eba6a9de70514def129b53f4733aaa /intern | |
parent | 19b38034f989089e359b9a4ea1e65fcbe8ffa18c (diff) | |
parent | c965d1d2ccfd57926476cb5c091afa35c6de217f (diff) |
svn merge -r38814:38905 https://svn.blender.org/svnroot/bf-blender/trunk/blender .merwin-spacenav
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 34 |
2 files changed, 34 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 5f27eab9d8c..8f2df4c396d 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1568,6 +1568,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) GHOST_TInt32 delta; double deltaF = [event deltaY]; + + if (deltaF == 0.0) deltaF = [event deltaX]; // make blender decide if it's horizontal scroll if (deltaF == 0.0) break; //discard trackpad delta=0 events delta = deltaF > 0.0 ? 1 : -1; diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 2a3eb74d1e2..1b43fa92bb2 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -52,6 +52,7 @@ #define _WIN32_IE 0x0501 /* shipped before XP, so doesn't impose additional requirements */ #endif #include <shlobj.h> +#include <tlhelp32.h> // win64 doesn't define GWL_USERDATA #ifdef WIN32 @@ -1056,11 +1057,16 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, * procedure of the top-level window being activated. If the windows use different input queues, * the message is sent asynchronously, so the window is activated immediately. */ + { + GHOST_ModifierKeys modifiers; + modifiers.clear(); + system->storeModifierKeys(modifiers); event = processWindowEvent(LOWORD(wParam) ? GHOST_kEventWindowActivate : GHOST_kEventWindowDeactivate, window); /* WARNING: Let DefWindowProc handle WM_ACTIVATE, otherwise WM_MOUSEWHEEL will not be dispatched to OUR active window if we minimize one of OUR windows. */ lResult = ::DefWindowProc(hwnd, msg, wParam, lParam); break; + } case WM_PAINT: /* An application sends the WM_PAINT message when the system or another application * makes a request to paint a portion of an application's window. The message is sent @@ -1284,8 +1290,32 @@ int GHOST_SystemWin32::toggleConsole(int action) { case 3: //hide if no console { - CONSOLE_SCREEN_BUFFER_INFO csbi = {{0}}; - if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) || csbi.dwCursorPosition.X || csbi.dwCursorPosition.Y>1) + DWORD sp = GetCurrentProcessId(); + HANDLE ptree = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + PROCESSENTRY32 e = {0}; e.dwSize = sizeof(PROCESSENTRY32); + + if( Process32First(ptree, &e)) { + do { //Searches for Blender's PROCESSENTRY32 + if (e.th32ProcessID == sp) { + sp = e.th32ParentProcessID; + Process32First(ptree, &e); + do { //Got parent id, searches for its PROCESSENTRY32 + if (e.th32ProcessID == sp) { + if(strcmp("explorer.exe",e.szExeFile)==0) + { //If explorer, hide cmd + ShowWindow(GetConsoleWindow(),SW_HIDE); + m_consoleStatus = 0; + } + break; + } + + } while( Process32Next(ptree, &e)); + break; + } + } while( Process32Next(ptree, &e)); + } + + CloseHandle(ptree); break; } case 0: //hide |