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
6d109d8d
Commit
6d109d8d
authored
Nov 01, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed crash on desktop and web mode
parent
dc923f8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
36 deletions
+35
-36
Sankore_3.1.pro
Sankore_3.1.pro
+0
-7
UBScreenMirror.cpp
src/gui/UBScreenMirror.cpp
+35
-29
No files found.
Sankore_3.1.pro
View file @
6d109d8d
...
...
@@ -292,42 +292,36 @@ macx {
TRANSLATION_ar.path = "$$RESOURCES_DIR/ar.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ar
}
exists(resources/i18n/sankore_iw.qm) {
TRANSLATION_iw.files = resources/i18n/sankore_iw.qm \
resources/i18n/Localizable.strings
TRANSLATION_iw.path = "$$RESOURCES_DIR/iw.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_iw
}
exists(resources/i18n/sankore_pt.qm) {
TRANSLATION_pt.files = resources/i18n/sankore_pt.qm \
resources/i18n/Localizable.strings
TRANSLATION_pt.path = "$$RESOURCES_DIR/pt.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_pt
}
exists(resources/i18n/sankore_sk.qm) {
TRANSLATION_sk.files = resources/i18n/sankore_sk.qm \
resources/i18n/Localizable.strings
TRANSLATION_sk.path = "$$RESOURCES_DIR/sk.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_sk
}
exists(resources/i18n/sankore_bg.qm) {
TRANSLATION_bg.files = resources/i18n/sankore_bg.qm \
resources/i18n/Localizable.strings
TRANSLATION_bg.path = "$$RESOURCES_DIR/bg.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_bg
}
exists(resources/i18n/sankore_ca.qm) {
TRANSLATION_ca.files = resources/i18n/sankore_ca.qm \
resources/i18n/Localizable.strings
TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ca
}
exists(resources/i18n/sankore_el.qm) {
TRANSLATION_el.files = resources/i18n/sankore_el.qm \
resources/i18n/Localizable.strings
...
...
@@ -346,7 +340,6 @@ macx {
translation_cs.path = "$$resources_dir/cs.lproj"
qmake_bundle_data += translation_cs
}
exists(resources/i18n/sankore_mg.qm) {
translation_mg.files = resources/i18n/sankore_mg.qm \
resources/i18n/localizable.strings
...
...
src/gui/UBScreenMirror.cpp
View file @
6d109d8d
...
...
@@ -80,35 +80,41 @@ 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
();
#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
// 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
);
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