Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
linphone-desktop
Commits
368a4eb1
Commit
368a4eb1
authored
Apr 27, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app): test another solution to show correctly windows...
parent
33d648c8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
25 deletions
+24
-25
Utils.cpp
linphone-desktop/src/Utils.cpp
+0
-6
App.cpp
linphone-desktop/src/app/App.cpp
+17
-5
App.hpp
linphone-desktop/src/app/App.hpp
+2
-0
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+2
-2
CallsListModel.cpp
linphone-desktop/src/components/calls/CallsListModel.cpp
+1
-1
utils.js
linphone-desktop/ui/scripts/Utils/utils.js
+0
-10
MainWindow.js
linphone-desktop/ui/views/App/Main/MainWindow.js
+2
-1
No files found.
linphone-desktop/src/Utils.cpp
View file @
368a4eb1
...
...
@@ -26,12 +26,6 @@
// =============================================================================
void
Utils
::
smartShowWindow
(
QQuickWindow
*
window
)
{
window
->
show
();
window
->
raise
();
window
->
requestActivate
();
}
char
*
Utils
::
rstrstr
(
const
char
*
a
,
const
char
*
b
)
{
size_t
a_len
=
strlen
(
a
);
size_t
b_len
=
strlen
(
b
);
...
...
linphone-desktop/src/app/App.cpp
View file @
368a4eb1
...
...
@@ -163,7 +163,7 @@ void App::initContentApp () {
QObject
::
connect
(
this
,
&
App
::
receivedMessage
,
this
,
[
this
](
int
,
QByteArray
message
)
{
if
(
message
==
"show"
)
Utils
::
smartShowWindow
(
getMainWindow
());
App
::
smartShowWindow
(
getMainWindow
());
}
);
}
...
...
@@ -251,6 +251,18 @@ QQuickWindow *App::getSettingsWindow () {
// -----------------------------------------------------------------------------
void
App
::
smartShowWindow
(
QQuickWindow
*
window
)
{
window
->
setVisible
(
true
);
if
(
window
->
visibility
()
==
QWindow
::
Minimized
)
window
->
show
();
window
->
raise
();
window
->
requestActivate
();
}
// -----------------------------------------------------------------------------
bool
App
::
hasFocus
()
const
{
return
getMainWindow
()
->
isActive
()
||
(
mCallsWindow
&&
mCallsWindow
->
isActive
());
}
...
...
@@ -333,7 +345,7 @@ void App::setTrayIcon () {
QAction
*
restoreAction
=
new
QAction
(
"Restore"
,
root
);
root
->
connect
(
restoreAction
,
&
QAction
::
triggered
,
root
,
[
root
]
{
Utils
::
smartShowWindow
(
root
);
App
::
smartShowWindow
(
root
);
});
// trayIcon: Left click actions.
...
...
@@ -344,7 +356,7 @@ void App::setTrayIcon () {
)
{
if
(
reason
==
QSystemTrayIcon
::
Trigger
)
{
if
(
root
->
visibility
()
==
QWindow
::
Hidden
)
Utils
::
smartShowWindow
(
root
);
App
::
smartShowWindow
(
root
);
else
root
->
hide
();
}
...
...
@@ -400,9 +412,9 @@ void App::openAppAfterInit () {
setTrayIcon
();
if
(
!
mParser
.
isSet
(
"iconified"
))
Utils
::
smartShowWindow
(
getMainWindow
());
App
::
smartShowWindow
(
getMainWindow
());
#else
Utils
::
smartShowWindow
(
getMainWindow
());
App
::
smartShowWindow
(
getMainWindow
());
#endif // ifndef __APPLE__
}
...
...
linphone-desktop/src/app/App.hpp
View file @
368a4eb1
...
...
@@ -69,6 +69,8 @@ public:
return
static_cast
<
App
*>
(
QApplication
::
instance
());
}
Q_INVOKABLE
static
void
smartShowWindow
(
QQuickWindow
*
window
);
public
slots
:
void
quit
();
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
368a4eb1
...
...
@@ -148,7 +148,7 @@ void CallModel::accept () {
params
->
enableVideo
(
false
);
setRecordFile
(
params
);
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
App
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
mLinphoneCall
->
acceptWithParams
(
params
);
}
...
...
@@ -160,7 +160,7 @@ void CallModel::acceptWithVideo () {
params
->
enableVideo
(
true
);
setRecordFile
(
params
);
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
App
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
mLinphoneCall
->
acceptWithParams
(
params
);
}
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
368a4eb1
...
...
@@ -172,7 +172,7 @@ bool CallsListModel::removeRows (int row, int count, const QModelIndex &parent)
void
CallsListModel
::
addCall
(
const
shared_ptr
<
linphone
::
Call
>
&
linphoneCall
)
{
if
(
linphoneCall
->
getDir
()
==
linphone
::
CallDirOutgoing
)
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
App
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
CallModel
*
call
=
new
CallModel
(
linphoneCall
);
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
368a4eb1
...
...
@@ -205,16 +205,6 @@ function setTimeout (parent, delay, cb) {
return
timer
}
// -----------------------------------------------------------------------------
// Bring a window to front.
// See: http://stackoverflow.com/questions/6087887/bring-window-to-front-raise-show-activatewindow-don-t-work
function
smartShowWindow
(
window
)
{
window
.
show
()
window
.
raise
()
window
.
requestActivate
()
}
// =============================================================================
// GENERIC.
// =============================================================================
...
...
linphone-desktop/ui/views/App/Main/MainWindow.js
View file @
368a4eb1
...
...
@@ -2,6 +2,7 @@
// `MainWindow.qml` Logic.
// =============================================================================
.
import
Linphone
1.0
as
Linphone
.
import
QtQuick
.
Window
2.2
as
Window
.
import
'
qrc:/ui/scripts/Utils/utils.js
'
as
Utils
...
...
@@ -35,7 +36,7 @@ function unlockView () {
function
setView
(
view
,
props
)
{
function
apply
(
view
,
props
)
{
Utils
.
smartShowWindow
(
window
)
Linphone
.
App
.
smartShowWindow
(
window
)
var
item
=
mainLoader
.
item
...
...
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