aboutsummaryrefslogtreecommitdiff
path: root/backends/taskbar
diff options
context:
space:
mode:
authorJohannes Schickel2015-03-05 01:10:34 +0100
committerJohannes Schickel2015-03-05 01:10:34 +0100
commit4d13d44f8a2db8f887e285dbcbd3bb75ccc0ae2e (patch)
tree9fd0cb9d8b0965a2c823e690f7d467c9ff3c5aea /backends/taskbar
parentcecb9a9ecc1ec1897fdd27e1bafc7f6d494cd6af (diff)
parentb5ac3ecb1f25b2d47fd99a3c4fd3b1cddcb695c6 (diff)
downloadscummvm-rg350-4d13d44f8a2db8f887e285dbcbd3bb75ccc0ae2e.tar.gz
scummvm-rg350-4d13d44f8a2db8f887e285dbcbd3bb75ccc0ae2e.tar.bz2
scummvm-rg350-4d13d44f8a2db8f887e285dbcbd3bb75ccc0ae2e.zip
Merge pull request #572 from lordhoto/sdl2-support
SDL: Add experimental support for SDL2
Diffstat (limited to 'backends/taskbar')
-rw-r--r--backends/taskbar/win32/win32-taskbar.cpp18
-rw-r--r--backends/taskbar/win32/win32-taskbar.h6
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