Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-qt
Commits
b7d4e112
Commit
b7d4e112
authored
4 years ago
by
Pierre Lespagnol
Browse files
Options
Downloads
Patches
Plain Diff
avadapter: fix screen sharing area for linux
Change-Id: I49dd406a8eca39e628985ea3d69a9c31e59fdc74
parent
8b2512c5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/avadapter.cpp
+23
-29
23 additions, 29 deletions
src/avadapter.cpp
src/avadapter.h
+5
-0
5 additions, 0 deletions
src/avadapter.h
with
28 additions
and
29 deletions
src/avadapter.cpp
+
23
−
29
View file @
b7d4e112
...
...
@@ -88,21 +88,8 @@ AvAdapter::shareEntireScreen(int screenNumber)
return
;
QRect
rect
=
screen
->
geometry
();
int
display
=
0
;
#ifdef Q_OS_WIN
display
=
screenNumber
;
#else
QString
display_env
{
getenv
(
"DISPLAY"
)};
if
(
!
display_env
.
isEmpty
())
{
auto
list
=
display_env
.
split
(
":"
,
Qt
::
SkipEmptyParts
);
// Should only be one display, so get the first one
if
(
list
.
size
()
>
0
)
{
display
=
list
.
at
(
0
).
toInt
();
}
}
#endif
LRCInstance
::
avModel
()
.
setDisplay
(
display
,
rect
.
x
(),
rect
.
y
(),
rect
.
width
(),
rect
.
height
(),
getCurrentCallId
());
.
setDisplay
(
getScreenNumber
()
,
rect
.
x
(),
rect
.
y
(),
rect
.
width
(),
rect
.
height
(),
getCurrentCallId
());
}
void
...
...
@@ -117,7 +104,7 @@ AvAdapter::shareAllScreens()
height
=
scr
->
geometry
().
height
();
}
LRCInstance
::
avModel
().
setDisplay
(
0
,
0
,
0
,
width
,
height
,
getCurrentCallId
());
LRCInstance
::
avModel
().
setDisplay
(
getScreenNumber
()
,
0
,
0
,
width
,
height
,
getCurrentCallId
());
}
void
...
...
@@ -183,18 +170,6 @@ void
AvAdapter
::
shareScreenArea
(
unsigned
x
,
unsigned
y
,
unsigned
width
,
unsigned
height
)
{
#ifdef Q_OS_LINUX
int
display
;
// Get display
QString
display_env
{
getenv
(
"DISPLAY"
)};
if
(
!
display_env
.
isEmpty
())
{
auto
list
=
display_env
.
split
(
":"
,
Qt
::
SkipEmptyParts
);
// Should only be one display, so get the first one
if
(
list
.
size
()
>
0
)
{
display
=
list
.
at
(
0
).
toInt
();
}
}
// xrectsel will freeze all displays too fast so that the call
// context menu will not be closed even closed signal is emitted
// use timer to wait until popup is closed
...
...
@@ -202,7 +177,7 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
x
=
y
=
width
=
height
=
0
;
xrectsel
(
&
x
,
&
y
,
&
width
,
&
height
);
LRCInstance
::
avModel
().
setDisplay
(
0
,
LRCInstance
::
avModel
().
setDisplay
(
getScreenNumber
()
,
x
,
y
,
width
<
128
?
128
:
width
,
...
...
@@ -210,7 +185,7 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
getCurrentCallId
());
});
#else
LRCInstance
::
avModel
().
setDisplay
(
0
,
LRCInstance
::
avModel
().
setDisplay
(
getScreenNumber
()
,
x
,
y
,
width
<
128
?
128
:
width
,
...
...
@@ -302,3 +277,22 @@ AvAdapter::slotDeviceEvent()
deviceListSize_
=
currentDeviceListSize
;
}
int
AvAdapter
::
getScreenNumber
()
const
{
int
display
=
0
;
#ifdef Q_OS_LINUX
// Get display
QString
display_env
{
getenv
(
"DISPLAY"
)};
if
(
!
display_env
.
isEmpty
())
{
auto
list
=
display_env
.
split
(
":"
,
Qt
::
SkipEmptyParts
);
// Should only be one display, so get the first one
if
(
list
.
size
()
>
0
)
{
display
=
list
.
at
(
0
).
toInt
();
}
}
#endif
return
display
;
}
This diff is collapsed.
Click to expand it.
src/avadapter.h
+
5
−
0
View file @
b7d4e112
...
...
@@ -107,4 +107,9 @@ private:
* Device changed slot.
*/
void
slotDeviceEvent
();
/*
* Get the screen number
*/
int
getScreenNumber
()
const
;
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment