Feature #694 » 0001-Kinotify-added-check-whether-the-current-window-is-L.patch
src/plugins/kinotify/fswinwatcher.h | ||
---|---|---|
#pragma once
|
||
#include <QObject>
|
||
#include <interfaces/core/icoreproxy.h>
|
||
namespace LeechCraft
|
||
{
|
||
... | ... | |
{
|
||
class FSWinWatcher : public QObject
|
||
{
|
||
ICoreProxy_ptr Proxy_;
|
||
public:
|
||
FSWinWatcher (QObject* = 0);
|
||
FSWinWatcher (ICoreProxy_ptr, QObject* = 0);
|
||
bool IsCurrentFS ();
|
||
};
|
src/plugins/kinotify/fswinwatcher_win.cpp | ||
---|---|---|
* You should have received a copy of the GNU General Public License
|
||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
**********************************************************************/
|
||
#include <windows.h>
|
||
|
||
#include "fswinwatcher.h"
|
||
#include <QMainWindow>
|
||
#include <windows.h>
|
||
namespace LeechCraft
|
||
{
|
||
namespace Kinotify
|
||
{
|
||
FSWinWatcher::FSWinWatcher (QObject *parent)
|
||
: QObject (parent)
|
||
FSWinWatcher::FSWinWatcher (ICoreProxy_ptr proxy, QObject *parent)
|
||
: Proxy_ (proxy), QObject (parent)
|
||
{
|
||
}
|
||
... | ... | |
if (hWnd)
|
||
{
|
||
HMONITOR monitor = MonitorFromWindow (hWnd, MONITOR_DEFAULTTONULL);
|
||
MONITORINFO lpmi;
|
||
lpmi.cbSize = sizeof(lpmi);
|
||
if (GetMonitorInfo (monitor, &lpmi))
|
||
if (monitor)
|
||
{
|
||
RECT monitorRect = lpmi.rcMonitor;
|
||
RECT windowRect;
|
||
GetWindowRect (hWnd, &windowRect);
|
||
if (EqualRect (&windowRect, &monitorRect))
|
||
return true;
|
||
MONITORINFO lpmi;
|
||
lpmi.cbSize = sizeof (lpmi);
|
||
if (GetMonitorInfo (monitor, &lpmi))
|
||
{
|
||
RECT monitorRect = lpmi.rcMonitor;
|
||
RECT windowRect;
|
||
GetWindowRect (hWnd, &windowRect);
|
||
if (EqualRect (&windowRect, &monitorRect))
|
||
{
|
||
if(Proxy_->GetMainWindow ()->effectiveWinId () != hWnd)
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return false;
|
src/plugins/kinotify/fswinwatcher_x11.cpp | ||
---|---|---|
{
|
||
namespace Kinotify
|
||
{
|
||
FSWinWatcher::FSWinWatcher (QObject *parent)
|
||
: QObject (parent)
|
||
FSWinWatcher::FSWinWatcher (ICoreProxy_ptr proxy, QObject *parent)
|
||
: Proxy_ (proxy), QObject (parent)
|
||
{
|
||
}
|
||
src/plugins/kinotify/kinotify.cpp | ||
---|---|---|
SettingsDialog_->SetDataSource ("NotificatorStyle",
|
||
ThemeLoader_->GetSubElemModel ());
|
||
FSWinWatcher_.reset (new FSWinWatcher);
|
||
FSWinWatcher_.reset (new FSWinWatcher (Proxy_));
|
||
}
|
||
void Plugin::SecondInit ()
|
- « Previous
- 1
- 2
- Next »