Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
psieg committed Apr 12, 2024
1 parent cd4d588 commit c4ff644
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Software/grab/GrabberBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ bool GrabberBase::isGrabbingStarted() const

const GrabbedScreen * GrabberBase::screenOfWidget(const GrabWidget& widget) const
{
//#ifdef Q_OS_WIN
// // Note that in Qt > 6 we can't use rect matching because the widget coords are in a device-independent
// // coordinate system while the screen coords are in the physical one.
// HMONITOR widgetMonitor = MonitorFromWindow(reinterpret_cast<HWND>(widget.winId()), MONITOR_DEFAULTTONULL);
// for (int i = 0; i < _screensWithWidgets.size(); ++i) {
// if (_screensWithWidgets[i].screenInfo.handle == widgetMonitor)
// return &_screensWithWidgets[i];
// }
//#else
#ifdef Q_OS_WIN
HMONITOR widgetMonitor = MonitorFromWindow(reinterpret_cast<HWND>(widget.winId()), MONITOR_DEFAULTTONULL);
for (int i = 0; i < _screensWithWidgets.size(); ++i) {
if (_screensWithWidgets[i].screenInfo.handle == widgetMonitor)
return &_screensWithWidgets[i];
}
#else
QRect rect = widget.deviceFrameGeometry();
QPoint center = rect.center();
for (int i = 0; i < _screensWithWidgets.size(); ++i) {
Expand All @@ -115,7 +113,7 @@ const GrabbedScreen * GrabberBase::screenOfWidget(const GrabWidget& widget) cons
if (_screensWithWidgets[i].screenInfo.rect.intersects(rect))
return &_screensWithWidgets[i];
};
//#endif
#endif
return NULL;
}

Expand Down

0 comments on commit c4ff644

Please sign in to comment.