diff options
Diffstat (limited to 'backends/taskbar')
-rw-r--r-- | backends/taskbar/win32/win32-taskbar.cpp | 18 | ||||
-rw-r--r-- | backends/taskbar/win32/win32-taskbar.h | 6 |
2 files changed, 14 insertions, 10 deletions
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 5c9105b0eb..d45253c676 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -48,9 +48,6 @@ #include <shlobj.h> -// For HWND -#include <SDL_syswm.h> - #include "common/scummsys.h" #include "backends/taskbar/win32/win32-taskbar.h" @@ -62,7 +59,7 @@ // System.Title property key, values taken from http://msdn.microsoft.com/en-us/library/bb787584.aspx const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; -Win32TaskbarManager::Win32TaskbarManager() : _taskbar(NULL), _count(0), _icon(NULL) { +Win32TaskbarManager::Win32TaskbarManager(SdlWindow *window) : _window(window), _taskbar(NULL), _count(0), _icon(NULL) { // Do nothing if not running on Windows 7 or later if (!isWin7OrLater()) return; @@ -408,12 +405,15 @@ LPWSTR Win32TaskbarManager::ansiToUnicode(const char *s) { HWND Win32TaskbarManager::getHwnd() { SDL_SysWMinfo wmi; - SDL_VERSION(&wmi.version); - - if(!SDL_GetWMInfo(&wmi)) + if (_window->getSDLWMInformation(&wmi)) { +#if SDL_VERSION_ATLEAST(2, 0, 0) + return wmi.info.win.window; +#else + return wmi.window; +#endif + } else { return NULL; - - return wmi.window; + } } #endif diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index 36415c1c57..a6d1b49213 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -25,6 +25,8 @@ #if defined(WIN32) && defined(USE_TASKBAR) +#include "backends/platform/sdl/sdl-window.h" + #include "common/str.h" #include "common/taskbar.h" @@ -32,7 +34,7 @@ struct ITaskbarList3; class Win32TaskbarManager : public Common::TaskbarManager { public: - Win32TaskbarManager(); + Win32TaskbarManager(SdlWindow *window); virtual ~Win32TaskbarManager(); virtual void setOverlayIcon(const Common::String &name, const Common::String &description); @@ -44,6 +46,8 @@ public: virtual void clearError(); private: + SdlWindow *_window; + ITaskbarList3 *_taskbar; // Count handling |