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 {
...
@@ -292,42 +292,36 @@ macx {
TRANSLATION_ar.path = "$$RESOURCES_DIR/ar.lproj"
TRANSLATION_ar.path = "$$RESOURCES_DIR/ar.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ar
QMAKE_BUNDLE_DATA += TRANSLATION_ar
}
}
exists(resources/i18n/sankore_iw.qm) {
exists(resources/i18n/sankore_iw.qm) {
TRANSLATION_iw.files = resources/i18n/sankore_iw.qm \
TRANSLATION_iw.files = resources/i18n/sankore_iw.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
TRANSLATION_iw.path = "$$RESOURCES_DIR/iw.lproj"
TRANSLATION_iw.path = "$$RESOURCES_DIR/iw.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_iw
QMAKE_BUNDLE_DATA += TRANSLATION_iw
}
}
exists(resources/i18n/sankore_pt.qm) {
exists(resources/i18n/sankore_pt.qm) {
TRANSLATION_pt.files = resources/i18n/sankore_pt.qm \
TRANSLATION_pt.files = resources/i18n/sankore_pt.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
TRANSLATION_pt.path = "$$RESOURCES_DIR/pt.lproj"
TRANSLATION_pt.path = "$$RESOURCES_DIR/pt.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_pt
QMAKE_BUNDLE_DATA += TRANSLATION_pt
}
}
exists(resources/i18n/sankore_sk.qm) {
exists(resources/i18n/sankore_sk.qm) {
TRANSLATION_sk.files = resources/i18n/sankore_sk.qm \
TRANSLATION_sk.files = resources/i18n/sankore_sk.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
TRANSLATION_sk.path = "$$RESOURCES_DIR/sk.lproj"
TRANSLATION_sk.path = "$$RESOURCES_DIR/sk.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_sk
QMAKE_BUNDLE_DATA += TRANSLATION_sk
}
}
exists(resources/i18n/sankore_bg.qm) {
exists(resources/i18n/sankore_bg.qm) {
TRANSLATION_bg.files = resources/i18n/sankore_bg.qm \
TRANSLATION_bg.files = resources/i18n/sankore_bg.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
TRANSLATION_bg.path = "$$RESOURCES_DIR/bg.lproj"
TRANSLATION_bg.path = "$$RESOURCES_DIR/bg.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_bg
QMAKE_BUNDLE_DATA += TRANSLATION_bg
}
}
exists(resources/i18n/sankore_ca.qm) {
exists(resources/i18n/sankore_ca.qm) {
TRANSLATION_ca.files = resources/i18n/sankore_ca.qm \
TRANSLATION_ca.files = resources/i18n/sankore_ca.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj"
TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ca
QMAKE_BUNDLE_DATA += TRANSLATION_ca
}
}
exists(resources/i18n/sankore_el.qm) {
exists(resources/i18n/sankore_el.qm) {
TRANSLATION_el.files = resources/i18n/sankore_el.qm \
TRANSLATION_el.files = resources/i18n/sankore_el.qm \
resources/i18n/Localizable.strings
resources/i18n/Localizable.strings
...
@@ -346,7 +340,6 @@ macx {
...
@@ -346,7 +340,6 @@ macx {
translation_cs.path = "$$resources_dir/cs.lproj"
translation_cs.path = "$$resources_dir/cs.lproj"
qmake_bundle_data += translation_cs
qmake_bundle_data += translation_cs
}
}
exists(resources/i18n/sankore_mg.qm) {
exists(resources/i18n/sankore_mg.qm) {
translation_mg.files = resources/i18n/sankore_mg.qm \
translation_mg.files = resources/i18n/sankore_mg.qm \
resources/i18n/localizable.strings
resources/i18n/localizable.strings
...
...
src/gui/UBScreenMirror.cpp
View file @
6d109d8d
...
@@ -80,35 +80,41 @@ void UBScreenMirror::timerEvent(QTimerEvent *event)
...
@@ -80,35 +80,41 @@ void UBScreenMirror::timerEvent(QTimerEvent *event)
void
UBScreenMirror
::
grabPixmap
()
void
UBScreenMirror
::
grabPixmap
()
{
{
if
(
mSourceWidget
)
// if (mSourceWidget)
{
// {
QPoint
topLeft
=
mSourceWidget
->
mapToGlobal
(
mSourceWidget
->
geometry
().
topLeft
());
// QPoint topLeft = mSourceWidget->mapToGlobal(mSourceWidget->geometry().topLeft());
QPoint
bottomRight
=
mSourceWidget
->
mapToGlobal
(
mSourceWidget
->
geometry
().
bottomRight
());
// QPoint bottomRight = mSourceWidget->mapToGlobal(mSourceWidget->geometry().bottomRight());
mRect
.
setTopLeft
(
topLeft
);
// mRect.setTopLeft(topLeft);
mRect
.
setBottomRight
(
bottomRight
);
// mRect.setBottomRight(bottomRight);
}
// }
// get image of desktop
// // get image of desktop
WId
windowID
=
qApp
->
desktop
()
->
screen
(
mScreenIndex
)
->
winId
();
// WId windowID = qApp->desktop()->screen(mScreenIndex)->winId();
#if defined(Q_WS_MAC)
// qDebug() << windowID;
// Available in Mac OS X v10.6 and later.
//#if defined(Q_WS_MAC)
CGRect
grabRect
;
grabRect
.
origin
.
x
=
mRect
.
x
();
// TODO: bad mac fix. On dual screen mac os x and let web mode for more than one minute and it crashed
grabRect
.
origin
.
y
=
mRect
.
y
();
// NSAutorelease pull should avoid this.
grabRect
.
size
.
width
=
mRect
.
width
();
grabRect
.
size
.
height
=
mRect
.
height
();
// // Available in Mac OS X v10.6 and later.
CGImageRef
windowImage
=
CGWindowListCreateImage
(
grabRect
// CGRect grabRect;
,
kCGWindowListOptionOnScreenOnly
// grabRect.origin.x = mRect.x();
,
windowID
// grabRect.origin.y = mRect.y();
,
kCGWindowImageDefault
);
// grabRect.size.width = mRect.width();
// grabRect.size.height = mRect.height();
mLastPixmap
=
QPixmap
::
fromMacCGImageRef
(
windowImage
);
// CGImageRef windowImage = CGWindowListCreateImage(grabRect
#else
// ,kCGWindowListOptionOnScreenOnly
// ,windowID
mLastPixmap
=
QPixmap
::
grabWindow
(
windowID
,
mRect
.
x
(),
mRect
.
y
(),
mRect
.
width
(),
mRect
.
height
());
// ,kCGWindowImageDefault);
#endif
// 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
);
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