From cf8dec0807454c92961c5ea4971989b39fdca99a Mon Sep 17 00:00:00 2001 From: Dimitriy Ryazantcev Date: Sat, 19 May 2012 02:46:47 +0300 Subject: [PATCH] Kinotify: added fullscreen windows handler on Windows; Signed-off-by: Dimitriy Ryazantcev --- src/plugins/kinotify/CMakeLists.txt | 2 + src/plugins/kinotify/fswinwatcher_win.cpp | 51 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 src/plugins/kinotify/fswinwatcher_win.cpp diff --git a/src/plugins/kinotify/CMakeLists.txt b/src/plugins/kinotify/CMakeLists.txt index 661d66c..2209e54 100644 --- a/src/plugins/kinotify/CMakeLists.txt +++ b/src/plugins/kinotify/CMakeLists.txt @@ -18,6 +18,8 @@ SET (SRCS IF (UNIX) SET (SRCS fswinwatcher_x11.cpp ${SRCS}) +ELSEIF (WIN32) + SET (SRCS fswinwatcher_win.cpp ${SRCS}) ELSE (UNIX) SET (SRCS fswinwatcher.cpp ${SRCS}) ENDIF (UNIX) diff --git a/src/plugins/kinotify/fswinwatcher_win.cpp b/src/plugins/kinotify/fswinwatcher_win.cpp new file mode 100644 index 0000000..3768be4 --- /dev/null +++ b/src/plugins/kinotify/fswinwatcher_win.cpp @@ -0,0 +1,51 @@ +/********************************************************************** + * LeechCraft - modular cross-platform feature rich internet client. + * Copyright (C) 2006-2012 Georg Rudoy + * Copyright (C) 2012 Dimitriy Ryazantcev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + **********************************************************************/ +#include +#include "fswinwatcher.h" + +namespace LeechCraft +{ +namespace Kinotify +{ + FSWinWatcher::FSWinWatcher (QObject *parent) + : QObject (parent) + { + } + + bool FSWinWatcher::IsCurrentFS () + { + HWND hWnd = GetForegroundWindow (); + if (hWnd) + { + HMONITOR monitor = MonitorFromWindow (hWnd, MONITOR_DEFAULTTONULL); + MONITORINFO lpmi; + lpmi.cbSize = sizeof(lpmi); + if (GetMonitorInfo (monitor, &lpmi)) + { + RECT monitorRect = lpmi.rcMonitor; + RECT windowRect; + GetWindowRect (hWnd, &windowRect); + if (EqualRect (&windowRect, &monitorRect)) + return true; + } + } + return false; + } +} +} -- 1.7.8.msysgit.0