Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
77f51fd1
Commit
77f51fd1
authored
Nov 02, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed desktop mode
parent
ac468994
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
35 deletions
+17
-35
UBScreenMirror.cpp
src/gui/UBScreenMirror.cpp
+17
-35
No files found.
src/gui/UBScreenMirror.cpp
View file @
77f51fd1
...
...
@@ -80,41 +80,23 @@ void UBScreenMirror::timerEvent(QTimerEvent *event)
void
UBScreenMirror
::
grabPixmap
()
{
// if (mSourceWidget)
// {
// QPoint topLeft = mSourceWidget->mapToGlobal(mSourceWidget->geometry().topLeft());
// QPoint bottomRight = mSourceWidget->mapToGlobal(mSourceWidget->geometry().bottomRight());
// mRect.setTopLeft(topLeft);
// mRect.setBottomRight(bottomRight);
// }
// // get image of desktop
// WId windowID = qApp->desktop()->screen(mScreenIndex)->winId();
// qDebug() << windowID;
//#if defined(Q_WS_MAC)
// TODO: bad mac fix. On dual screen mac os x and let web mode for more than one minute and it crashed
// NSAutorelease pull should avoid this.
// // Available in Mac OS X v10.6 and later.
// CGRect grabRect;
// grabRect.origin.x = mRect.x();
// grabRect.origin.y = mRect.y();
// grabRect.size.width = mRect.width();
// grabRect.size.height = mRect.height();
// CGImageRef windowImage = CGWindowListCreateImage(grabRect
// ,kCGWindowListOptionOnScreenOnly
// ,windowID
// ,kCGWindowImageDefault);
// mLastPixmap = QPixmap::fromMacCGImageRef(windowImage);
//#else
// mLastPixmap = QPixmap::grabWindow(windowID, mRect.x(), mRect.y(), mRect.width(), mRect.height());
//#endif
mLastPixmap
=
QPixmap
::
grabWidget
(
mSourceWidget
);
if
(
mSourceWidget
)
{
QPoint
topLeft
=
mSourceWidget
->
mapToGlobal
(
mSourceWidget
->
geometry
().
topLeft
());
QPoint
bottomRight
=
mSourceWidget
->
mapToGlobal
(
mSourceWidget
->
geometry
().
bottomRight
());
mRect
.
setTopLeft
(
topLeft
);
mRect
.
setBottomRight
(
bottomRight
);
mLastPixmap
=
QPixmap
::
grabWidget
(
mSourceWidget
);
}
else
{
// WHY HERE?
// this is the case we are showing the desktop but the is no widget and we use the last widget rectagle to know
// what we have to grab. Not very good way of doing
WId
windowID
=
qApp
->
desktop
()
->
screen
(
mScreenIndex
)
->
winId
();
mLastPixmap
=
QPixmap
::
grabWindow
(
windowID
,
mRect
.
x
(),
mRect
.
y
(),
mRect
.
width
(),
mRect
.
height
());
}
mLastPixmap
=
mLastPixmap
.
scaled
(
width
(),
height
(),
Qt
::
KeepAspectRatio
,
Qt
::
SmoothTransformation
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment