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
4dcb4309
Commit
4dcb4309
authored
Apr 25, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): show correctly windows on mac/GNU Linux/windows
parent
4d4bcf85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
14 deletions
+37
-14
Utils.cpp
linphone-desktop/src/Utils.cpp
+9
-1
Utils.hpp
linphone-desktop/src/Utils.hpp
+7
-0
App.cpp
linphone-desktop/src/app/App.cpp
+7
-5
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
+10
-0
MainWindow.js
linphone-desktop/ui/views/App/Main/MainWindow.js
+1
-5
No files found.
linphone-desktop/src/Utils.cpp
View file @
4dcb4309
...
...
@@ -20,10 +20,18 @@
* Author: Ronan Abhamon
*/
#include "Utils.hpp"
#include <QQuickWindow>
#include "Utils.hpp"
// =============================================================================
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/Utils.hpp
View file @
4dcb4309
...
...
@@ -28,6 +28,8 @@
// =============================================================================
class
QQuickWindow
;
namespace
Utils
{
inline
QString
linphoneStringToQString
(
const
std
::
string
&
string
)
{
return
QString
::
fromLocal8Bit
(
string
.
c_str
(),
static_cast
<
int
>
(
string
.
size
()));
...
...
@@ -50,6 +52,11 @@ namespace Utils {
return
findParentType
<
T
>
(
parent
);
}
// Bring a window to front.
// See: http://stackoverflow.com/questions/6087887/bring-window-to-front-raise-show-activatewindow-don-t-work
void
smartShowWindow
(
QQuickWindow
*
window
);
// Reverse function of strstr.
char
*
rstrstr
(
const
char
*
a
,
const
char
*
b
);
}
...
...
linphone-desktop/src/app/App.cpp
View file @
4dcb4309
...
...
@@ -163,7 +163,7 @@ void App::initContentApp () {
QObject
::
connect
(
this
,
&
App
::
receivedMessage
,
this
,
[
this
](
int
,
QByteArray
message
)
{
if
(
message
==
"show"
)
getMainWindow
()
->
showNormal
(
);
Utils
::
smartShowWindow
(
getMainWindow
()
);
}
);
}
...
...
@@ -338,7 +338,9 @@ void App::setTrayIcon () {
root
->
connect
(
quitAction
,
&
QAction
::
triggered
,
this
,
&
App
::
quit
);
QAction
*
restoreAction
=
new
QAction
(
"Restore"
,
root
);
root
->
connect
(
restoreAction
,
&
QAction
::
triggered
,
root
,
&
QQuickWindow
::
showNormal
);
root
->
connect
(
restoreAction
,
&
QAction
::
triggered
,
root
,
[
root
]
{
Utils
::
smartShowWindow
(
root
);
});
// trayIcon: Left click actions.
QMenu
*
menu
=
new
QMenu
();
...
...
@@ -348,7 +350,7 @@ void App::setTrayIcon () {
)
{
if
(
reason
==
QSystemTrayIcon
::
Trigger
)
{
if
(
root
->
visibility
()
==
QWindow
::
Hidden
)
root
->
showNormal
(
);
Utils
::
smartShowWindow
(
root
);
else
root
->
hide
();
}
...
...
@@ -404,9 +406,9 @@ void App::openAppAfterInit () {
setTrayIcon
();
if
(
!
mParser
.
isSet
(
"iconified"
))
getMainWindow
()
->
showNormal
(
);
Utils
::
smartShowWindow
(
getMainWindow
()
);
#else
getMainWindow
()
->
showNormal
(
);
Utils
::
smartShowWindow
(
getMainWindow
()
);
#endif // ifndef __APPLE__
}
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
4dcb4309
...
...
@@ -148,7 +148,7 @@ void CallModel::accept () {
params
->
enableVideo
(
false
);
setRecordFile
(
params
);
App
::
getInstance
()
->
getCallsWindow
()
->
show
(
);
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
()
);
mLinphoneCall
->
acceptWithParams
(
params
);
}
...
...
@@ -160,7 +160,7 @@ void CallModel::acceptWithVideo () {
params
->
enableVideo
(
true
);
setRecordFile
(
params
);
App
::
getInstance
()
->
getCallsWindow
()
->
show
(
);
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
()
);
mLinphoneCall
->
acceptWithParams
(
params
);
}
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
4dcb4309
...
...
@@ -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
)
App
::
getInstance
()
->
getCallsWindow
()
->
show
(
);
Utils
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
()
);
CallModel
*
call
=
new
CallModel
(
linphoneCall
);
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
4dcb4309
...
...
@@ -205,6 +205,16 @@ 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 @
4dcb4309
...
...
@@ -28,11 +28,7 @@ function unlockView () {
function
setView
(
view
,
props
)
{
function
apply
(
view
,
props
)
{
if
(
window
.
visibility
===
Window
.
Minimized
)
{
window
.
visibility
=
Window
.
AutomaticVisibility
}
else
{
window
.
setVisible
(
true
)
}
Utils
.
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