Skip to content
Permalink
Browse files

GlobalShortcut_win, mumble.pro: remove use of HardHook in GlobalShort…

…cut_win.

This also lets us remove MinHook from the Mumble client itself.

This code is part of the client-in-overlay feature that we had
for Windows and OS X. However, that feature is broken for Qt 5
and never had good performance.
  • Loading branch information...
mkrautz committed Dec 30, 2015
1 parent 17ddc1a commit ad6acf22d8b7be06a0be3224ee038736d81b3b80
Showing with 1 addition and 40 deletions.
  1. +0 −33 src/mumble/GlobalShortcut_win.cpp
  2. +1 −7 src/mumble/mumble.pro
@@ -35,7 +35,6 @@
#include "MainWindow.h"
#include "OverlayClient.h"
#include "Global.h"
#include "../../overlay/HardHook.h"

#undef FAILED
#define FAILED(Status) (static_cast<HRESULT>(Status)<0)
@@ -52,38 +51,6 @@ static uint qHash(const GUID &a) {
return val;
}

static HWND WINAPI HookWindowFromPoint(POINT p);
static BOOL WINAPI HookSetForegroundWindow(HWND hwnd);

static HardHook hhWindowFromPoint(reinterpret_cast<voidFunc>(::WindowFromPoint), reinterpret_cast<voidFunc>(HookWindowFromPoint));
static HardHook hhSetForegroundWindow(reinterpret_cast<voidFunc>(::SetForegroundWindow), reinterpret_cast<voidFunc>(HookSetForegroundWindow));

typedef HWND(__stdcall *WindowFromPointType)(POINT);
static HWND WINAPI HookWindowFromPoint(POINT p) {
if (g.ocIntercept)
return MumbleHWNDForQWidget(&g.ocIntercept->qgv);

WindowFromPointType oWindowFromPoint = (WindowFromPointType) hhWindowFromPoint.call;
hhWindowFromPoint.restore();
HWND hwnd = oWindowFromPoint(p);
hhWindowFromPoint.inject();

return hwnd;
}

typedef BOOL(__stdcall *SetForegroundWindowType)(HWND);
static BOOL WINAPI HookSetForegroundWindow(HWND hwnd) {
if (g.ocIntercept)
return TRUE;

SetForegroundWindowType oSetForegroundWindow = (SetForegroundWindowType) hhSetForegroundWindow.call;
hhSetForegroundWindow.restore();
BOOL ret = oSetForegroundWindow(hwnd);
hhSetForegroundWindow.inject();

return ret;
}

/**
* Returns a platform specific GlobalShortcutEngine object.
*
@@ -371,16 +371,10 @@ win32 {
RC_FILE = mumble.rc
}
HEADERS *= GlobalShortcut_win.h Overlay_win.h TaskList.h UserLockFile.h
SOURCES *= GlobalShortcut_win.cpp TextToSpeech_win.cpp Overlay_win.cpp SharedMemory_win.cpp Log_win.cpp os_win.cpp TaskList.cpp ../../overlay/HardHook.cpp ../../overlay/ods.cpp UserLockFile_win.cpp
SOURCES *= GlobalShortcut_win.cpp TextToSpeech_win.cpp Overlay_win.cpp SharedMemory_win.cpp Log_win.cpp os_win.cpp TaskList.cpp ../../overlay/ods.cpp UserLockFile_win.cpp
LIBS *= -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -llibsndfile-1 -lshell32 -lshlwapi -luser32 -lgdi32 -lpsapi
LIBS *= -ldelayimp -delayload:shell32.dll

equals(QMAKE_TARGET.arch, x86_64) {
DEFINES += USE_MINHOOK
INCLUDEPATH *= ../../3rdparty/minhook-src/include
LIBS *= -lminhook
}

DEFINES *= WIN32
!CONFIG(no-asio) {
CONFIG *= asio

0 comments on commit ad6acf2

Please sign in to comment.
You can’t perform that action at this time.