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
f371e914
Commit
f371e914
authored
Oct 30, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mirroring works fine on mac 10.6 and later.
parent
66412e54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
UBScreenMirror.cpp
src/gui/UBScreenMirror.cpp
+25
-4
No files found.
src/gui/UBScreenMirror.cpp
View file @
f371e914
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
#include "core/UBSetting.h"
#include "core/UBSetting.h"
#include "core/UBApplication.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "board/UBBoardController.h"
#if defined(Q_WS_MAC)
#include <ApplicationServices/ApplicationServices.h>
#endif
#include "core/memcheck.h"
#include "core/memcheck.h"
...
@@ -65,7 +70,6 @@ void UBScreenMirror::timerEvent(QTimerEvent *event)
...
@@ -65,7 +70,6 @@ void UBScreenMirror::timerEvent(QTimerEvent *event)
update
();
update
();
}
}
void
UBScreenMirror
::
grabPixmap
()
void
UBScreenMirror
::
grabPixmap
()
{
{
if
(
mSourceWidget
)
if
(
mSourceWidget
)
...
@@ -77,9 +81,26 @@ void UBScreenMirror::grabPixmap()
...
@@ -77,9 +81,26 @@ void UBScreenMirror::grabPixmap()
mRect
.
setBottomRight
(
bottomRight
);
mRect
.
setBottomRight
(
bottomRight
);
}
}
mLastPixmap
=
QPixmap
::
grabWindow
(
qApp
->
desktop
()
->
screen
(
mScreenIndex
)
->
winId
(),
// get image of desktop
mRect
.
x
(),
mRect
.
y
(),
mRect
.
width
(),
mRect
.
height
());
WId
windowID
=
qApp
->
desktop
()
->
screen
(
mScreenIndex
)
->
winId
();
#if defined(Q_WS_MAC)
// 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
=
mLastPixmap
.
scaled
(
width
(),
height
(),
Qt
::
KeepAspectRatio
,
Qt
::
SmoothTransformation
);
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